View Single Post
Old February 9th, 2004, 12:40 PM
gb gb is offline
Registered User
Join Date: Feb 2004
Location: Dublin, , Ireland.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Matching of attribute values


I have a basic question of matching of attribute values:

If I have a document fragment:


 <enum name="ABC">
   <enunMember name="member1">
   <enunMember name="member2">

 <enum name="XYZ">
   <enumMember name="member5">
   <enumMember name="member7">

  <attribute name="attr1">
     <enumRef name= "ABC">



When processing an 'attribute', I want to dump out the type information of the referenced "enum". I am struggling with the syntax to find the related "enum" from the "enumRef" name in "attribute".

I'm using the following:

<xsl:template match="enumRef">
        <xsl:value-of select="@name"/>

    <xsl:apply-templates select="//enum[@name ='ABC']">
    <xsl:apply-templates select="//enum[@name='{attribute::@name}' ]">


What is the correct syntax to match an element using an attribute ["name" in this case] generically?

many thanks,