Subject: Re: [xsl] Selecting the first node set From: Abel Online <abel.online@xxxxxxxxx> Date: Sat, 05 Aug 2006 14:09:07 +0200 |
Both return /Trade[1]/UnknownName1[1]/Value[1]/enum[1] - A /Trade[1]/UnknownName1[1]/Value[1]/enum[2] - B /Trade[1]/UnknownName1[1]/Value[1]/enum[3] - C
Cheers, Abel Braaksma www.nuntia.nl
Given the following simplified XML instance, can anyone suggest an expression that will return ONLY the 'Value' node containing <enum> children with values A, B and C. I can't rely on the name of the parent node of <Value> hence I have deliberately named these as UnknownNameX or any other intervening structure.
<Trade> <UnknownName1> <Value> <enum>A</enum> <enum>B</enum> <enum>C</enum> </Value> </UnknownName1> <UnknownName2> <Value>/Trade//Value[ancestor::Trade]</Value> </UnknownName2> <Treatment> <UnknownName3> <Value> <enum>D</enum> <enum>E</enum> <enum>F</enum> </Value> </UnknownName3> </Treatment> </Trade>
/Trade//Value - returns all 3 <Value> nodes /Trade//Value[1] - also returns all 3 <Value> nodes (why is that ?) /Trade//Value[2] - returns nothing (why is that ?)
Cheers
Fraser.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Selecting the first node , CyberSpace Industrie | Thread | Re: [xsl] Selecting the first node , G. Ken Holman |
Re: [xsl] Selecting the first node , CyberSpace Industrie | Date | RE: [xsl] Selecting the first node , cknell |
Month |