cool, thanks. its a bit awkward in this context -- do we make these declarations a mandatory part of a valid htmlform? Or do you just jam them in there during processing if they aren't there?
d On 3/12/12, Mark Goodrich <[email protected]> wrote: > Looks like if you use ASCII codes it works... that is, for example,   > instead of Also, you can use the workaround that Justin mentions, > which doesn't seem too bad to me... > > http://www.coderanch.com/t/129063/XML/entity-nbsp-was-referenced-but > > > From: [email protected] [mailto:[email protected]] On Behalf Of Justin Miranda > Sent: Monday, March 12, 2012 11:09 AM > To: [email protected] > Subject: Re: [OPENMRS-DEV] Flowsheet Question > > Hey Dave > > I ran into this issue with OpenBoxes while trying to render HTML as PDF. I > just added the common entity declarations to the top of the page and the > issue was resolved. This still feels like a hack, but it worked for me. > > <!DOCTYPE html [ > <!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for > XHTML//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent"> > <!ENTITY % HTMLspecial PUBLIC "-//W3C//ENTITIES Special for > XHTML//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent"> > <!ENTITY % HTMLsymbol PUBLIC "-//W3C//ENTITIES Symbols for > XHTML//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent"> > %HTMLlat1; > %HTMLspecial; > %HTMLsymbol; > ]> > > > On Sun, Mar 11, 2012 at 6:00 AM, Dave Thomas > <[email protected]<mailto:[email protected]>> wrote: > > Ok, I'll try to get you a new build tonight. Interesting catch. I can > explicitly parse out the strings for now. There may also be a > native java function for applying html character substitutions, which would > be a better fix in stringToDocument.. > > D > On Mar 11, 2012 12:54 PM, "Tobin Greensweig" > <[email protected]<mailto:[email protected]>> wrote: > You were right, it's a bug. If the showTime="true" is included in the > <encounterDate> tag of the HTML form then the voidEncounter function breaks. > It has something to do with an   which gets added into the page when > that attribute is true. See my error log below. I'll post it as a bug. > > Not sure if flowsheet should handle the   more gracefully or whether it > shouldn't be there at all. > > Tobin > > > > [Fatal Error] :30:274: The entity "nbsp" was referenced, but not declared. > ERROR - HtmlFormEntryUtil.stringToDocument(236) |2012-03-11 12:42:54,516| > Error converting String to Document: > <div class="htmlform"> > > <style> > .section { > border: 1px solid #009d8e; > padding: 2px; > text-align: left; > margin-bottom: 1em; > } > .sectionHeader { > background-color: #009d8e; > color: white; > display: block; > padding: 2px; > font-weight: bold; > } > table.baseline-aligned td { > vertical-align: baseline; > } > </style> > > <h2>Default Form (v1)</h2> > > <div class="section"><span class="sectionHeader">1. Encounter > Details</span> > <table class="baseline-aligned"> > <tr> > <td>Date:</td> > <td> > <input type="text" size="10" id="w27-display"/><input > type="hidden" name="w27" id="w27" /> > (mm/dd/yyyy)<script>setupDatePicker('mm/dd/yy', 'en-US', '#w27-display', > '#w27', '2012-03-11')</script><span class="error" style="display: none" > id="w28"></span> <select name="w25hours"><option > value="0">00</option><option value="1">01</option><option > value="2">02</option><option value="3">03</option><option > value="4">04</option><option value="5">05</option><option > value="6">06</option><option value="7">07</option><option > value="8">08</option><option value="9">09</option><option > value="10">10</option><option value="11">11</option><option value="12" > selected="true">12</option><option value="13">13</option><option > value="14">14</option><option value="15">15</option><option > value="16">16</option><option value="17">17</option><option > value="18">18</option><option value="19">19</option><option > value="20">20</option><option value="21">21</option><option > value="22">22</option><option value="23">23</option></select>:<select > name="w25minutes"><option value="0">00</option><option > value="1">01</option><option value="2">02</option><option > value="3">03</option><option value="4">04</option><option > value="5">05</option><option value="6">06</option><option > value="7">07</option><option value="8">08</option><option > value="9">09</option><option value="10">10</option><option > value="11">11</option><option value="12">12</option><option > value="13">13</option><option value="14">14</option><option > value="15">15</option><option value="16">16</option><option > value="17">17</option><option value="18">18</option><option > value="19">19</option><option value="20">20</option><option > value="21">21</option><option value="22">22</option><option > value="23">23</option><option value="24">24</option><option > value="25">25</option><option value="26">26</option><option > value="27">27</option><option value="28">28</option><option > value="29">29</option><option value="30">30</option><option > value="31">31</option><option value="32">32</option><option > value="33">33</option><option value="34">34</option><option > value="35">35</option><option value="36">36</option><option > value="37">37</option><option value="38">38</option><option > value="39">39</option><option value="40">40</option><option > value="41">41</option><option value="42" selected="true">42</option><option > value="43">43</option><option value="44">44</option><option > value="45">45</option><option value="46">46</option><option > value="47">47</option><option value="48">48</option><option > value="49">49</option><option value="50">50</option><option > value="51">51</option><option value="52">52</option><option > value="53">53</option><option value="54">54</option><option > value="55">55</option><option value="56">56</option><option > value="57">57</option><option value="58">58</option><option > value="59">59</option></select><span class="error" style="display: none" > id="w26"></span> > </td> > </tr> > <tr> > <td>Location:</td> > <td> > <select id="w29" name="w29"> > <option value="">Choose a Location...</option> > <option selected="true" value="1">Refugee Clinic TLV</option></select><span > class="error" style="display: none" id="w30"></span> > </td> > </tr> > <tr> > <td>Signature:</td> > <td> > <select id="w31" name="w31"> > <option value="">Choose...</option> > <option value="3">Rofeh Israel</option> > <option value="8">Jonah Mink</option> > <option selected="true" value="1">Super User</option></select><span > class="error" style="display: none" id="w32"></span> > </td> > </tr> > </table> > </div> > > > > <div class="section"><span class="sectionHeader">2. Vital Signs</span> > <br></br> > Height (cm): <input type="text" size="5" id="w34" name="w34" > onBlur="checkNumber(this,'w33',true,10.0,228.0)"/> <span class="error" > style="display: none" id="w33"></span> > <br></br> > Weight (kg): <input type="text" size="5" id="w36" name="w36" > onBlur="checkNumber(this,'w35',true,0.0,250.0)"/> <span class="error" > style="display: none" id="w35"></span> > <br></br> > Systolic BP: <input type="text" size="5" id="w38" name="w38" > onBlur="checkNumber(this,'w37',false,0.0,250.0)"/> <span class="error" > style="display: none" id="w37"></span> > <br></br> > Diastolic BP: <input type="text" size="5" id="w40" name="w40" > onBlur="checkNumber(this,'w39',false,0.0,150.0)"/> <span class="error" > style="display: none" id="w39"></span> > <br></br> > Temperature (C): <input type="text" size="5" id="w42" name="w42" > onBlur="checkNumber(this,'w41',true,25.0,43.0)"/> <span class="error" > style="display: none" id="w41"></span> > <br></br> > Pulse: <input type="text" size="5" id="w44" name="w44" > onBlur="checkNumber(this,'w43',false,0.0,230.0)"/> <span class="error" > style="display: none" id="w43"></span> > <br></br> > Respiratory Rate: <input type="text" size="5" id="w46" name="w46" > onBlur="checkNumber(this,'w45',false,null,null)"/> <span class="error" > style="display: none" id="w45"></span> > <br></br> > SAO2 (%): <input type="text" size="5" id="w48" name="w48" > onBlur="checkNumber(this,'w47',false,0.0,100.0)"/> <span class="error" > style="display: none" id="w47"></span> > > </div> > > <input type="button" class="submitButton" value="Enter Form" > onClick="submitHtmlForm()"/> > > </div> > ERROR - HtmlFormEntryUtil.stringToDocument(236) |2012-03-11 12:42:54,516| > Error converting String to Document: > <div class="htmlform"> > > <style> > .section { > border: 1px solid #009d8e; > padding: 2px; > text-align: left; > margin-bottom: 1em; > } > .sectionHeader { > background-color: #009d8e; > color: white; > display: block; > padding: 2px; > font-weight: bold; > } > table.baseline-aligned td { > vertical-align: baseline; > } > </style> > > <h2>Default Form (v1)</h2> > > <div class="section"><span class="sectionHeader">1. Encounter > Details</span> > <table class="baseline-aligned"> > <tr> > <td>Date:</td> > <td> > <input type="text" size="10" id="w27-display"/><input > type="hidden" name="w27" id="w27" /> > (mm/dd/yyyy)<script>setupDatePicker('mm/dd/yy', 'en-US', '#w27-display', > '#w27', '2012-03-11')</script><span class="error" style="display: none" > id="w28"></span> <select name="w25hours"><option > value="0">00</option><option value="1">01</option><option > value="2">02</option><option value="3">03</option><option > value="4">04</option><option value="5">05</option><option > value="6">06</option><option value="7">07</option><option > value="8">08</option><option value="9">09</option><option > value="10">10</option><option value="11">11</option><option value="12" > selected="true">12</option><option value="13">13</option><option > value="14">14</option><option value="15">15</option><option > value="16">16</option><option value="17">17</option><option > value="18">18</option><option value="19">19</option><option > value="20">20</option><option value="21">21</option><option > value="22">22</option><option value="23">23</option></select>:<select > name="w25minutes"><option value="0">00</option><option > value="1">01</option><option value="2">02</option><option > value="3">03</option><option value="4">04</option><option > value="5">05</option><option value="6">06</option><option > value="7">07</option><option value="8">08</option><option > value="9">09</option><option value="10">10</option><option > value="11">11</option><option value="12">12</option><option > value="13">13</option><option value="14">14</option><option > value="15">15</option><option value="16">16</option><option > value="17">17</option><option value="18">18</option><option > value="19">19</option><option value="20">20</option><option > value="21">21</option><option value="22">22</option><option > value="23">23</option><option value="24">24</option><option > value="25">25</option><option value="26">26</option><option > value="27">27</option><option value="28">28</option><option > value="29">29</option><option value="30">30</option><option > value="31">31</option><option value="32">32</option><option > value="33">33</option><option value="34">34</option><option > value="35">35</option><option value="36">36</option><option > value="37">37</option><option value="38">38</option><option > value="39">39</option><option value="40">40</option><option > value="41">41</option><option value="42" selected="true">42</option><option > value="43">43</option><option value="44">44</option><option > value="45">45</option><option value="46">46</option><option > value="47">47</option><option value="48">48</option><option > value="49">49</option><option value="50">50</option><option > value="51">51</option><option value="52">52</option><option > value="53">53</option><option value="54">54</option><option > value="55">55</option><option value="56">56</option><option > value="57">57</option><option value="58">58</option><option > value="59">59</option></select><span class="error" style="display: none" > id="w26"></span> > </td> > </tr> > <tr> > <td>Location:</td> > <td> > <select id="w29" name="w29"> > <option value="">Choose a Location...</option> > <option selected="true" value="1">Refugee Clinic TLV</option></select><span > class="error" style="display: none" id="w30"></span> > </td> > </tr> > <tr> > <td>Signature:</td> > <td> > <select id="w31" name="w31"> > <option value="">Choose...</option> > <option value="3">Rofeh Israel</option> > <option value="8">Jonah Mink</option> > <option selected="true" value="1">Super User</option></select><span > class="error" style="display: none" id="w32"></span> > </td> > </tr> > </table> > </div> > > > > <div class="section"><span class="sectionHeader">2. Vital Signs</span> > <br></br> > Height (cm): <input type="text" size="5" id="w34" name="w34" > onBlur="checkNumber(this,'w33',true,10.0,228.0)"/> <span class="error" > style="display: none" id="w33"></span> > <br></br> > Weight (kg): <input type="text" size="5" id="w36" name="w36" > onBlur="checkNumber(this,'w35',true,0.0,250.0)"/> <span class="error" > style="display: none" id="w35"></span> > <br></br> > Systolic BP: <input type="text" size="5" id="w38" name="w38" > onBlur="checkNumber(this,'w37',false,0.0,250.0)"/> <span class="error" > style="display: none" id="w37"></span> > <br></br> > Diastolic BP: <input type="text" size="5" id="w40" name="w40" > onBlur="checkNumber(this,'w39',false,0.0,150.0)"/> <span class="error" > style="display: none" id="w39"></span> > <br></br> > Temperature (C): <input type="text" size="5" id="w42" name="w42" > onBlur="checkNumber(this,'w41',true,25.0,43.0)"/> <span class="error" > style="display: none" id="w41"></span> > <br></br> > Pulse: <input type="text" size="5" id="w44" name="w44" > onBlur="checkNumber(this,'w43',false,0.0,230.0)"/> <span class="error" > style="display: none" id="w43"></span> > <br></br> > Respiratory Rate: <input type="text" size="5" id="w46" name="w46" > onBlur="checkNumber(this,'w45',false,null,null)"/> <span class="error" > style="display: none" id="w45"></span> > <br></br> > SAO2 (%): <input type="text" size="5" id="w48" name="w48" > onBlur="checkNumber(this,'w47',false,0.0,100.0)"/> <span class="error" > style="display: none" id="w47"></span> > > </div> > > <input type="button" class="submitButton" value="Enter Form" > onClick="submitHtmlForm()"/> > > </div> > java.lang.RuntimeException: org.xml.sax.SAXParseException: The entity "nbsp" > was referenced, but not declared. > at > org.openmrs.module.htmlformflowsheet.web.utils.HtmlFormFlowsheetWebUtils.getAllDrugsUsedInHtmlForm(HtmlFormFlowsheetWebUtils.java:184) > at > org.openmrs.module.htmlformflowsheet.web.dwr.HtmlFormFlowsheetDWR.voidEncounter(HtmlFormFlowsheetDWR.java:40) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at > org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34) > at > org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428) > at > org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:431) > at > org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283) > at > org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52) > at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101) > at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at > org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:65) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at org.openmrs.web.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:60) > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at > org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:76) > at org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:58) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at > org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:112) > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at > org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at > org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) > at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) > at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) > at java.lang.Thread.run(Thread.java:680) > Caused by: org.xml.sax.SAXParseException: The entity "nbsp" was referenced, > but not declared. > at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) > at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) > at > org.openmrs.module.htmlformentry.HtmlFormEntryUtil.stringToDocument(HtmlFormEntryUtil.java:232) > at > org.openmrs.module.htmlformflowsheet.web.utils.HtmlFormFlowsheetWebUtils.getAllDrugsUsedInHtmlForm(HtmlFormFlowsheetWebUtils.java:157) > ... 58 more > > > > > > > On Sun, Mar 11, 2012 at 12:11 PM, Dave Thomas > <[email protected]<mailto:[email protected]>> wrote: > > Hi. This I'd probably a bug. do you see an error in the tomcat loss when > you do this? > > Thanks, Dave > On Mar 11, 2012 12:02 PM, "Tobin Greensweig" > <[email protected]<mailto:[email protected]>> wrote: > Hi Dave, > > Hope that you are well. Are you in Rwanda these days? > > I'm working on an implementation with your Flowsheet module and I'm running > into a problem that's driving me nuts! It seems like something too > fundamental too be a bug. I am running unsupported 1.8.3 but I've replicated > the problem on a clean install of 1.6.4 and 1.8.2 standalone as well. > > Here's my issue: > > I can't delete an encounter with the trashcan icon in a flowsheet. I click > it and get the usual "Are you sure you want to delete this encounter?" then > when I click OK I get "Unable to delete this encounter." I can go into the > form in view mode (clicking on the date) and delete it from the header > without a problem. Have you seen this before? I'm almost positive that this > was working in the last week but it could be my imagination... I thought > maybe it had to do with permissions but I'm working as Super User. > > > Thank you in advance for your help!!!! Tobin > > > > Here's an example of one of the forms I'm generating the flowsheet from and > an example of the URL i'm using to call it: > > http://localhost:8081/openmrs-standalone/module/htmlformflowsheet/patientWidgetChart.list?patientId=2201&configuration=F:vitals:18 > > <htmlform> > <macros> > headerColor =#009d8e > fontOnHeaderColor = white > </macros> > > <style> > .section { > border: 1px solid $headerColor; > padding: 2px; > text-align: left; > margin-bottom: 1em; > } > .sectionHeader { > background-color: $headerColor; > color: $fontOnHeaderColor; > display: block; > padding: 2px; > font-weight: bold; > } > table.baseline-aligned td { > vertical-align: baseline; > } > </style> > > <h2>Vital Sign Entry</h2> > > <section headerLabel="1. Encounter Details"> > <table class="baseline-aligned"> > <tr> > <td>Date:</td> > <td><encounterDate default="now" showTime="true"/></td> > </tr> > <tr> > <td>Location:</td> > <td><encounterLocation default="1"/></td> > </tr> > <tr> > <td>Signature:</td> > <td><encounterProvider default="currentUser"/></td> > </tr> > </table> > </section> > > > <section headerLabel="2. Vital Signs"> > <br /><obs conceptId="5090" labelText="Height (cm):"/> > <br /><obs conceptId="5089" labelText="Weight (kg):"/> > <br /><obs conceptId="5085" labelText="Systolic BP:"/> > <br /><obs conceptId="5086" labelText="Diastolic BP:"/> > <br /><obs conceptId="5088" labelText="Temperature (C):"/> > <br /><obs conceptId="5087" labelText="Pulse:"/> > <br /><obs conceptId="5242" labelText="Respiratory Rate:"/> > <br /><obs conceptId="5092" labelText="SAO2 (%):"/> > > </section> > > <submit/> > > </htmlform> > > > > > -- > Tobin > ________________________________ > Click here to > unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l> > from OpenMRS Developers' mailing list > > ________________________________ > Click here to > unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l> > from OpenMRS Developers' mailing list > > _________________________________________ > > To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to > [email protected] with "SIGNOFF openmrs-devel-l" in the body (not > the subject) of your e-mail. > > [mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l] > _________________________________________ To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [email protected] with "SIGNOFF openmrs-devel-l" in the body (not the subject) of your e-mail. [mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]

