Can't you just load this document using the document() function?  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?

Can you give a more detailed description of the source of the data?  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.

Dave



                                                                                       
                                                       
                      "Brian Quinlan"                                                  
                                                       
                      <brian@sweetapp.         To:      <[EMAIL PROTECTED]>     
                                                       
                      com>                     cc:      (bcc: David N 
Bertoni/Cambridge/IBM)                                                  
                                               Subject: Returning new nodes from 
extension function                                           
                      04/18/2002 06:58                                                 
                                                       
                      PM                                                               
                                                       
                      Please respond                                                   
                                                       
                      to xalan-dev                                                     
                                                       
                                                                                       
                                                       
                                                                                       
                                                       



I'd like to write a Xalan extension function that, given XML in string
format, returns a node set or result tree fragment.

Does this approach seem feasible:

1. enclose the XML in <magic-out-tags>
2. parse the XML using Xerces
3. use the liaison classes to get XalanNodes
4. subclass XNodeSetBase and return the correct XalanNodes
5. wait until the transformation is done and free up the DOM that I
greated

Cheers,
Brian






Reply via email to