[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] choose on element content.
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
|
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
|