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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to