[vtkusers] XML Parsing

Brad King brad.king at kitware.com
Tue Mar 29 09:55:05 EST 2005


norberto at ctm.ulpgc.es wrote:
> I'm trying to load a xml file with vtkXMLParse class to extract the data
> wich contain it, but the class show errors like the follows:
> ERROR: In /export/home/glehmann/rpm/BUILD/VTK/IO/vtkXMLParser.cxx, line 423
> vtkXMLParser (0x811d038): Unknown element in XML stream: address-book
> 
> The xml file is this:
> 
> <?xml version="1.0"?>
> <!DOCTYPE address-book [

To use vtkXMLParser you have to subclass it and override the 
StartElement method (and other listed in the header file) to deal with 
each element as it is encountered.  The default implementation simply 
reports an unknown element since it doesn't know what to do.

-Brad



More information about the vtkusers mailing list