Home
Analytics
TextParser.parse("htmlcontent",html) > document.documentElement.innerHTML showing undefi
jiunarayan
<p>Hi All,</p>
<p>I have used Script in onCreate ,</p>
<p> </p>
<div>var textParser=org.eclipse.birt.report.engine.parser.TextParser();</div>
<div> var document=textParser.parse("<p>testing</p>","html");</div>
<div> reportContext.setParameterValue("log","log----"+document.documentElement.innerHTML);</div>
<div> </div>
<div>showing "undefined" in PDF viewer/preview tab.</div>
<div> </div>
<div><span style="color:#0000cd;">How will I convert document back to html string content ?</span></div>
Find more posts tagged with
Comments
JFreeman
<p>I believe the issue here is happening when the TextParser is performing the parsing as the returned document contents are null.</p>
<p> </p>
<p>Could you please provide further details on your requirements and what you are trying to achieve?</p>
jiunarayan
<p>
JFreeman
<p>Would using jquery instead be an option?</p>
<p> </p>
<p>You could do something similar to the following with jquery:</p>
<pre class="_prettyXprint _lang-js">
head.js('http://localhost/js/jquery-2.1.3.js',
done);
function done() {
$(document).ready(function() {
var htmlText = "<html><div id=\"test\"><p>This is paragraph</p><p>This is paragraph2</p></div></html>"
$parsedHtml = $.parseHTML(htmlText);
//do modifications to nodes/elements
alert($($parsedHtml).html());
});
}
</pre>