Merge branch 'master' of github.com:jamesagnew/hapi-fhir
This commit is contained in:
commit
028c349d10
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue