Hi,
please clarify this doubt about XPathNodeIterator..the following XSLT uses this..
my doubt is, by looking at the XSLT, i thought the output to be Book1..but the actual output is Book1Book2Book3Book4..
as I understand, func method is called only once and XPathNodeIterator.MoveNext() is called only once..and how is this concatenated output??
tia,
avnrao.
XSLT :
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:user="urn:books"
exclude-result-prefixes="msxsl">
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
<xsl:variable name="node-fragment">
<book>Book1</book>
<book>Book2</book>
<book>Book3</book>
<book>Book4</book>
</xsl:variable>
<msxsl:script implements-prefix="user" language="c#">
-- include cdata here
string func(XPathNodeIterator it)
{
it.MoveNext();
return it.Current.Value;
//it.Current returns XPathNavigator positioned on the current node
}
</msxsl:script>
<xsl:template match="/">
<books>
<xsl:value-of select="user:func(msxsl:node-set($node-fragment))"/>
</books>
</xsl:template>
</xsl:stylesheet>
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>Hle4+hLykkifd3FHHowmXA==</Id>