How would the conditional statement look like if I\'m to insert a section of text into the xml below using xslt?
A better, and more elegant, way to solve this would be to use a prefix for your namespace. I prefer working with a null default namespace and using prefixes for all defined namespaces.
Matching on fn:local-name()
would match on the local name of the node in all namespaces. All that's needed in your matching condition if using a prefix for your namespace is my:item[last()]
.
Input:
-
-
XSLT:
Output:
-
-