XML 1.1 is not as widely adopted as XML 1.0 and is recommended for use only by those who need its unique features. I was writing a Java/EMF program that was storing serialised objects in XML. The serialisation involved control characters, e.g.
, so XML 1.1 seemed a good choice.
To my surprise I could not parse some documents that I have just serialised. Some attributes went missing and then EMF was failing to load the objects. To check whether this is my problem I tried finding a minimal example to reproduce the problem. The rest of this post gives the example in detail, but to cut things short, it looks like there is a bug in Java 6 XML libraries: the problem is not reproducible with the latest version of Apache Xerces libraries.
Every now and then I spend some time on things that may also be useful to others. I often find myself turning to the Internet for that quick “how do I”—and the Internet is usually extremely helpful. I will try to put some of my small ideas and results here. If they save a minute or an hour of somebody’s time—that will be my contribution.
P.S. I am not an avid writer… so may go silent for prolonged periods of time.