Re: How can I pass a node as parameter to translets for XSLTC-Processor

EddyXSL <[email protected]>
Newsgroups gmane.text.xml.xalan.java.user
Message-ID <[email protected]>
Hi amitdk,

I tried to use your solution to pass a node-set to a translet and I don't
understand why, it does not work.
It's very strange but when I navigate in the node-set parameter, I get the
nodes of the XML source tree instead ! When I use a debugger, the
DTMAxisIterator passed as parameter seems ok, it contains in some deep
fields the content of the XML fragment I want to pass as parameter.
But I have to admit that understand how DTMxxx classes work is a real
nightmare for me.

Anyway, I don't understand why the official answer to this node-set
parameter passing problem is "known issue for XSLTC". When we have a look at
the BasisLibrary Xalan class, we can see that the referenceToNodeSet method
(called when a parameter is a node-set) exists and does some stuff to get a
DTMAxisIterator from either a org.apache.xalan.xsltc.runtime.Node (really
don't understand how to get this kind of object) or a DTMAxisIterator by
cloning it.
That means for me that the feature is available, am I wrong ?

Thanks for your help,

Eddy


amitdk wrote:
> 
> Return DTMAxisIterator instead of XNodeSet. That should help solve the
> issue. Here's the method I use to convert a Document object and pass it as
> a parameter to the translet.
> 
>     private DTMAxisIterator convertDocumentToNodeSet(Document document)
> throws TransformerException
>     {
>         
>         DOMSource domSource = new DOMSource(document);
>         XSLTCDTMManager mgr = new XSLTCDTMManager();
>         DTM dtm = mgr.getDTM(domSource, false, null, true, true);
>         int dtmRoot = dtm.getDocument();
>         DTMAxisIterator iter = dtm.getAxisIterator(Axis.SELF);
>         iter.setStartNode(dtmRoot);
>         
>         return iter;
>     }
> 

-- 
View this message in context: http://old.nabble.com/How-can-I-pass-a-node-as-parameter-to-translets-for-XSLTC-Processor-tp8649149p26160041.html
Sent from the Xalan - J - Users mailing list archive at Nabble.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.