Is there any way to remove namespace for a particular element?
相关问题
- XML - XSLT - document() function inside count() fu
- Using XSLT to select after EACH instance in a stri
- XSLT open other xml files
- How to use MSbuild property in TransformXml task?
- Using asp objects in .NET - Max compatibility
相关文章
- xslt localization
- convert xml to soap request using xslt transformat
- XALAN register Extension Function like in SAXON
- How to group using XSLT
- How to reformat XML with group-adjacent (XSLT)
- AddExtensionObject - Performance
- Transforming HTML nodes with XSLT in chrome/webkit
- visual studio 2015 xsl debugging transformation fa
This transformation:
removes any element from the
"my:x"
namespace and puts it into "no namespace".For example, when applied to the following XML document:
the wanted, correct result is produced:
To remove only a specific element from a specific namespace, the template overriding the identity rule must just be made more specific to match only the wanted element.
Your XSLT output is a fresh object (Node or text) and you can copy or transform each element to a new one without a namespace. Assume your input uses a namespace "http://www.foo/". You create elements of the same name (and possibly the same children) without a namespace.
will create a new node with the default namespace which doesn't require a prefix and I think is what you need. [There may be more elegant ways using xsl:copy... -
UPDATE: ... and @Dmitri has shown them!