Don't give up on using the "document()" function.  If the "different
process" can persist the XML to a temporary file or can use pipes, or can be
called via a URI, there is a way to do it.  This will be INFINITELY cleaner.

Rick Bullotta
CTO
Lighthammer Software (www.lighthammer.com)



-----Original Message-----
From: Brian Quinlan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 11:24 PM
To: [EMAIL PROTECTED]
Subject: RE: Returning new nodes from extension function


> Can't you just load this document using the document() function?

No. The document is dynamically generated in a different process.

> You can't use Xerces to parse a fragment, so it has to be a full
document
> anyway.
> You could do this by installing an EntityResolver and looking for
"magic"
> URLs passed to the parser.  Process the ones you want to in any
special
> way, and defer the others to the parser.
>
> Or is your intent to parse dynamic XML based on the argument to the
> function.  For example, is it a string you're trying to parse?

Yes. Based on a string that is generated as part of the XSLT
transformation, the extension function needs to trigger an external
process that will return XML elements as a string. I want to convert
those elements into a NodeSet for processing.

Since the external process is returning elements, I can create a full
document easily just by wrapping them in a garbage element.

> Can you give a more detailed description of the source of the data?

I don't really know much about the source of the data. Is what I've told
you sufficient?

> It's
> certainly possible to sub-class XNodeSetBase and put everything in it
that
> you need to do this.  The run-time will keep the variable reference-
> counted until it goes out of scope, at which point you can have the
> object delete itself when its reference count goes to 0.
> However, it wouldn't persist until then end of the transformation in
> that case.


That's fine. I didn't know about the reference counting. I just wanted
to make sure that my generated nodes got deleted at some point.

Cheers,
Brian


Reply via email to