xsl-list
[Top] [All Lists]

RE: Parameterizing an XML using a XSLT

2003-04-09 12:52:55
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(_dot_)H(_dot_)Kay(_at_)ntlworld(_dot_)com
work: Michael(_dot_)Kay(_at_)softwareag(_dot_)com 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>