You need to turn namespace processing (by calling theParser.setDoNamespaces(true) ) in order to have them created.

Alberto

Moddy Te'eni ha scritto:
I'm reading an XML file with the following code:

                const LocalFileInputSource      theInputSource(fileName);

                XercesDOMParser theParser;

HandlerBase error_handler;
                theParser.setErrorHandler(&error_handler);

                theParser.parse(theInputSource);

                DOMNode* node = theParser.getDocument();

                DOMNode* child = node->getFirstChild();
                cout << "name " << child->getNodeName() << endl;
                cout << "prefix " << child->getPrefix() << endl;

The input looks something like:

<aaa:ROOT xmlns:aaa="http://www.something/something";>
<aaa:ELEMENT num="5"/>
</aaa:ROOT>

this outputs name to be "aaa:ROOT, and the prefix to be empty.

Why is it? How can i make it work correctly?

(My real problem is that afterwords I run XPath queries on this using
Xalan's  XercesDOMWrapper, and it doesn't find anything)

Thanks, Moddy.




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to