Subject: Re: testing an attribute value and node value From: "Russ Holmes" <rholmes@xxxxxxxxx> Date: Wed, 20 Sep 2000 10:14:10 +1200 |
What syntax would I need to get it to work with MSXML3? I've tried; <xsl:when test="@n[.='100'] and [.='1']"><B>100 Works</B></xsl:when> .. <xsl:when test="[@n[.='100'] and .='1']"><B>100 Works</B></xsl:when> .. <xsl:when test="@n[.='100' and .='1']"><B>100 Works</B></xsl:when> .. <xsl:when test="@n[.='100'] and [.='1']]"><B>100 Works</B></xsl:when> .. ----- Original Message ----- From: "Kay Michael" <Michael.Kay@xxxxxxx> To: <xsl-list@xxxxxxxxxxxxxxxx> Sent: Tuesday, September 19, 2000 8:43 PM Subject: RE: testing an attribute value and node value > > My XML is; > > > > <?xml version='1.0'?> > > <PageData> > > <CUSTOM> > > <F n="100">1</F> > > <F n="101">1</F> > > </CUSTOM> > > </PageData> > > > > > So, if current node n="100" and the current node value = '1' > > then output > > > > <B>100 Works</B> > > > > if current node n="101" and the current node value = '1' then output > > > > <B>101 Works</B> > > > > My XSL looks like; > > > > <xsl:template match="F"> > > <DIV> > > <xsl:choose> > > <xsl:when test="@n[.='100' and //F[.='1']]"><B>100 > > Works</B></xsl:when> > > <xsl:when test="@n[.='101' and //F[.='1']]"><B>101 > > Works</B></xsl:when> > > </xsl:choose> > > </DIV> > > > > </xsl:template> > > > Oh dear, you are very confused. Your condition is testing "if the current > node has an @n attribute whose value is '100', and if the document contains > an F element whose string-value is '1'. > > Try <xsl:when test="@n='100' and .='1'"> > > Mike Kay > > > 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: testing an attribute value and , Kay Michael | Thread | RE: testing an attribute value and , Kay Michael |
XSL vs. XSLT and processors vs. par, Ben C. | Date | trimming xml output by number of ch, Matthew Haughey |
Month |