XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Mark MaltbySubject: buiding your own nodesets
Author: Mark Maltby
Date: 27 Jul 2006 01:59 PM
Is it possible inside xsl to build nodesets up from other nodes using xpath1. I saw there is sequencing in xpath2 but this is no good for me? So for example

<xsl:var name="myNodeSet"/>

<for each select="xmldoc/node">

copy current node (".") to variable myNodeSet

</for-each>

Thanks for any help in advance

Postnext
Tony LavinioSubject: buiding your own nodesets
Author: Tony Lavinio
Date: 27 Jul 2006 02:18 PM
Not with for-each.
You cannot "accumulate" things in XSLT.
What you can do is specify a condition that will return all
of the nodes you care about.
This will return what is called a "result tree fragment" in XSLT 1.
To turn that into a node-set that you can do further processing on,
you will need a processor-specific extension function.
Typically they are called "node-set()" and are specified in the
documentation for the XSLT engine you are using.
If you tell us which one, we might be able to point you to the
relevant document.

Postnext
Mark MaltbySubject: buiding your own nodesets
Author: Mark Maltby
Date: 27 Jul 2006 02:26 PM
Msxml4

Thanks

Postnext
Tony LavinioSubject: buiding your own nodesets
Author: Tony Lavinio
Date: 27 Jul 2006 02:37 PM
http://www.xml.com/pub/a/2003/07/16/nodeset.html should help.

Postnext
Mark MaltbySubject: buiding your own nodesets
Author: Mark Maltby
Date: 27 Jul 2006 03:49 PM
Will functions like last(),position() and count() work with nodesets? It is hard to debug as the built in processor doesn't debug when using msxsl:node-set functionality.

Postnext
Ivan PedruzziSubject: buiding your own nodesets
Author: Ivan Pedruzzi
Date: 27 Jul 2006 04:27 PM


Hi Mark,

what do you mean " ...doesn't debug..."?

Ivan Pedruzzi
Stylus Studio Team

Postnext
Mark MaltbySubject: buiding your own nodesets
Author: Mark Maltby
Date: 27 Jul 2006 04:33 PM
If I switch the processor to built in one to debug, I get the following error message when it gets msxsl:node-set line/procedure

See screen shot


Unknownmsxsl.JPG

Postnext
Ivan PedruzziSubject: buiding your own nodesets
Author: Ivan Pedruzzi
Date: 27 Jul 2006 06:01 PM

I am not able to reproduce the error, could please post a test case (XML + XSLT)?

Thank You
Ivan Pedruzzi
Stylus Studio Team

Postnext
Mark MaltbySubject: buiding your own nodesets
Author: Mark Maltby
Date: 28 Jul 2006 06:08 AM
I finally figured out what the problem is. Please see my simplified attached style sheet. The problem occurs when the node set has no nodes contained in it and you use the built in processor. This could happen in the stylesheet I am creating.

So my new question is whether you can test for a valid node set.

Thanks


UnknownMsxslDebugIssue.xsl

Postnext
Mark MaltbySubject: buiding your own nodesets
Author: Mark Maltby
Date: 28 Jul 2006 11:32 AM
Any info on this yet?

Posttop
Ivan PedruzziSubject: buiding your own nodesets
Author: Ivan Pedruzzi
Date: 28 Jul 2006 12:03 PM

<xsl:if test="$myNodeSet2">
<xsl:for-each select="msxsl:node-set($myNodeSet2)/myNode">
<p>
<xsl:value-of select="."/>
</p>
</xsl:for-each>
</xsl:if>


Ivan Pedruzzi
Stylus Studio Team

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.