3 reasons that XML should be Streamed and never “Stringed”

XML is a text format, and so it is tempting to handle it with the normal String handling capabilities of Java, but there are several reasons that you must never do this.  XML should either be on the disk as a sequence of bytes, or it should be parsed as a DOM tree of decoded string values, but it should never be in a String in its encoded value. Continue reading

Advertisement

XML Schema Validation, or not?

The question is: should a program that reads a standard XML file format use XML Schema Validation when reading the file to make sure that the file being read is properly formatted?  The answer depends upon a lot of things.  It is certainly NOT a foregone conclusion that you should always validate XML when reading.  There are times when validating will constrain the functionality to an unacceptable degree over the long run. Continue reading