Re: XML::LibXML XPath fails to find xmlns:xml="http://www.w3.org/XML/1998/namespace"

Emmanuel Rodriguez <[email protected]>
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
Aristotle Pagaltzis wrote:
> * Emmanuel Rodriguez <[email protected]> [2008-12-29 11:00]:
>   
>> I think that this "bug" is a border line case as the prefix
>> 'xml' is  reserved in the XML specification.
>>     
>
> I don’t think that’s what you want either.
>
> Question: why do you care about this? You shouldn’t have to. If
> you care about it it must be either because you are using broken
> software (unfortunately we all have to deal with that all too
> often – in which case maybe we can suggest something) or because
> you are about to *write* broken software (in which case I’d
> prefer we get you to reconsider :-) ).
>   
Can it be a little bit of both? I'm writing GUI that allows one to 
execute XPath expressions and see their results. Kind of simplified 
version of 'xmllint --shell' but with nice colors. So I need to register 
the namespaces available and declared in the document in order to add 
them to the XPath context. Yes I'm writing the 'broken' software but I 
would like it to be able to handle all kinds of documents. Thus, if 
someone explicitly (re)declared the XML namespace I need to handle that 
case and register the namespaces declared.

I think that this particular 'bug' is not so important since no one is 
supposed to overload that namespace. So I could safely and transparently 
add it to the XPath context without any problems.

I just wanted to point out that XML::LibXML findnodes() returns 
different results than libxml2. I also wanted to have the opinion of 
others because I was a little bit perplexed on the purpose/usage of the 
XML namespace.

For the curious, you can take a look at the XPath GUI that I made here:
Google Code: http://code.google.com/p/xacobeo/
CPAN: http://search.cpan.org/perldoc?Xacobeo

Best regards,
Emmanuel
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.