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]

Saxon/Xalan Transformer.setParameter() problems


I want to send a NodeSet to a Saxon or Xalan transformer via the
setParameter() function.

I have a org.w3c.dom.Document object in memory which I need to send to the
transformer before calling transform.

So, here's the problem, I have not been able to figure out how to transform
org.w3c.dom.Document into a node set as required by either of the two
transformers.

For Xalan, I have tried the following:

XNodeSet nodeSet = new XNodeSet(dom.getDocumentElement());
transformer.setParameter("referenceXml", nodeSet);

but the xalan:evaluate or any XPath expr on the the parameter referenceXml
do not work.
I know the problem isnt with my XPath expressions because if I set the value
of the parameter, via
<xsl:parameter name="referenceXml">
  <xsl:value-of select="document('ref.xml')"/>
</xsl:parameter>
then all of my XPath expressions and xalan:evaluate(....) work correctly

But now when I send the parameter value as shown above, none of the XPath
expressions evaluate.

I want to give up on Xalan and try Saxon 6.22, but I dont know how to
convert the org.w3c.dom.Document into a node-set expression as expected by
Saxon.

Mike, please help me.

-Shakeel

 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]