Two unrelated questions.  The first is that I would like to transform a DOM
into a DOM, the reason for this is that there may be a number of stylesheets
applied to a single input XML document, thus giving a general procedure:

        input --styleA--> DOM output #1
        DOM output #1 --styleB--> DOM output #2 (...)
        DOM output #n --styleZ--> string

currently all of my outputs are strings, but I'm assuming it would be more
efficient to directly output a XalanSourceTreeDocument at each stage to
avoid reparsing the text data.  However, i'm having little luck in doing
this, any clues would be much appreciated.

The second question is that I have some extension functions that return
nodesets, containing dynamically generated nodes (these are in fact SQL
lookups).  I do this by creating a XalanSourceTreeDocument and adding nodes
onto this, e.g.:


        XalanSourceTreeDocument* theDocument = new XalanSourceTreeDocument(1);
        XalanSourceTreeElement* sql = theDocument->createElementNode(L"sql",
emptyAttributes, theDocument);
        theDocument->appendChildNode(sql);
        XPathExecutionContext::BorrowReturnMutableNodeRefList
theNodeList(executionContext);
        theNodeList->addNode(theDocument);
        return executionContext.getXObjectFactory().createNodeSet(theNodeList);

Now my problem is that this document does not belong to the execution
context, and in fact here it belongs to nothing (and is leaked).  Should I
just have the function object cache the generated documents, or is there a
better way of doing this?

Thanks,

Mark

Reply via email to