PDA

View Full Version : Vizard and XML


xingtzu
07-31-2007, 11:17 PM
Hello,

I have been attempting to get vizard to import data from an XML file using SAX2 interface. I have downloaded PyXML and have been racking my brain trying to get this to work with vizard. If someone could possibly help I would appreciate it. My goal for right now is to write a peace of code that would parse an XML document for a specific bit of info than assign it to a variable to be printed as a static image in vizard.

Ideally the program will parse multiple XML documents sequentially then add each of there information to an array which will then be able to be viewed. For example parsing a book which has an XML document for each page, then using the page number tags to put the number in the bottom left of the VR book and the body tags to write the text on the page. As I turn back and forth on the pages, the array increments or decrements than shows the information on that page as it did the previous.

I hope this explanation is sufficient and any help on Vizard and XML would be appreciated.

farshizzo
08-01-2007, 12:43 PM
Hi,

I use the elementtree module for parsing XML files. It is super easy to use. You can find more info about it here:

http://effbot.org/zone/element-index.htm

I've attached a zip file which contains the module and a sample script showing how to use it. Hope this helps.

xingtzu
08-01-2007, 05:31 PM
Thanks this is exactly what I needed. I appreciate the help, wish I had asked sooner.