[xml] Namespace/Parser properties




We use libxml2 to create conversions from XML files to other data sources.

We ran into an issue with namespaces that broke all of our code.
We have searched for 3 days and cannot find a solution.

Using other XML parsers there are properties that allow the loaded XML doc
to include the namespace with the Element name.
So, in the 'foo' namespace the 'Book' element would have a name of 'foo:Book'.

We would not tend to bother people on an email list, but the other 4 parsers we use have this 
feature.

This is critical to us as our parsers know nothing about the documents it is being fed,
and the parser needs to read the entire XML file, regardless of namespaces.
What we found was that if the doc has three namespaces that use the 'Book' element
we find three 'Book' elements and cannot tell them apart.
Worse is that if we load an XSD, the namespaces get taken out and the document is
unusable.

Is there a property to set so that we can get the element name with the namespace included?
-OR-
Is there a function to call on an xmlNodePtr to get its namespace and its element name back as one 
char/ptr?

Thanks for any assistance you can offer,
Al G




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]