|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Moving from LotusXSL to XT
Quoth "Philip Puccio" <Philip.Puccio@xxxxxxxx>: > 2) I use extension functions to call some of my Java code. In one case, I > pass a node-set as an argument to a Java method. Within Java (when using > XT), > that node-set is an instance of SingleNodeIterator. I send the iterator > next() to get a Node (actually, an instance of > XSLProcessorImpl$ElementNodeImpl). Now the challenge: I need to get a > string > representation of that Node's XML, tags and all. Using LotusXSL, I was > getting an org.w3c.dom.NodeList, getting its only Node (an ElementImpl), > casting it to a TXElement, then sending the TXElement the message > toXMLString(Writer), implemented by com.ibm.xml.parser.Child. That's the problem with relying something other than standardized APIs... The TX DOM is an artifact of the XML4J parser, and is _not_ a portable API. The approach you've been using may not work reliably with LotusXSL either, if you run it with a different parser or different DOM class; I believe it will fail with the version contributed to xml.apache.org's Xalan project, for example. The standard DOM does not yet include a mechanism for writing out a subtree's contents in XML syntax. DOM Level 3 is expected to add such a function. Meanwhile, the portable solution is to use a routine which accepts a DOM node as input and walks the DOM tree, generating XML syntax as it goes. XML4J comes with an example of this, the DOMWriter sample class; I believe you could simply borrow that code and invoke the appropriate method as a subroutine. ______________________________________ Joe Kesselman / IBM Research XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








