Re: [xsl] Need assistance with a match string

Subject: Re: [xsl] Need assistance with a match string
From: "Jay Bryant" <jay@xxxxxxxxxxxx>
Date: Tue, 10 Jan 2006 15:37:11 -0600
Hi, Cindy,

The single quotation marks around {$linkId} make your XSLT processor look
for an eid that has that actual string, not the value of the variable with
that name.

Try this:

<xsl:value-of select="//*[@eid=$linkId]/title"/>

That's untested, but it should at least be closer to what you need.

Jay Bryant
Bryant Communication Services

----- Original Message ----- 
From: "Cindy Hunt" <Cindy.Hunt@xxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, January 10, 2006 3:24 PM
Subject: [xsl] Need assistance with a match string


Hi-

I am having trouble with grabbing the title associated with an element's ID
attribute value (we are calling it an "eid") and am hoping someone can see
my mistake. I have the ID value that I am pointing to in a variable (below I
call it $linkId). I want to say "give me the title of the element in my
document that matches this id value". I know my ID value is working because
the actual link points to the correct location in the document but I just
can't get the title to appear.

We have lots of different elements that this eid could be on so I need to
look for any element that matches this id.

My statement looks like:
<xsl:value-of select="//*[@eid='{$linkId}']/title"/>

Currently it is not returning anything. My gut feeling is that something is
wrong where I am trying to match the attribute to a variable value. I have
tried many things like removing the quotes, brackets, or both and none of
these options give me anything except one gives an error.

I have to put my link ID in a variable because I have to do some massaging
on the original ID value since we do not use unique ID values across a
single document (that wasn't my choice but I am having to make it work this
way).

We are using a Saxon parser if that helps.

Thanks for any suggestions you can offer on this,
Cindy Hunt

Current Thread