I seem to remember seeing that error back when Tomcat had some problems with the version
of Xalan it was using (you had to put a different version in the "endorsed" dir). So, I
wonder if changing the underlying SAX parser would help. See the SAXReader javadoc about
how to do that.
If it does turn out to be a bad parser, you might check to see if you have a system
classpath set and if there are any parsers on there. Er, or actually, the javadocs suggest
that it's a system property that determines which parser is used...
good luck,
Ben
marcus wrote:
OS: Windows XP Pro
Java: 5
Dom4J: 1.6.1
==================
I keep getting
org.dom4j.DocumentException: Error on line 1 of document : Content is
not allowed in prolog. Nested exception: Content is not allowed in prolog.
I get the same (more or less) using XOM/NUX.
I tried using XPP3Reader as well with the following result:
org.xmlpull.v1.XmlPullParserException: only whitespace content allowed
before start tag and not \uef (position: START_DOCUMENT seen \uef... @1:1)
at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1475)
at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1351)
....
I have tried using
<?xml version="1.0"?>
and
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
and also to skip the prolog altogether.
The file should be UTF-8 (according to UltraEdit and Firefox it is).
I am invoking using this code:
SAXReader saxReader = new SAXReader();
saxReader.addHandler("/epg/genres/genre",
new CategoryHandler(tvGuide, languageCode));
saxReader.addHandler("/epg/channels/channel",
new ChannelHandler(tvGuide, channelMap, languageCode));
saxReader.read(content);
content is an InputStream coming from a file (Windows)
I built the code and tested using small files (it worked then) and the
error occurs now when I tried to feed it with real data (about 5
megabytes, file generated by someone else).
The file opens fine in IE and Firefox and I've also tried using another
parser (REXML in Ruby) which also works fine.
Any ideas?
/Marcus
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user