Hi, David! DOM was our original input source idea because input to the XSLT processor will not be located in a file or stream, but from a database process. To create XML, this database information would need to be parsed via either the DOM or SAX parser, only to be converted to an XML string. As a string or DOM tree, the DOM document would nevertheless be created.
I mainly just want the process to be as fast as possible and avoid any multiple parse runs for the input source. The input XML docs or trees, etc., can definitely be very large. I would really appreciate any suggestions you might have! Thanks, a lot! Matt Hanson -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, December 03, 2001 10:36 AM To: [email protected] Subject: Re: Type:RuntimeException, Message:The primary document entity could not be opened. Id={null} There is new functionality to work with the DOM using the XalanTransformer. You can get it by checking out the latest code from the CVS repository. Otherwise, you can wait until the next release, when it will be included with the distribution. For more information, you can search the bug database. In general, it's a bad idea to use the Xerces DOM for transformations. Depending on the size of the document, and the nature of your stylesheets, using the DOM can be up to an order of magnitude slower and have much higher memory requirements. Unless you have some specific need to use the DOM, don't do it -- let Xalan build its own source tree. Dave Matthew James Hanson To: [email protected] <matthew.hanson@ cc: (bcc: David N Bertoni/CAM/Lotus) wcom.com> Subject: Type:RuntimeException, Message:The primary document entity could not be opened. Id={null} 12/03/2001 12:18 PM 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!
