Subject: RE: [xsl] Accessing attributes From: "Dion Houston" <dionh@xxxxxxxxxxxxx> Date: Fri, 9 Aug 2002 14:26:12 -0700 |
Keep in mind your context element changes inside a for-each, Therefore: <xsl:for-each select="site/passeio/item"> <!-- context element is now item --> <xsl:when test="@correlato=@idPasseio">...</when> ... </xsl:for-each> HTH! Dion -----Original Message----- From: Carlos Durand [mailto:groupdurand@xxxxxxxxxxxx] Sent: Friday, August 09, 2002 12:31 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] Accessing attributes Hi all, How can I access an attribute value inside an if and for-each functions? For example <xsl:for-each select="site/passeio/item"> <xsl:choose> <xsl:when test="/site/dadosPasseio/correlato/item[@correlato = @idPasseio]"> <option value="{@idPasseio}" selected="selected"><xsl:value-of select="@passeio"/></option> </xsl:when> <xsl:otherwise> <option value="{@idPasseio}" ><xsl:value-of select="@passeio"/></option> </xsl:otherwise> </xsl:choose> </xsl:for-each> @correlato belongs to if and @idPasseio belongs to for-each... Thanks Durand _______________________________________________________________________ Yahoo! PageBuilder O super editor para criação de sites: é grátis, fácil e rápido. http://br.geocities.yahoo.com/v/pb.html XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Accessing attributes, Charles Knell | Thread | [xsl] Using JDOM to read XML, Brian Hickey |
Re: [xsl] Accessing attributes, Charles Knell | Date | Re: [xsl] Formatting Objects Implem, Oleg Tkachenko |
Month |