You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Boris Garbuzov <bo...@xmlglobal.com> on 2001/10/11 20:30:30 UTC

root wrapper

I fail to parse the suggested linked file with the following code over crimson-jaxp, while ie5 shows it nicely. Can anybody suggest? If I manually directly wrap entries with a root, it parses well. May be I need a newer parser? How others parse xml formatted logs?
------------------------code----------------------
      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
      DocumentBuilder db = dbf.newDocumentBuilder();
      Document document = db.parse (XML_WRAPPER_FILE); // fails
------------------output-------------
org.xml.sax.SAXParseException: org.apache.crimson.parser/P-076 Unconvertible UTF-8 character beginning with 0xa0
        at org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1038)
        at org.apache.crimson.parser.InputEntity.fillbuf(InputEntity.java:1010)
        at org.apache.crimson.parser.InputEntity.peek(InputEntity.java:841)
        at org.apache.crimson.parser.Parser2.peek(Parser2.java:2922)
        at org.apache.crimson.parser.Parser2.maybeXmlDecl(Parser2.java:994)
        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:485)
        at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
        at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
        at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:173)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:134)
        at com.xmlglobal.goxmldb.test.logging.ParseLog.actualExecute(ParseLog.java:68)
-------------------------------------------example.log--------------------------
<log-entry>
  <time>1002256390714</time>
  <priority>INFO</priority>
  <category>my</category>
  <message><![CDATA[ <<<< mess, but still parsable ]]></message>
</log-entry>
<log-entry>
  <time>1002256391225</time>
  <priority>INFO</priority>
  <category>my</category>
  <message><![CDATA[my message for log entry 1]]></message>
</log-entry>
-------------------------example.log.wrapper.xml-------------
<?xml version="1.0" ?>
<!DOCTYPE logentrys [<!ENTITY logdata SYSTEM "example.log">]>
<logentries>
  &logdata;
</logentries>
-----------------------------
Well it is expected that you include example.log in another file with a top 
level element. The reason for this is to make it more difficult to end up 
with a invalid XML tree if the logging shuts down uncleanly. 


---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org


RE: root wrapper

Posted by Boris Garbuzov <bo...@xmlglobal.com>.
Thanks gratefully. It works.

---------------------------

On Fri, 12 Oct 2001 04:30, Boris Garbuzov wrote:
> I fail to parse the suggested linked file with the following code over
> crimson-jaxp, while ie5 shows it nicely. Can anybody suggest? If I manually
> directly wrap entries with a root, it parses well. May be I need a newer
> parser? How others parse xml formatted logs?

I know this bug ;) (Happens to me all the time)

It probably means you have cut and paste the text from your mail client into 
your text editor. Your text editor is Unicode enabled (emacs?) and writes the 
0xa0 silently (0xa0 is start of a 2 byte character).

Best fix is to go delete all the whitespace in area that you copy + pasted 
and then retry it ;)


---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org


Re: root wrapper

Posted by Peter Donald <do...@apache.org>.
On Fri, 12 Oct 2001 04:30, Boris Garbuzov wrote:
> I fail to parse the suggested linked file with the following code over
> crimson-jaxp, while ie5 shows it nicely. Can anybody suggest? If I manually
> directly wrap entries with a root, it parses well. May be I need a newer
> parser? How others parse xml formatted logs?

I know this bug ;) (Happens to me all the time)

It probably means you have cut and paste the text from your mail client into 
your text editor. Your text editor is Unicode enabled (emacs?) and writes the 
0xa0 silently (0xa0 is start of a 2 byte character).

Best fix is to go delete all the whitespace in area that you copy + pasted 
and then retry it ;)

-- 
Cheers,

Pete

*-----------------------------------------------------*
| For those who refuse to understand, no explanation  |
| will ever suffice. For those who refuse to believe, |
| no evidence will ever suffice.                      |
*-----------------------------------------------------*

---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org