I want to add a couple of elements at the end of an XML document, right before the closing of the root node, and I\'m using an XSL to do the transformation.
The source X
Try it this way?
my content
If all you ever want to do is add the new element/s, then you could shorten this to:
my content
In your example input, the root element - and by inheritance, all of its child nodes - is in a namespace. If you want the added element/s to be in the same namespace, use:
my content
instead of:
my content
why doesn't it work if I put
(is the document root node) instead of?
That too is the result of the root element being in a namespace. In order to address it by name, you need to assign a prefix to the namespace and use it in the XPpath expression selecting the node:
my content
Once you have defined the prefix, you can also use it to place the added element/s in the namespace bound to the prefix:
my content
Alternatively you could do:
my content