[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Moving from LotusXSL to XT

Subject: Re: Moving from LotusXSL to XT
From: keshlam@xxxxxxxxxx
Date: Thu, 16 Dec 1999 09:11:39 -0500
lotusxsl code sample
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.