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 @Override
public void setValueAsString(String theValue) throws DataFormatException { public void setValueAsString(String theValue) throws DataFormatException {
String value = theValue.trim(); if (theValue == null || theValue.isEmpty()) {
if (value.charAt(0) != '<') { super.setValueAsString(null);
value = "<div>" + value + "</div>"; } else {
String value = theValue.trim();
if (value.charAt(0) != '<') {
value = "<div>" + value + "</div>";
}
super.setValueAsString(value);
} }
super.setValueAsString(value);
} }
public boolean hasContent() { public boolean hasContent() {
return getValue() != null && getValue().size() > 0; return getValue() != null && getValue().size() > 0;
} }

View File

@ -89,7 +89,7 @@ public class XmlParserTest {
@Test @Test
public void testProfileWithBoundCode() throws IOException { 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); ourCtx.newXmlParser().parseResource(Profile.class, content);
} }