[Tutor] trying to parse an xml file

bruce badouglas at gmail.com
Sat Dec 14 15:29:00 CET 2013


Hi.

Looking at a file -->>
http://www.marquette.edu/mucentral/registrar/snapshot/fall13/xml/BIOL_bysubject.xml

The file is generated via online/web url, and appears to be XML.

However, when I use elementtree:
  document = ElementTree.parse( '/apps/parseapp2/testxml.xml' )

I get an invalid error : not well-formed (invalid token):

I started to go through the file, to "remove" offending chars, but
decided there has to be a better approach. I also looked at the
underlying url/page to see what it's doing with the javascript to
parse the XML.


Anyone have any python suggestions as to how to proceed to parse out the data!

thanks


the javascript chunk ::

var dsSnapshot = new Spry.Data.XMLDataSet("xml/BIOL_bysubject.xml",
"RECORDS/RECORD");
dsSnapshot.setColumnType("nt", "html");
        dsSnapshot.setColumnType("ti", "html");
dsSnapshot.setColumnType("new", "html");
dsSnapshot.setColumnType("se", "html");
dsSnapshot.setColumnType("mt", "html");
dsSnapshot.setColumnType("ex", "html");
dsSnapshot.setColumnType("in", "html");


More information about the Tutor mailing list