You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by SP/Nowotny Florian <fn...@vfst.de> on 2004/01/13 09:09:40 UTC

Documentation of xalan error messages

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

Re: Documentation of xalan error messages

Posted by da...@us.ibm.com.



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:      <xa...@xml.apache.org>                                                            
                      <fn...@vfst.de>             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