Subject: Re: [xsl] match="*:style" From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Wed, 20 May 2009 10:12:51 -0400 |
Dear Community
I process HTML/XHTML files passed as input to my XSLT stylesheet. I'm working with SaxonB 9.1.0.2. In order to catch the <style/> tag in the HTML/XHTML input file I defined the following match-rule.
<xsl:template match="*:style[empty(./*) and normalize-space(./text()) eq '']">
<xsl:element name="{node-name(current())}" namespace="{namespace-uri(current())}">
<xsl:apply-templates select="@*"/> <xslo:value-of select="' '"/>
</xsl:element> </xsl:template>
Now I am surprised that above match applies also to style-attributes (i.e. style="border: 1px solid red;").
I can imagine that this is caused by the star in the match.
I used the star to mask the namespace-prefix in order match style-tags in the null and in the XHTML namespace (without prefix).
Can anybody please explain me why this happens?
<xsl:template match="*:style[not(*) and not(normalize-space())]"> <xsl:copy> <xsl:copy-of select="@*"/> <xslo:text><xsl:text> </xsl:text></xslo:text> </xsl:copy> </xsl:template>
-- XSLT/XSL-FO/XQuery hands-on training - Los Angeles, USA 2009-06-08 Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] match="*:style", Merico Raffaele | Thread | RE: [xsl] match="*:style", Michael Kay |
Re: [xsl] Obtaining the name of a t, G. Ken Holman | Date | [xsl] Muenchian method on filtered , Joelle Tegwen |
Month |