Hi!

We are trying to use XalanC++ to tranform XML docs to FO.  I am beginning to
test the library, and using non-DOM XSLTInputSource objs as the XML
parameter to the XalanTransformer works just fine.  However, an exception is
thrown when I use the following code, hoping to use DOM as an input source:

   XMLPlatformUtils::Initialize();
   XalanTransformer::initialize();

        XalanTransformer theXalanTranformer;

        DOMParser theParser;
        theParser.setToCreateXMLDeclTypeNode(false);
        theParser.parse("foo.xml");
        const DOM_Document theDOM = theParser.getDocument();
        XercesDOMSupport theDOMSupport;
        XercesParserLiaison theParserLiaison(theDOMSupport);
        XalanDocument * theDoc = theParserLiaison.createDocument(theDOM);
        XSLTInputSource xmlIn(theDoc);

        XSLTInputSource xslIn("foo.xsl");

        std::ostringstream strm;
        XSLTResultTarget xmlOut(strm);

        int theResult = theXalanTranformer.transform(xmlIn, xslIn, xmlOut);

This sample code is very similar to the usage patterns at xml.apache.org.
Please help!  I am also interested in information on performance issues when
using DOM XML input to the XalanTransformer.  There is a caveat in the
documentation that seems to recommend against using the DOM.  Is file based
input preferred, and if so, how much faster?

Thanks!
Matt Hanson!

Reply via email to