I wrote:
> >      I can tell you what's going wrong:  XObject.str() 
> > produces the string 
> > value of the result tree fragment in the XPath sense - that is, it's 
> > equivalent to evaluating the XPath expression 
> > "string($testvar)".  In this 
> > case, the result is the empty string.

and "Marco Laponder" wrote on 2005-01-26 02:14:15 AM:
> Ah, I understand. What would be the easiest way to print the complete
> tree fragment (in java ) ? Are there functions utility classes for that 
? 

You'll be getting further and further into the internals of Xalan-J here, 
but it can be done.  One possibility is to use the XObject.rtf() method to 
get the DTM node handle for the root of the result tree fragment.  Then 
use the getDTM() method on XPathContext object returned by 
ev.m_processor.getXPathContext() to get the DTM object containing that 
node.

Then call the DTM.dispatchToEvents method, which traverses a specified 
subtree of the DTM and sends SAX events to a SAX ContentHandler.  If you 
use the SerializerFactory.getSerializer method to create a Serializer, you 
can send the output of the Serializer to a StringWriter, and use the 
Serializer.asContentHandler method to get access to the ContentHandler 
interface of the Serializer.

I hope that helps.

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro      Xalan development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:[EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to