You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Simon Kitching <si...@ecnetwork.co.nz> on 2004/03/03 22:25:17 UTC

Re: How to write a Xalan extension function returning DocumentFragment

On Wed, 2004-03-03 at 22:00, Arjen Haayman wrote:
> Hello,
> 
> I'm trying to write a Xalan extension function in Java that should return a 
> DocumentFragment.
> So far however I've been unable to figure out how to construct a 
> DocumentFragment.
> 
> The only way I've found is Document.createDocumentFragment(), but how do I 
> get a document?

Any old document object will do; it doesn't need to be related to the
document object representing the input or output data.

So just use the normal mechanism for instantiating a Document object.
You can do this each time you need to create a new node, or (more
efficiently) store a Document object somewhere convenient (perhaps as a
singleton) for repeated use as a factory for objects.

Regards,

Simon