[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: using step or following-sibling?
Matt,
At 04:00 PM 12/3/2004, you wrote: Let's say I have the following XML: Okay. And in my xsl I have a template like this: I assume you're not asking how to substitute the string. (If you are, replacing the string "MY TROUBLE ZONE" with any value at all will require some string-substitution magic, which you can find documented in the FAQ. XSLT does not excel at string manipulation but it's not impossible to do either. If you could arrange for this placeholder to be an element or a processing instruction instead of a string, your processing would be both easier and more robust.) As to the value you want to substitute, if your context node is the row, the emp_nm of the very next row is expressed in XPath as "following-sibling::row[1]/emp_nm. While this does use position() (the predicate expands to [position()=1]), in XSLT were you to say <xsl:value-of select="following-sibling::row/emp_nm"/> you would get the value only of the next one, since the value-of instruction returns a string, and the rule for converting a node-set into a string is to take the string value of the first node in the node-set (which happens to be the one you want). If there is no such following sibling, of course, nothing will get substituted. I hope this helps, Wendell
|
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
|