Re: Problem using msxsl:node-set with xsl:param

Discussion in 'XML' started by Patrick Gresham, Aug 20, 2003.

  1. You get credit for the assist. Your response was not exactly correct,
    but good enough. The solution is one of those things that make me say
    wow!

    First, you were on the right track with "why convert the node set to a
    string when it is already an xml doc." So I made this adjustment in the
    javascript

    i.e.:
    processor.addParameter("xmlDoc", xmlId)
    not
    processor.addParameter("xmlDoc", xmlId.documentElement)

    Next, once the parameter is passed to the XSL, it is a tree fragment,
    set of nodes. You have to call xxx:node-set() so that XSL will treat it
    is such.

    i.e.
    <xsl:param name="xmlDoc" select="." />
    <xsl:value-of select="msxsl:node-set($xmlDoc/Element)" />

    This is so cool because you can pass multiple XML documents
    to the XSL stylesheet dynamically. This will come into use when you are
    building a select list of options with an external document and the
    source document stores the option selected.

    I am posting this because I am sure some poor soul will spend 3 days on
    this as I have. By the way, you have to include a urn with the node-set
    function available. You can get that from msxsl, xalan, and others.


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Patrick Gresham, Aug 20, 2003
    #1
    1. Advertising

  2. Opps made a typo in the example above:
    <xsl:value-of select="msxsl:node-set($xmlDoc)/Element" />

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Patrick Gresham, Aug 21, 2003
    #2
    1. Advertising

  3. "Patrick Gresham" <> wrote in message
    news:3f43f008$0$194$...
    > You get credit for the assist. Your response was not exactly correct,
    > but good enough. The solution is one of those things that make me say
    > wow!
    >
    > First, you were on the right track with "why convert the node set to a
    > string when it is already an xml doc." So I made this adjustment in the
    > javascript
    >
    > i.e.:
    > processor.addParameter("xmlDoc", xmlId)
    > not
    > processor.addParameter("xmlDoc", xmlId.documentElement)
    >
    > Next, once the parameter is passed to the XSL, it is a tree fragment,
    > set of nodes. You have to call xxx:node-set() so that XSL will treat it
    > is such.
    >
    > i.e.
    > <xsl:param name="xmlDoc" select="." />
    > <xsl:value-of select="msxsl:node-set($xmlDoc/Element)" />


    No. It is just a regular node-set. Remove the call to the msxsl:node-set()
    ext. function and see that you'll get no error.

    The definition of an RTF requires that its contents is produced by the
    transformation itself. Also, an RTF is defined *only* as the contents of an
    xsl:variable. Both of these two conditions are not satisfied in your
    example.


    =====
    Cheers,

    Dimitre Novatchev.
    http://fxsl.sourceforge.net/ -- the home of FXSL
    Dimitre Novatchev, Aug 21, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,413
  2. ipg
    Replies:
    5
    Views:
    2,059
    Oleg Tkachenko
    Aug 27, 2003
  3. MoonStorm
    Replies:
    5
    Views:
    1,234
    David Carlisle
    Mar 8, 2005
  4. MoonStorm
    Replies:
    0
    Views:
    425
    MoonStorm
    Mar 7, 2005
  5. Tjerk Wolterink
    Replies:
    2
    Views:
    1,404
    Dimitre Novatchev
    Aug 24, 2006
Loading...

Share This Page