Mark Cance wrote:
I then want to pick out a specific �selection� element using <id> as a
reference, my preferred method is;
<xsl:for-each select="/selections/regions/*[id=.]">
    1-<xsl:value-of select="description"/>
</xsl:for-each>
Unfortunately I cant get this to work, is my syntax wrong?
I'm not sure I understand, do you want to select just *one* element (having the id you're looking for) or several? Your text describes the former, but you consistently use xsl:for-each which points to the latter.

Would the following to the right thing (given the id you're looking for in $ID):

<xsl:value-of select='/selections/regions/selection[id=$ID]/description'/>

I don't know if you have ways to convince the external source of anything, but given the sample data you provide it looks like they're abusing elements. Something like

<selection id='id1'>
<description>fr</description>
</selection>

would imho make more sense, especially as you could associate a schema and then select directly using XPath's id().

--
Robin Berjon <[EMAIL PROTECTED]>
Research Engineer, Expway http://expway.fr/
7FC0 6F5F D864 EFB8 08CE 8E74 58E6 D5DB 4889 2488


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to