I followed David Bertoni and Mark Weaver's discussion about DynamicBuilders 
for returning Documents and ResultTreeFragments from Xalan C++ extension 
functions but see no evidence of the new "factory" classes in Xalan C++ 1.9 
sources. I assume that these very attractive changes did not make it in to 
any subsequent release.

So, what is the recommended approach for returning new Document fragments (I'm 
attempting to do something nearly identical to the Xalan-J sql extension and 
need to construct an RTF to hold the query result data...)

As you know, the samples sources only add nodes to existing nodesets (eg. the 
NodeSet extension).

I also see use of adding a node to a MutableNodeRefList and perhaps can ask 
that node list to add a XalanNode which comes from a wrapped instance of a 
XercesDocument which was created by  the Xerces DOM document factory. Eg:

    DOMDocument * queryResultDom = 
      DOMImplementation::getImplementation()->createDocument(0, xmlString, 
0 );

    // map/wrap/convert the Xerces DOM Document to a suitable Xalan form
    // fyi, we can't use a XercesDocumentWrapper directly to create the DOM
    // because it is a read-only structure!
    XercesDocumentWrapper 
xercesDocWrapper(executionContext.getMemoryManager(),
                                           queryResultDom );

               XPathExecutionContext::BorrowReturnMutableNodeRefList
                        theNodeList(executionContext);

                theNodeList->addNode( xercesDocWrapper );

                return
executionContext.getXObjectFactory().createNodeSet(theNodeList);

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to