I have an xsl file:
<xsl:stylesheet version="1.0" xmlns:xsl=" <xsl
utput method="xml"/>
<xsl:template match="svg">
<xsl:apply-templates select="mask"/>
</xsl:template>
<xsl:template match="mask">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
that I'm trying to use to transform an xml file:
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns=" xmlns:xlink=" xmlns:gmwmsvg=" <mask id="gwmmask">
<rect id="gwmmaskrect" x="0" y="0" width="20480" height="15360" style="fill:white"/>
</mask>
<g>
<rect id="gwmbg" x="-204800" y="-153600" width="430080" height="322560" style="fill:#ebebeb"/>
<g>
<path/>
<path/>
<path/>
</g>
</g>
</svg>
My goal is to select only the "mask" section in the results, as follows:
<mask id="gwmmask">
<rect id="gwmmaskrect" x="0" y="0" width="20480" height="15360" style="fill:white"/>
</mask>
When I try, with the xsl as above, I get no results. The only way I can get results is to use <xsl:template match="/"><xsl:copy-of select="."/></xsl:template> in the xsl (and then I get everything - not what I'm looking for). I'm thinking my problem may be the namespaces used in the <svg> node of the xml file, as it all works if I take them out. For my situation, they will need to stay in though. If anyone has any ideas, please let me know.
Thanks,
Mike
<xsl:stylesheet version="1.0" xmlns:xsl=" <xsl
<xsl:template match="svg">
<xsl:apply-templates select="mask"/>
</xsl:template>
<xsl:template match="mask">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
that I'm trying to use to transform an xml file:
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns=" xmlns:xlink=" xmlns:gmwmsvg=" <mask id="gwmmask">
<rect id="gwmmaskrect" x="0" y="0" width="20480" height="15360" style="fill:white"/>
</mask>
<g>
<rect id="gwmbg" x="-204800" y="-153600" width="430080" height="322560" style="fill:#ebebeb"/>
<g>
<path/>
<path/>
<path/>
</g>
</g>
</svg>
My goal is to select only the "mask" section in the results, as follows:
<mask id="gwmmask">
<rect id="gwmmaskrect" x="0" y="0" width="20480" height="15360" style="fill:white"/>
</mask>
When I try, with the xsl as above, I get no results. The only way I can get results is to use <xsl:template match="/"><xsl:copy-of select="."/></xsl:template> in the xsl (and then I get everything - not what I'm looking for). I'm thinking my problem may be the namespaces used in the <svg> node of the xml file, as it all works if I take them out. For my situation, they will need to stay in though. If anyone has any ideas, please let me know.
Thanks,
Mike