xsl-list
[Top] [All Lists]

[xsl] XPath attribute expression

2006-12-18 16:34:40
I'm a relative newbie, so I apologize if this question is too basic.

Assume that my document has this structure:

<topLevel>
   <ents>
      <ent name="abc"><value>test1</value></ent>
      <ent name="def"><value>test2</value></ent>
   </ents>
.
.
.
<para>This is a <entRef name="def"/>.</para>

What XPath expression can I use in context of this <entRef> element to
reference the content of the <value> element that matches the <ent> name
attribute (as shown above).  I've gotten this far:

/topLevel/ents/ent[(_at_)name]/value

But, that always returns the first value.  Somehow I need to test @name
that equals the "name" of the current tag.

Dave

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>