Re: [xml] Namespace Handling

Balint Joo wrote:
>>Then I can do queries from there with namespaces
>>(eg //bj:gnus )?

If you ask a tool to do something with


you *must* provide the namespace name (ag a URI) for the prefix.
(as Daniel said)

Daniel Veillard wrote:
>   if bj is defined on the root node, then fine,

It still could be remapped to a different namespace name somewhere in the document, no?

>   You're making one fundamental mistake. The prefixes are not
> important
> what is important is the namespace name. You search for gnus in "bar"
> namespace and that can be expressed as
>    bk mapped to "bar"
>    //bk:gnus
>  even if in the instance it uses the bj prefix.


Even some implementers get this wrong which is catastrophic ...
throwing an error for each undeclared prefix (be it in XPath queries, documents, or etc) is the only way.



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