[Home] [By Thread] [By Date] [Recent Entries]
Adam Komisarek wrote:
Hello! It is not possible to both write and read a document. Not even with extension functions. The reason is simple: the document() function is "stable" which, the way I understand it, means that multiple calls to the document() function with the same value as a parameter, will result in the same node set. If you consider that it is undetermined in what order the processor executes your statements and declarations, it becomes apparent that this restriction to the language is a necessary one. However, this restriction does not mean that what you want cannot be achieved. You use Xalan, which has the capability of using the EXSLT extension function exslt:node-set(). You can use it to do what you want: "store" it first and apply it later: <xsl:template match="/">
<xsl:variable name="test">
<someNode>with a value</someNode>
<xsl:apply-templates select="foo/bar" />
</xsl:variable>
<xsl:apply-templates select="exslt:node-set($test)/*" />
<xsl:template><xsl:template match="someNode" >
.....
</Or something along that line. HTH, Cheers, -- Abel Braaksma
|

Cart



