[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Parameterizing an XML using a XSLT
> 1. It can place the placeholder in the //Status/Reference > node if it has a sibling of Command=Add but I cannot figure > out a way of adding an index number to the placeholder that > increases sequentially for each match. Both > position() and <xsl:number > do not work with the transform > constructed this way. <xsl:number level="any" count="Body/Status/Reference[preceding-sibling::Command='Add']"/> should do the trick. > > 2. How can I use the same placeholder in the > //Map/MapItem/Target/Loc if infact the number matches the one > in the //Status/Reference tag above it. <xsl:template match="Map/MapItem/Target/Loc"> <xsl:choose> <xsl:when test=". = ../../../preceding-sibling::Status[1]/Reference"> <xsl:text>ref</xsl:text> <xsl:for-each select = "../../../preceding-sibling::Status[1]/Reference"> <xsl:number level="any" count="Body/Status/Reference[preceding-sibling::Command='Add']"/> </ </ <xsl:otherwise> ??? (you don't say) </xsl:otherwise> </ </ Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx 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
|