Subject: choose on element content. From: DPawson@xxxxxxxxxxx Date: Mon, 23 Aug 1999 16:28:00 +0100 |
given <INDI ID='I001'> <NAME>John Derek <S>Montalt (Moult)</S></NAME> <SEX>M</SEX> I need conditional processing, dependent on the sex of the NAMEd person. I'm getting a syntax error with <xsl:template match="INDI"> <xsl:choose> <xsl:when test="[string(SEX)='M']"> ^^^^^^^^^^^^^^^^^^ syntax error.^^^^^^^^^^^^^ <xsl:element name="a"> <xsl:attribute name="href">#<xsl:value-of select="id(FAMS/@REF)/WIFE/@REF"/> </xsl:attribute>Spouse: <xsl:value-of select="id(id(FAMS/@REF)/WIFE/@REF)/NAME"/> </xsl:element> </xsl:when> <xsl:otherwise> <xsl:element name="a"> <xsl:attribute name="href">#<xsl:value-of select="id(FAMS/@REF)/HUSB/@REF"/> </xsl:attribute>Spouse: <xsl:value-of select="id(id(FAMS/@REF)/HUSB/@REF)/NAME"/> </xsl:element> </xsl:otherwise> </xsl:choose> I need to check if the content of an element is M or F. I tried <xsl:when test="SEX/text()='M'"> which also gave the syntax error. any suggestions please? DaveP XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: SAXON: ElementCopier, \n needed, Kay Michael | Thread | Re: choose on element content., G. Ken Holman |
Re: grouping by attribute, Olivier Corby | Date | flex/bison based xpath parser, Joerg Brunsmann |
Month |