This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: getting associated file name for element


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]