F
Foxpointe
I'd greatly appreciate it if someone could clue me in to a less
verbose/clunky way of accomplishing this: Given some XHTML input, I
need to strip and transform certain tags and while I've currently got a
working solution, it seems like there should be a 'cleaner' way to get
the job done. Given the following snippet...
<xsl:stylesheet version="1.0"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xhtml"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:template match="xhtml:font | xhtml:b | xhtml:i | xhtml:u">
<!--<xsl:value-of select="."/>-->
<xsl:choose>
<xsl:when test="node()">
<xsl:apply-templates select="node()"/>
</xsl:when>
<xsltherwise>
<xsl:value-of select="text()"/>
</xsltherwise>
</xsl:choose>
</xsl:template>
....is there a way to eliminate the need to prefix all of my match terms
with xhtml:? In reading other posts, I was under the impression that
xmlns="http://www.w3.org/1999/xhtml" would set the default namespace but
it didn't do what I expected (i.e. eliminate the need for the prefix)...
so what exactly does it do?
Thanks,
Phil
verbose/clunky way of accomplishing this: Given some XHTML input, I
need to strip and transform certain tags and while I've currently got a
working solution, it seems like there should be a 'cleaner' way to get
the job done. Given the following snippet...
<xsl:stylesheet version="1.0"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xhtml"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:template match="xhtml:font | xhtml:b | xhtml:i | xhtml:u">
<!--<xsl:value-of select="."/>-->
<xsl:choose>
<xsl:when test="node()">
<xsl:apply-templates select="node()"/>
</xsl:when>
<xsltherwise>
<xsl:value-of select="text()"/>
</xsltherwise>
</xsl:choose>
</xsl:template>
....is there a way to eliminate the need to prefix all of my match terms
with xhtml:? In reading other posts, I was under the impression that
xmlns="http://www.w3.org/1999/xhtml" would set the default namespace but
it didn't do what I expected (i.e. eliminate the need for the prefix)...
so what exactly does it do?
Thanks,
Phil