WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-31-2007, 11:17 PM
xingtzu xingtzu is offline
Member
 
Join Date: Jun 2007
Posts: 5
Exclamation Vizard and XML

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.
Reply With Quote
  #2  
Old 08-01-2007, 12:43 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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.
Attached Files
File Type: zip VizardXML.zip (29.0 KB, 792 views)
Reply With Quote
  #3  
Old 08-01-2007, 05:31 PM
xingtzu xingtzu is offline
Member
 
Join Date: Jun 2007
Posts: 5
Talking Thanks

Thanks this is exactly what I needed. I appreciate the help, wish I had asked sooner.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:05 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC