2011/1/21 Mark Boon
<mboon@blueplanetsoftware.com>
...It looks like I got it working using *:Ontology. I must say I never understood why namespaces must make things so complicated and counterintuitive.
Hi Mark.Namespaces are a mean, which let you live in quite complex universe, where more spaces are intersecting.
You may think of writting XQuery
for $x from my_universe
return the-thing-I-am-thinking-of($x)
(Un)Fortunately, this function was not implemented yet :-) (Are you really sure, what would your thoughts return to you?)
But back to intersecting space - if you think of it, you realize, it is very easy to pick up something wrong, or to miss something. And we shall be happy, that in our XML space those separate spaces have names, so we can be enough explicit in telling what we really want.
OK, apart from philosophical thoughts, I have simple rules, which helped me using namespaces
- prefixes are just temporary abbreviations for real namespaces (fully qualified) and the prefixes can change during single XML document
- imagine, that all prefixes (including the empty one) are replaced by fully qualified namespace name (and you may get rid of xmlns: attribues as they become useless)
So for
<openlr:OpenLR>
<openlr:LocationID>defg123</openlr:LocationID>
......
</openlr:OpenLR>
<LocationID>defg123</LocationID>
</Traffic>
you get
This way it is perfectly clear, what namespaces are effective.
I agree, namespaces are not easy to start with, but my feeling is, the complexity of namespace apparatus is balanced with complexity of the problem it should resolve. And once you get it - it will be clear and easy.
Wish you the best.
Jan