Subject: Re: [xsl] XPath element constructor From: Michael Kay <mike@xxxxxxxxxxxx> Date: Tue, 28 Aug 2012 23:28:45 +0100 |
Michael Kay Saxonica
Hi, lets say, that somewhere in an XSLT context, I want to do this:
<xsl:sequence select="<my-cool-element>foo</m-cool-element>" />
But that is too insane, so I rewrite it like this:
<xsl:sequence select="element my-cool-element { 'foo' }" />
Only if constructors were supported in XPath. But I CAN create new nodes in XSLT context! So I end up with:
<xsl:function name="my:const-my-cool-element" as="element()"> <const-my-cool-element>foo</const-my-cool-element> </xsl:function> . <xsl:sequence select="my:const-my-cool-element()" />
Yay :( There is no question, really.
Jakub.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XPath element constructor, Liam R E Quin | Thread | RE: [xsl] XPath element constructor, Jakub Malý |
Re: [xsl] XPath element constructor, Liam R E Quin | Date | [xsl] Xalan parse() extension, Andrew Welch |
Month |