Michael,

 

            Thanks for your quick reply. The reason I asked this was because I wanted to iterate through the nodes of two tokenize result node-sets and I was getting confused as to how would I write my xsl. I have come up with the following xsl which works ok. Does the xsl make sense to you or you would do it some other way?? I am very new to xsl ( 1 month ), which you can see from my xsl.

 

<xsl:template match="/root/service_discovery/ip">

        <iphostsunion>

        <xsl:variable name="row" select="." />

                 <xsl:text>&#xa;</xsl:text>

 

            <xsl:element name="ip">

 

            <xsl:attribute name="v"><xsl:value-of select="$row/@v"/></xsl:attribute>

 

            <xsl:variable name="portlist" select="saxon:tokenize($row/ports,',')"/>

            <xsl:variable name="resultlist" select="saxon:tokenize($row/results, ',')"/>

 

            <xsl:for-each select="$portlist">

                <xsl:element name="portresults">

                <xsl:variable name="count" select="position()" />

                <xsl:variable name="result" select="$resultlist[$count]"/>

                <xsl:attribute name="p"><xsl:value-of select="."/></xsl:attribute>

                <xsl:attribute name="r"><xsl:value-of select="$result/."/></xsl:attribute>               

                </xsl:element>

            </xsl:for-each>

      </xsl:element>

</xsl:template>

 

Thanks again for your quick response

Namrata