[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: top level params and xsl:attribute magic?
Simon wrote: > ... My XSLT > applies templates to the RNG file until it hits a > <zeroOrMore> node. At > that point it spits out the XPath to that node, as the value > of an HTML > forms button. The button posts the XPath back to the same > XSLT. At that > point, I want to start at the node, given by the xpath, and apply my > templates again to the descendants of the Xpath. If you are generating this xpath parameter yourself in XSLT, and it refers to a single node, then it should also be simple enough to parse as a string, in XSLT. It's not as if your parser would have to parse any xpath expression is it? I assume your generated xpath expression looks something like: "foo[2]/bar[1]/baz[23]" You can evaluate this against your document with a recursive named template: pass it a the xpath string and a root node, and have it parse the string up to the first slash, extract the number from the square brackets, and select the matching child node using something like "node()[name()=$node-name][position()=$position]". This is the first step in the xpath. Then it can call itself recursively, passing the remainder of the xpath string and this child node. If there are no more steps in the xpath, the template can call apply-templates to process the final node. Cheers! Con 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
|