Skip to main content
Participant
April 20, 2010
Question

XML descendants showing up blank?

  • April 20, 2010
  • 1 reply
  • 416 views

I wonder if any of you have a suggestion for me here...

var file = new File( /path/to/my/file.xml );

file.open('r');

var fileString = file.read();

var xml = new XML( fileString ); // everything's fine up to this point...

xml.descendants(); // returns the full contents of xml, so I know xml has content.

xml.descendants( 'Row' ); // returns nothing, even though there are definitely <Row> elements in the document.

Am I not using the 'descendants' method properly? Does anybody see something wrong in my syntax?

Thanks

This topic has been closed for replies.

1 reply

tjlahr10Author
Participant
April 20, 2010

I've looked a little more into it and it seems like the XML parser is getting tripped up when I use xmlns="urn:schemas-microsoft-com:office:spreadsheet" (this XML document was exported from Excel) on the root element. Is it possible that the JS XML methods break if you use the xmlns attribute??


Thanks.

Inspiring
April 22, 2010

How are you exporting from Excel? You have to export as XML Data not XML spreadsheet.