[Home] [By Thread] [By Date] [Recent Entries]
At 2017-09-20 16:57 +0000, Bridger Dyson-Smith bdysonsmith@xxxxxxxxx wrote:
I'm having some trouble getting a namespace attached to an attribute -- instead the attribute's namespace is getting attached to the element. Namespaces are only ever attached to elements. They are never attached to attributes. Attributes use the namespaces that are attached to elements in the ancestry. I worked up a minimized example that worked the way I expected it to work, but when trying to implement my expectations I'm failing. Your "real work" results are acceptable and appropriate, I see nothing wrong. because I'm missing something with namespaces but I'm not sure what. Probably that attributes use namespaces attached to elements in the ancestry. Despite trying both serialization methods (literal and programmatic), both return the same result. And they are equivalent, provided that the XLink namespaces is declared in the ancestry. Thanks in advance for any light you can shed on this. If you want the xlink:href= attribute absent in the given element, then you have to attach it to one of the elements in the ancestry. Most folks just go ahead and attach all desired namespace nodes to the document element so that they are in scope of all elements of the document and never need to be redeclared. I hope this helps. . . . . . . Ken
|

Cart



