This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: nodeset extension in .Net?


--- "bryan" <bry at itnisk dot com> wrote:

> 
> I seem to remember that in .Net there isn't a node-set extension
> function, and that node-sets are accessible. Does anyone know if this
> is
> correct, cause I'm getting some results here that lead me to conclude
> that I need a node-set() function and can't just merrily run an xpath
> against my parameter.

.Net supports the node-set() extension function. If you search for
"Support for the msxsl node-set Function" in the .Net Framework, you'll
find this:

" .NET Framework Developer's Guide   

Support for the msxsl:node-set() FunctionSee Also
XslTransform Class Implements the XSLT Processor
The msxsl:node-set function enables you to convert a result tree
fragment or node tree into a node set. The resulting node set always
contains a single node and is the root node of the tree.

Example

In the following example, $var is a variable that is a node tree in the
stylesheet. The for-each statement combined with the node-set function
allows the user to iterate over this node tree as a node set.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:msxsl="urn:schemas-microsoft-com:xslt"
                xmlns:user="http://mycompany.com/mynamespace";
                version="1.0">
    <xsl:variable name="states">
        <node1>AL</node1>
        <node1>CA</node1>
        <node1>CO</node1>
        <node1>WA</node1>
    </xsl:variable>

    <xsl:template match="/">
            <xsl:for-each select="msxsl:node-set($states)/node1"/> 
    </xsl:template>
</xsl:stylesheet>
See Also
XslTransform Class Implements the XSLT Processor


--------------------------------------------------------------------------------

Send comments on this topic. 

© 2001 Microsoft Corporation. All rights reserved."


Only one remark: Two months ago users of FXSL noted that in .Net 
node-set($rtf) crashes if not($rtf)

Hope this helped.



=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]