[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|