I'm applying a transform to SVG documents, to make them validate against the SVG RNG schema. I have everything working EXCEPT the name spaces on the SVG element itself. These SVG documents where edited in Adobe Illistrator, and the original SVG element is:<br>
<br><svg xmlns="<a href="http://www.w3.org/2000/svg">http://www.w3.org/2000/svg</a>" xmlns:a="<a href="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/">http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/</a>" xmlns:graph="<a href="http://ns.adobe.com/Graphs/1.0/">http://ns.adobe.com/Graphs/1.0/</a>" xmlns:i="<a href="http://ns.adobe.com/AdobeIllustrator/10.0/">http://ns.adobe.com/AdobeIllustrator/10.0/</a>" xmlns:x="<a href="http://ns.adobe.com/Extensibility/1.0/">http://ns.adobe.com/Extensibility/1.0/</a>" xmlns:xlink="<a href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</a>"><br>
<br><br>and what I want is:<br><br><svg xmlns="<a href="http://www.w3.org/2000/svg">http://www.w3.org/2000/svg</a>" xmlns:xlink="<a href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</a>"><br>
<br>The stylesheet starts:<br><xsl:stylesheet xmlns:xsl="<a href="http://www.w3.org/1999/XSL/Transform">http://www.w3.org/1999/XSL/Transform</a>"<br> xmlns:xs="<a href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a>"<br>
xmlns:xd="<a href="http://www.oxygenxml.com/ns/doc/xsl">http://www.oxygenxml.com/ns/doc/xsl</a>"<br> xmlns:i="<a href="http://ns.adobe.com/AdobeIllustrator/10.0/">http://ns.adobe.com/AdobeIllustrator/10.0/</a>"<br>
xmlns:a="<a href="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/">http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/</a>"<br> xmlns:graph="<a href="http://ns.adobe.com/Graphs/1.0/">http://ns.adobe.com/Graphs/1.0/</a>" <br>
xmlns:x="<a href="http://ns.adobe.com/Extensibility/1.0/">http://ns.adobe.com/Extensibility/1.0/</a>"<br> exclude-result-prefixes="xs xd a x graph"<br> xpath-default-namespace="<a href="http://www.w3.org/2000/svg">http://www.w3.org/2000/svg</a>"<br>
version="2.0"><br><br><br>My understanding is that 'exclude-result-prefixes="xs xd a x graph"' should not copy over the namespaces identified, but a, x, and graph are still there in the output. My main template is below, and it keeps the namespace & extensions off of the child elements of SVG, just not the SVG node itself.<br>
<br> <xsl:template match="@*|node()"><br> <xsl:choose><br> <xsl:when test=". = //i:pgf"/> <!-- This is the BLOB --><br> <xsl:when test=". = //@i:*" /> <!-- These three are all of the Adobe extensions --><br>
<xsl:when test=". = //metadata"/><br> <xsl:when test=". = //foreignObject"/><br> <xsl:when test=". = //switch"> <!-- We do not want the switch elements, just their text nodes. --><br>
<xsl:apply-templates select="node()"/><br> </xsl:when><br> <xsl:otherwise><br> <xsl:copy><br> <xsl:apply-templates select="@*|node()"/><br>
</xsl:copy><br> </xsl:otherwise><br> </xsl:choose><br> </xsl:template><br> <br><br>Any ideas?<br>