Re: [xml] Can I read namespace URIs as regular attributes?



Jianqing Zhang schrieb:
Thanks Michael. I'm using C++ and have not figured it out. I'm
wondering how I can get these namespace URIs.

It sure is possible.

print $_->name, "\t", $_->value, "\n"
       for $doc->documentElement->getNamespaces;

print $_->name, "\t", $_->value, "\n"
       for $doc->documentElement->attributes;

Take a look at the Perl bindings. You can download the tarball here:

http://search.cpan.org/~pajas/XML-LibXML-1.69/

For example, xpath.c uses a function called xmlGetNsList.

--
Michael Ludwig



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