I have the following XML that can be displayed in any form in my XML document:
<Message xsi:schemaLocation="http://www.location.com StructureFile.xsd" xmlns=http://www.thenamespace.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
or
<Message xmlns="http://www.thenamespace.com">
and I need a conclusion:
<Message xmlns="http://www.theNEWnamespace.com">
This template currently handles a shorter version of two xml features:
<xsl:template match="*">
<xsl:element name="{name()}" namespace="http://www.theNEWnamespace.com">
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
However, this does not delete the SchemeLocation or xmlns: xsi xml sections, if they exist.
How do I proceed to adapt the above to handle both possibilities.
Greetings
Edit: XML structure:
<?xml version="1.0" encoding="utf-8"?>
<Message xsi:schemaLocation="http://www.location.com StructureFile.xsd" xmlns="http://www.thenamespace.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
<Info></Info>
</Header>
</Message>
source
share