January 31st, 2013, 12:54 PM
I've got a code example:
Can anyone explain/tell me to which namespace each name belongs and why?
January 31st, 2013, 03:33 PM
Pick any node. Is there a namespace prefix on it? If so then find the namespace URI for that prefix. If not then find the closest xmlns without a suffix and use that URI, and if there isn't one then it's in the default namespace.
Same idea for attributes: if there's a prefix then find the closest xmlnsrefix, otherwise look for the nearest xmlns.
Given that, what do you think the answers are?
February 1st, 2013, 05:38 AM
a - doesn't belong to any namespace
c - belongs to urn:x
e - belongs to urn:d
f - belongs to urn:b
i - belongs to urn:y
j - belongs to urn:y
k - belongs to urn:b2
m - belongs to urn:x
n - doesn't belong to any namespace
p - doesn't belong to any namespace
is this correct?