Subject: RE: [xsl] question about filling of nodeset From: "Armand Datema" <armand.datema@xxxxxxxxxxxxxxx> Date: Thu, 17 Mar 2005 16:41:50 +0100 |
Ok, That's much better indeed, im not that much of an xsl programmer I code most in .net. What would be the best way to get a new result tree, any tutorials, articles, sample code? Thanks Armand -----Original Message----- From: David Carlisle [mailto:davidc@xxxxxxxxx] Sent: Thursday, March 17, 2005 4:38 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] question about filling of nodeset Now I have this code <xsl:variable name="AllKatern"> <xsl:for-each select="/HowardsHome/Katern"> <xsl:copy-of select="."/> </xsl:for-each> </xsl:variable> <xsl:variable name="AllKaternNodes" select="msxml:node-set($AllKatern)"/> that's quite an expensive operation as you have to copy everthing and also requires the node-set extension <xsl:variable name="AllKaternNodes" select="/HowardsHome/Katern"/> Is a lot less to type and a _lot_ more efficient and just saves the node set directly, which is almost certainly what you want here. Here I have a copy of everything but now I want the <title> of each Article with replaced quotes single double etc. That's not the problem, but how can I write the result of this back to the nodeset? You can never "write back" to anything in xslt, the transformation model is always that you take a source tree and generate a new result tree. So in your case you would apply som etemplates to $AllKaternNodes and get a new tree, then do with it whatever you need to do either letting it go to the main result tree, or saving it in a variable. David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] question about filling of, David Carlisle | Thread | Re: [xsl] question about filling of, David Carlisle |
Re: [xsl] question about filling of, David Carlisle | Date | [xsl] Problem while Xpath-ing an ex, michella |
Month |