[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Need assistance with a match string

Subject: Re: Need assistance with a match string
From: "Jay Bryant" <jay@xxxxxxxxxxxx>
Date: Tue, 10 Jan 2006 15:37:11 -0600
eid quotes
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:  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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.