[Home] [By Thread] [By Date] [Recent Entries]
At 2009-05-20 15:34 +0200, Merico Raffaele wrote:
Dear Community Your use of "./" is redundant in the above, and I'm not in the practice of addressing text() nodes directly. I would have used: [not(*) and not(normalize-space())] Alternatively, if I wasn't worried about white-space, just [not(node())] would test for no child nodes of the element. Use <xsl:copy/> to achieve the above. Are you using namespace aliasing? It happens I use "xslo:" when I write stylesheets that write stylesheets. If so I suspect you want: <xslo:text><xsl:text> </xsl:text></xslo:text> </xsl:element> </xsl:template> It depends on how you are catching your attributes ... I see you are pushing them at your stylesheet: <xsl:apply-templates select="@*"/> ... but if you don't catch them, then their values will be added to the result tree as text. I can imagine that this is caused by the star in the match. No. That is explicitly for elements and not attributes because you have omitted the axis in the location path step. I used the star to mask the namespace-prefix in order match style-tags in the null and in the XHTML namespace (without prefix). Sure. Can anybody please explain me why this happens? I suspect the built-in template rules are catching the attributes you are pushing at your stylesheet. But since you aren't showing more of your stylesheet it is difficult to tell what is happening with your style attributes because it might be another part of your stylesheet that is dealing with them. If you just want to copy attributes, then you need something like this (untested): <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>... but I'm confused again because of your use of the "xslo:" prefix. I hope this helps in some way. . . . . . . . . . . . Ken -- 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
|

Cart



