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

Re: getting associated file name for element

Subject: Re: getting associated file name for element
From: "Gennady Loskutov" <g_loskutov@xxxxxxxxxxxxx>
Date: Thu, 7 Mar 2002 14:16:26 +0100
name the elements quiz
> How can I grab the value of @href as each question is evaluated?

Matthew,

To determine URL of the file, where the current node is located, you can use
generate-id() function.
The root node for your current node must have the same id generated by
generate-id() function as the one generated for one of the root nodes of the
documents compiled together via document() function.

Therefore, you need to define a variable for the root node of the current
node:
<xsl:variable name="doc" select="generate-id(/)" />

and get the URL by:
 <xsl:value-of select="$all-questions//quiz[generate-id(document(@href)) =
$doc]/@href" />

Also, I suggest that you avoid using // operator if you know the path to
quiz elements beforehand - for example, selecting
"$all-questions/myquiz/quiz" is faster than "$all-questions//quiz" if
$all-questions contains other children than myquiz.

Regards,
Gennady


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.