[jdom-interest] Byte Order Mark Parsing

Laurent Bihanic laurent.bihanic at atosorigin.com
Thu Nov 29 01:12:23 PST 2001


Fred Clewis wrote:

> I'm using JDOMb7 and xerces 2 b3.    During my attempts to
> internationalize, I have temporarily come to the strange conclusion that I
> need to add a BOM, FE FF, to the front of a unicode format xml file.
> 
> I get:
> org.jdom.JDOMException: Error in building: Content is not allowed in
> prolog.
>         at java.lang.Throwable.<init>(Throwable.java:96)
>         at java.lang.Exception.<init>(Exception.java:44)
>         at org.jdom.JDOMException.<init>(JDOMException.java:119)
>         at org.jdom.input.SAXBuilder.build(SAXBuilder.java:306)
>         at org.jdom.input.SAXBuilder.build(SAXBuilder.java:583)
> 
> the file in hex looks like:
> FEFF003C 003F0078 006D006C 00200076
> 
> Is this supposed to parse?

Yes but only if you use Xerces. Crimson does not recognize the BOM headers.

Laurent




More information about the jdom-interest mailing list