[xsl] Adding to doc in extensions

Subject: [xsl] Adding to doc in extensions
From: "Hunsberger, Peter" <Peter.Hunsberger@xxxxxxxxxx>
Date: Thu, 11 Oct 2001 09:01:15 -0500
I posted this last night but for some reason it never showed up, excuse me
if it ends up here twice.

Our environment is LotusXSL (Xalan 2) on Websphere 3.5.4 on NT. I'm just
getting back into this after a year or so break so excuse me if I get some
of the terminology confused...

I've got a XSLt which I'm using to output HTML.  For one of the XML source
fragments I have to call a Java extension function and return a variable
number of document fragments that have the same structure as the source
fragment but differing values for the various nodes.  Conceptually, I want
to clone the (complete) input  nodeset "n" times and for each new clone,
traverse the fragment and set some new values for various nodes based on the
name of the node.  The structure of the fragment passed to the extension is
not known prior to calling the extension, although the names of the nodes
are. The values substituted into the document fragment are derived from
other Java classes over which I have no control (eg. for node "X" call
method "Y" of class "Z").

The question is, what is the basic mechanism for returning arbitrary
nodesets from an extension back to the XSLt?   However, NodeImpl.cloneNode
does not appear to be implemented (is this a function of the parser?).
ElementImpl has "friendly" constructors which suggests it's not a good idea
to explore that direction and no other implementations of Node appear to
have the necessary function needed.  Finally, there seems to be no higher
level constructs for manipulating the DOM directly?

Any suggestions where I find good documentation on writing extensions in the
first place?  Sample code that shows how to return a dynamically created
nodeset/nodelist would be greatly appreciated....

Peter Hunsberger

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread