As already mentioned, for reference to element c . in its tag name you can just escape it:
a\.b
But the same cannot be said for the b:c element, because : has special meaning in XML, as a namespace delimiter. This means that the element you have is actually an element c in the namespace b , not an element named b:c . 1
However, there are two correct ways to select this item. Firstly, since, as I mentioned, the element is actually called c , not b:c , you can simply use:
c
The second way, in case of namespace conflicts, is to first declare the namespace b at the beginning of your stylesheet using @namespace , which matches the one contained in your XML document (the document must have xmlns: b link), otherwise it will not be valid):
@namespace b 'http://ns.example.com/b';
Then use the namespace prefix to select the item:
b|c
1 Remember that we are talking about XML here, not HTML or an arbitrary markup language, where : does not really matter.
source share