Hi Dave, thank's for Your answer. My question about the "primary document entity that cannot be opened" is based on the following: One of our customers with that problem has tested a sligthly modified version of our application. Before the modification the XalanTransformer->Transform(xml,xsl,xml_out) method got an istream as the xml-XSLTInputSource and a file name string was the xsl-XSLTInputSource. So I modified the code to open the XSL document by myself. The method transform then gets two XSLT-InputSources contructed out of std::istreams. This transformation did well at the customers environment!
BUT NOW: I'm taking the result of the first transformation as an input for a second one. That's why the result is a stringstream. The first transformation uses it as ostream the next transformation uses it as istream - one after another. The second transformation runs through the same modified code. So the xsl document is again opened by myself. That's why I have only istreams as input sources for the second transformation. I recieve a "primary document entity could not be opened" during that step! Do you have any explanation? Do You have knowledge about the implementation of Xerces? Does it serialize a stream temporary under cirtain circumstances and cannot open it? Florian -----Urspr�ngliche Nachricht----- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 13. Januar 2004 18:27 An: [email protected] Betreff: Re: Documentation of xalan error messages Hi Florian, Unfortunately, those are both Xerces-C error messages, and not Xalan-C error messages. The first occurs when any document entity cannot be opened by the parser. That usually means you've supplied a file name, or a URL. It should not happen when using a std::istream, because the parser is not trying to "open" the entity. An "invalid document structure" error would occur whenever the parser cannot make sense out the byte stream it is parsing. That can include: 1. spaces before the xml declaration, or the document element, if there's no xml declaration 2. non-whitespace characters outside of the document element 3. A mismatch in the encoding declaration and the actual encoding of the document. You should dump the bytes in your input stream and verify you actually have a well-formed XML document. If your platform is Solaris, there is a known bug with IOstreams on that platform which results in a corrupt stream. If that's the case, there's a patch from Sun you can apply to fix the problem. Dave "SP/Nowotny Florian" To: <[email protected]> <[EMAIL PROTECTED]> cc: (bcc: David N Bertoni/Cambridge/IBM) Subject: Documentation of xalan error messages 01/13/2004 12:09 AM Please respond to xalan-c-users Hi, I need a documentation of the error messages of C++ - Xalan 1.4 (and Xerces 2.1). Can anybody tell me where to find one? I would like to know all the reasons for xalan to raise the message "the primary document entity could not be opened"? One is when I use a filename in one of the two contructors of XSLTInputSource (ether the XML or XSL document) is not acessible/availible, correct? Does it also occur when I use istreams that are corrupt in any way? When exactly does Xalan raise "invalid document structure"? I'm using an istream as the InputSource for xml. I get this message even though the get pointer of the stream is at ios::beg position. Florian Nowotny
