Subject: [xsl] using tokenize() and referencing parent elements From: "Spencer Tickner" <spencertickner@xxxxxxxxx> Date: Thu, 10 May 2007 09:52:20 -0700 |
I'm using tokenize() but have to get the parent of the string token to determine if the string is one thing, or another. I came across a similiar post on the list.. but I can't seem to get it working with my case:
<PS Class="SummaryKeyWords"> <em>Local Governments Statutes Amendment Act</em>; <em>Municipal Act; Fish Protection Act</em>Bill 25; riparian; endangered</PS>
<xsl:template match="PS[@Class = 'SummaryKeyWords']"> <xsl:variable name="me" select="."/> <keywords> <xsl:for-each select="tokenize(., ',|;')"> <xsl:choose> <xsl:when test="$me[current() eq text()/parent::em]"> <keyword><actname><xsl:value-of select="normalize-space(.)"/></actname></keyword> </xsl:when> <xsl:otherwise> <keyword><xsl:value-of select="normalize-space(.)"/></keyword> </xsl:otherwise> </xsl:choose> </xsl:for-each> </keywords> </xsl:template>
<keywords> <keyword><actname>Local Governments Statutes Amendment Act</actname></keyword> <keyword><actname>Municipal Act</actname></keyword> <keyword><actname>Fish Protection Act Bill 25</actname></keyword> <keyword>riparian</keyword> <keyword>endangered</keyword> </keywords>
<keywords> <keyword>Local Governments Statutes Amendment Act</keyword> <keyword>Municipal Act</keyword> <keyword>Fish Protection Act Bill 25</keyword> <keyword>riparian</keyword> <keyword>endangered</keyword> </keywords>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] indent="yes" and <pre>, Martynas Jusevicius | Thread | RE: [xsl] using tokenize() and refe, Michael Kay |
Re: [xsl] indent="yes" and <pre>, Martynas Jusevicius | Date | Re: [xsl] Off Topic: XSLT consultan, Steve |
Month |