Subject: Re: [xsl] Getting variable yet most immediate parentNode From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Fri, 28 Sep 2007 19:33:59 +0200 |
me>(@value,@name,.)[1]
wendell> ... and in XPath 1.0, you're forced into explicit testing, since wendell> attributes have no order in the data model.
or, if you must, (@value|@name[not(../@value)]|.)[last()] but perhaps's
that's "explicit testing". How explicit does something have to be to be
"explicit"?
<xsl:apply-templates select="." mode="option-value" /> .......
<xsl:template match="option[@value]" mode="option-value" priority="10"> <xsl:value-of select="@value" /> </xsl:template>
<xsl:template match="option[@name]" mode="option-value" > <xsl:value-of select="@name" /> </xsl:template>
<xsl:template match="option" mode="option-value"> <xsl:value-of select="." /> </xsl:template>
Cheers, -- Abel Braaksma
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Getting variable yet most, David Carlisle | Thread | Re: [xsl] Getting variable yet most, David Carlisle |
Re: [xsl] Attribute of greatest val, David Carlisle | Date | Re: [xsl] Getting variable yet most, Abel Braaksma |
Month |