Subject: Re: [xsl] processing multiple values in a single attribute From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Fri, 15 May 2009 20:32:00 -0400 |
Despite my slight embarrassment earlier, dare I ask a further question for my own curiosity please? Suppose (I'm not saying OPs data could ever fit this condition) instead of <FAULT-REF FAULTS="PF01 PF02 PF03 PF04 PF05 PF06 PF07 PF08 PF09 PF10 PF11"/> you had <FAULT-REF FAULTS=" "/> or <FAULT-REF FAULTS=""/>.
Would you change the templates at all? If so, how?
<xsl:template match="FAULT-REF"> <xsl:if test="normalize-space(@FAULTS)"> <xsl:call-template name="do-tokens"> <xsl:with-param name="string" select="concat(normalize-space(@FAULTS),' ')"/> </xsl:call-template> </xsl:if> </xsl:template>
<xsl:template name="do-tokens"> <xsl:param name="string"/> <xsl:if test="contains($string,' ')"> <statemanipulation> <variableref name="{substring-before($string,' ')}"/> <fault fault-code="{substring-before($string,' ')}" fault-state="ok"/> </statemanipulation> <xsl:call-template name="do-tokens"> <xsl:with-param name="string" select="substring-after($string,' ')"/> </xsl:call-template> </xsl:if> </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 -> |
---|---|---|
Re: [xsl] processing multiple value, Matthew L. Avizinis | Thread | RE: [xsl] processing multiple value, Michael Kay |
Re: [xsl] processing multiple value, Matthew L. Avizinis | Date | Re: [xsl] Please look at my mini-te, Hermann Stamm-Wilbra |
Month |