[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: XRI Res 2 WD10
I have a question about XML namespaces that I started trying to ask the
other day, but I'm still confused over it. (And Googling the subject,
it seems like a lot of other people are too.)
...namespace prefixes are, as far as I can tell, entirely
arbitrary. In other words, if I started an XRD element with:
<XRD xmlns:foofoo="xri://$xrd*($v*2.0)">
then the child elements would look like:
< foofoo:Query>*foo</Query>
It's also logically equivalent to not prefix the namespace at all,
making it the default/implicit namespace:
<XRD xmlns="xri://$xrd*($v*2.0)">
<Query>*foo</Query>
This is a pain to deal with when doing XPath queries, and some of the
YADIS people, who I'm sure are going to be parsing XRDs with regular
expressions, will be completely screwed. Is there any way in XML to
specify that xmlns="xri://$xrd*($v*2.0)" will be the required implicit
namespace in an XRD element, producing the alternate example that I've
also attached?
...my own understanding: you can always tell an XML parser to## Yes, but this statement is followed by "The XML Namespaces Recommendation does not take this approach, because XML 1.0 parsers would not be able to handle such documents."
quality an element by its namespace, and if so, that will use the
*fully-qualified* namespace prefix, not the temporary namespace prefix set
up inside the XML document.
A full explanation of this by the fantastic James Clark is at:
http://www.jclark.com/xml/xmlns.htm
By this explanation, it is clear that all implementers can be sure they are
getting the right XRD element simply by asking for everything
fully-qualified, i.e.:
<{xri://$xrd*($v*2.0)}Query/>
<{xri://$xrd*($v*2.0)}Expires/>
<{xri://$xrd*($v*2.0)}Service/>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]