[Home] [By Thread] [By Date] [Recent Entries]
At 99/08/23 16:28 +0100, DPawson@xxxxxxxxxxx wrote:
given <INDI ID='I001'> <NAME>John Derek <S>Montalt (Moult)</S></NAME> <SEX>M</SEX> Predicates are allowed as filters on a node test, not standalone as the above shows. But predicates aren't what you need ... you can just write an expression that uses the value of the child and compares it to a string. The value is a string already, so no conversions are required. An example is below ... I hope this helps. ........... Ken
<xsl:template match="/test">
<xsl:for-each select="person">
<xsl:choose>
<xsl:when test="sex='M'">
Male: </xsl:when>
<xsl:when test="sex='F'">
Female: </xsl:when>
<xsl:otherwise>
Who knows?: </xsl:otherwise>
</xsl:choose>
<xsl:value-of select="name"/>
</xsl:for-each>
</xsl:template></xsl:stylesheet> T:\FTEMP>call xsl test.xml test.xsl test.txt T:\FTEMP>type test.txt Male: John Female: Jane T:\FTEMP> -- G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (Fax:-0995) Website: XSL/XML/DSSSL/SGML services, training, libraries, products. Practical Transformation Using XSLT and XPath ISBN 1-894049-01-2 Next instructor-led training: MT'99 1999-12-05/06 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|

Cart



