xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincent Faidherbe <vf...@icogs.com>
Subject Crimson: Bug when document begins with whitespaces?
Date Fri, 12 Oct 2001 13:24:19 GMT
When a parsed XML document begin with one or more whitespace(s), Crimson 
fails when it encounters the XML declaration  and it returns the  
message P-019 : "XML declaration may only begin entities". I've the 
problem with the RSS documents generated by 10.am.
So i've added a line in the  parseInternal (InputSource input) of 
Parse2, here's the code

    private void parseInternal (InputSource input)
    throws SAXException, IOException
        if (input == null)
            fatal ("P-000");

        try {

            contentHandler.setDocumentLocator (locator);

            contentHandler.startDocument ();

             // Add by Vincent Faidherbe (vfaid@icogs.com)
             // Because the XML document could start with whitespaces.
             // Check RSS feed from 10.am for example ;-)
            // end add

            maybeXmlDecl ();

Now, it's works fine when the document starts with whitespaces.
I don't know if it is a bug but if it is, i think i've fixed it.

Vincent Faidherbe

"Do you think C++ is lovable? Unless you're into SM (Software Masochism), probably not." (JLG)

In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org

View raw message