Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Model Driven Health Tools » Structured Doc Text is null
Structured Doc Text is null [message #1821562] Fri, 14 February 2020 18:53 Go to next message
Kalyan Dasika is currently offline Kalyan DasikaFriend
Messages: 7
Registered: August 2017
Junior Member
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 18:59]

Report message to a moderator

Re: Structured Doc Text is null [message #1822312 is a reply to message #1821562] Tue, 03 March 2020 18:29 Go to previous messageGo to next message
John T.E. Timm is currently offline John T.E. TimmFriend
Messages: 161
Registered: July 2009
Senior Member
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 16:51 Go to previous messageGo to next message
Kalyan Dasika is currently offline Kalyan DasikaFriend
Messages: 14
Registered: December 2015
Junior Member
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 23:41 Go to previous message
Kalyan Dasika is currently offline Kalyan DasikaFriend
Messages: 14
Registered: December 2015
Junior Member
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: Sat Apr 20 01:53:41 GMT 2024

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

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

Back to the top