[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSL omit part of a text inside TAG
You only want to affect FontFace, so move your template matching down to that element rather than matching its parent. Also as a general comment if you have a tempolate that only consists of an xsl:chhose or xsl:if block it's often better to simplify it to put the test into the match pattern, so rather than match on all FontFace and then check that teh parent has the right xsl:type, I just match on the ones you want to affect. David <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <xsl:template match="/"> <xsl:apply-templates select="*"/> </xsl:template> <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> <xsl:template match="VisualObject[@xsi:type='CBarCode']/FontFace"> <xsl:copy> <xsl:call-template name="while"> <xsl:with-param name="foo" select="."/> </xsl:call-template> </xsl:copy> </xsl:template> <xsl:template name="while"> <xsl:param name="foo"/> <xsl:choose> <xsl:when test="contains($foo,'\')"> <xsl:call-template name="while"> <xsl:with-param name="foo" select="substring-after($foo,'\')"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$foo"/> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|