Merge branch 'master' of github.com:jamesagnew/hapi-fhir

This commit is contained in:
James Agnew 2014-11-21 12:24:40 -05:00
commit 028c349d10
2 changed files with 9 additions and 7 deletions

View File

@ -71,15 +71,17 @@ public class XhtmlDt extends BasePrimitive<List<XMLEvent>> {
*/
@Override
public void setValueAsString(String theValue) throws DataFormatException {
String value = theValue.trim();
if (value.charAt(0) != '<') {
value = "<div>" + value + "</div>";
if (theValue == null || theValue.isEmpty()) {
super.setValueAsString(null);
} else {
String value = theValue.trim();
if (value.charAt(0) != '<') {
value = "<div>" + value + "</div>";
}
super.setValueAsString(value);
}
super.setValueAsString(value);
}
public boolean hasContent() {
return getValue() != null && getValue().size() > 0;
}

View File

@ -89,7 +89,7 @@ public class XmlParserTest {
@Test
public void testProfileWithBoundCode() throws IOException {
String content = IOUtils.toString(XmlParserTest.class.getResourceAsStream("/DMIXAuditException.xml"));
String content = IOUtils.toString(XmlParserTest.class.getResourceAsStream("/DMIXAuditException.xml"), "UTF-8");
ourCtx.newXmlParser().parseResource(Profile.class, content);
}