RE: [xsl] Allowed return data types using addobject?

Subject: RE: [xsl] Allowed return data types using addobject?
From: Jeff Beadle <Jbeadle@xxxxxxxx>
Date: Thu, 28 Feb 2002 06:36:29 -0500
Hey Neil,

In msxml's msxsl:script element, the input and return datatypes
must either be:
   
   1.  simple (number or string), or...
   2.  a nodelist (IXMLDOMNodeList**)

That's why if you ever pass a "node" or nodeset into an msxsl:script
method, you have to call "nextNode()" or "item(index)" on the input 
parameter before you work with it all... even if you think you're only 
passing in a single node.

The most common way of returning a nodeset back to an xslt context from 
your msxsl:script method, would be to use "selectNodes" instead of 
"selectSingleNode".

Regards,
Jeff


-----Original Message-----
From: Neil Hunter [mailto:HunterN@xxxxxxx]
Sent: Thursday, February 28, 2002 5:58 AM
To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Subject: [xsl] Allowed return data types using addobject? 


Hi,

I am using ASP and MSXML.

I am calling a COM object (written in VB) that is made available to an XSLT
style sheet using XSLTprocessor.addobject.  I can successfully call a method
in the object from the style sheet that returns xml as a string ( so <
becomes &lt; etc.) to an xsl:variable but I want to call one that returns a
tree to be converted into a node-set. I have tried all sorts of methods to
accomplish this but none have been entirely successful. What data type
should I use for the return value (within VB) of the COM method to achieve
this and what should I be doing to turn this value into a node-set. Is it
even allowable to return an object? 

My current approach is call a method that takes a string and returns an
MSXML2.DOMDocument using:

<xsl:variable name="msid"><xsl:value-of
select="//rsc:docroot/@msid"/></xsl:variable>
<xsl:variable name="links" select="myObj:resolveLinks(string($msid))"/>
<xsl:variable name="doclinks" select="msxsl:node-set($links)"/>

The ASP page that does the work tends to hang and time out.

Any advice is much appreciated.

Thanks,

Neil.
      

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

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


Current Thread