Skip to main content



      Home
Home » Eclipse Projects » Model Driven Health Tools » Structured Doc Text is null
Structured Doc Text is null [message #1821562] Fri, 14 February 2020 13:53 Go to next message
Eclipse UserFriend
In the following code block, if you run it as a unit test, it works. But uncommenting the line that includes the special character "À" results in a null on the section-text.
		String html="<table border=\"1\" width=\"100%\"><thead><tr><th>Date</th><th>Goal</th></tr></thead><tbody><tr ID=\"Goal1\"><td>02/14/2020</td><td>Goals section - " +
//				"&Agrave;\n" + 
				"• Are orders being placed at the hospital system from this facility?  No\n" + 
				"a &amp; b\n" + 
				"a &gt; b\n" + 
				"a &lt; b\n" + 
				"  10/31/19: Lab orders only at this time. </td></tr></tbody></table>";
		GoalsSection section = ConsolFactory.eINSTANCE.createGoalsSection().init();
		section.setTitle(DatatypesFactory.eINSTANCE.createST("Goals"));
		section.createStrucDocText(html);
		assertNotNull(section.getText());


Is there a limited set of characters that are supported for creating a strucDocText?

[Updated on: Fri, 14 February 2020 13:59] by Moderator

Re: Structured Doc Text is null [message #1822312 is a reply to message #1821562] Tue, 03 March 2020 13:29 Go to previous messageGo to next message
Eclipse UserFriend
The xhtml string passed to createStrucDocText is parsed into an XMLResource and is treated as proper XML. I'm guessing that the XML parser is having trouble with your particular special character (&Agrave;) and may only be able to interpret more common named html entities (e.g. &amp;, &gt, &lt, etc.).

Unfortunately, the way createStrucDocTextwas written, any exceptions thrown during the parse are swallowed so it is impossible to determine the exact issue without changing the source code. You may want to try the numeric equivalent of your entity (#192) and see if the XML parse can handle it properly.
Re: Structured Doc Text is null [message #1822352 is a reply to message #1822312] Wed, 04 March 2020 11:51 Go to previous messageGo to next message
Eclipse UserFriend
Yes, that worked. Thank you for the suggestion. But unfortunately it seems to be unmaintainable as we have to provide translations as and when we encounter new entity codes. I used a commons library (StringEscapeUtils) to do the escaping but, not all of the html4 entity codes are handled. I understand that its not in the scope of the mdht library, I was just sharing what I learnt. Thank you.
Re: Structured Doc Text is null [message #1822363 is a reply to message #1822352] Wed, 04 March 2020 18:41 Go to previous message
Eclipse UserFriend
using

StringEscapeUtils.escapeXml11(text);


fixed the problem.
Previous Topic:Version of MDHT plugin for QRDA reporting year 2019
Next Topic:Error when install OxygenMDHT.setup
Goto Forum:
  


Current Time: Sun Jul 13 01:23:29 EDT 2025

Powered by FUDForum. Page generated in 0.04274 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top