Subject: RE: for-each question/IE5 From: "Pettigrew, Nancy" <NancyPettigrew@xxxxxxxxxxxxx> Date: Wed, 26 Jan 2000 14:36:34 -0800 |
EXCELLENT. It worked. Kudos and many thanks to Ben. Sol'n: <SELECT size="10" multiple="multiple"> <xsl:for-each select="/MCRoot/Lists/Languages/Language"> <option> <xsl:if test="/MCRoot/Person/Languages/Language[@value =context()/@value]"> <xsl:attribute name="selected">selected</xsl:attribute> </xsl:if> <xsl:value-of select="@value"/> </option> </xsl:for-each> </SELECT> --------------------------------------------------------- Date: Tue, 25 Jan 2000 18:35:12 -0000 From: Ben Robb <Ben@xxxxxxxxxx> Subject: RE: for-each question/IE5 Try something like: ++++++++++++++++++++++++++++ <xsl:for-each select="/MCRoot/Lists/Languages/Language"> <option> <xsl:if test="/MCRoot/Lists/Person/Languages[@value = context()/@value]"> <xsl:attribute name="selected">selected</xsl:attribute> </xsl:if> <xsl:value-of select="@value"/> </option> </xsl:for-each> ++++++++++++++++++++++++++++ <warning>this code was lifted and amended from something I wrote about a year ago - so no guarantees that it works...*grin*</warning> Hope it helps - as you can see, if using IE5, the only "nice" way of doing it is by using the context() function. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: for-each question/IE5, Ben Robb | Thread | can XML-XSL do what Lisp and s-ex, Alberto Gomez Corona |
Re: can XML-XSL do what Lisp and , Steve Muench | Date | RE: How to format recursive XML usi, Rakesh Ajmera |
Month |