in XMLParser, the contructor doesn't use the 'theFactory' parameter anywhere to set the 'myFactory' member in the parent Parser. The constructor should probably call super(theFactory). As a result, custom messages parsed using XML encoding may get a java.lang.ClassCastException: ca.uhn.hl7v2.model.GenericMessage$V25 (or similar for other versions) if they try to cast the result to their custom message type.
public XMLParser(ModelClassFactory theFactory) {
parser = new DOMParser(new StandardParserConfiguration());
try {
parser.setFeature("http://apache.org/xml/features/dom/include-ignorable-whitespace", false);
}
catch (Exception e) {
log.error("Can't exclude whitespace from XML DOM", e);
}
}
Thanks for fixing this Christian! I saw the change on the 2.0beta1. Is it possible to apply this to earlier releases (i.e. 1.2) as well (or does that defeat the purpose of a "release")?...I haven't seen any "SNAPSHOT" versions.
Thanks!
Stephen
We usually try to be backwards-compatible with new versions so there shuold be not a major problem to switch to 2.0 once it's released.
Excellent! Thanks.