HTML2FO not working in BI Publisher to convert HTML stored in CLOB to rendered HTML in RTF - bi-publisher

I'v using BI Publisher Desktop Template Viewer, and BI Publisher Enterprise to render HTML stored in the database as formatted HTML, and I'm not getting any output for the HTML field when using html2fo
I'm storing HTML in a CLOB field in the database.
To select into the XML I'm using something like this per Oracle's documentation:
SELECT '<![CDATA' || '['|| CLOB1 || ']' || ']>' as HTML
FROM TABLE1
I'm getting what I expect in the XML output. Field has the CDATA wrapper, and is HTML.
I've tried this in my RTF and output for that field is blank.
<?html2fo: HTML?>
I've also tried these, no difference.
<?HTML2FO: HTML?> --function in upper case
<?HTML2FO:HTML?> --no space, function in upper case
<?html2fo:HTML?> --no space, function in lower case
When I just used this, I see the raw CDATA/HTML
<?HTML?>
Any idea what I could be doing wrong here? Thanks.

There is an option/setting for CLOB fields in the data diagram, when configuring the how the data is selected. Default option is CLOB, and the other option is XML.
Different versions of BI Publisher will display this option differently. Here is from Oracle documentation, and then from the version I'm using.
If CLOB is selected, the data will be HTML escaped, and tags will change from < to <
Option 1
Keep the CLOB type, and remove the CDATA tag insertion from the select statement.
Option 2
Change to XML type, and keep the CDATA tag insertion in the select statement.

Related

How to save the code and the formatting properties of ace editor to the database in Rails

The value in the editor is formatted only on the client side but when the value is sent to the database it is saved without the formatting.
How to save both the code and the formatting properties so that they both can be retrieved during display of the code snippet
Are you using raw action? If not, then read it.
I was using another editor (probably codemirror) and I saved the text in it to database in <pre> </pre> tag and then it would save as a string of html but later render properly too. Go through documentation of ace-editor. It must have a similar solution.
pre tag gives me this here:
Gems for ace-editor:
gem 'jquery-ace-rails'
gem 'ace-rails-ap'

Why is my Rails app on Heroku soemtimes displaying apostrophes as HTML entities?

Sometimes we have jobs whose name has an apostrophe in it. I always want those apostrophes to display as ' , never as their HTML entity (').
The apostrophe displays correctly on most pages most of the time. But in some instances, the apostrophe displays as the HTML entity instead. Here's a screen-capture showing the behavior:
The apostrophes in the "Notes" field (a textarea) display correctly, but not in the "Job name" and "Display as" fields. Luckily, the apostrophes display correctly on the public-facing side, and I only see this behavior on the admin-side.
This sentence is going to sound insane, but stick with me, here: When I look at a page's source code where this problem occurs, it looks like the leading ampersand in the apostrophe's html entity is being replaced with the HTML entity for ampersand, thus becoming &#x27;
Here's a gist of the form's code.
When I look up this job's record in console, the job name and display name are "Job's Got An Apostrophe", so I know (think?) I'm not storing the HTML entity in my database. My database.yml specifies unicode encoding. It's a PostgreSQL 9.2.7 database. Not sure what other information is needed to help resolve this, if any.

For variables names for text components ending with a dot(.) , itextpdf appends .widget to them

For variable names that i am declaring using pdf expro, having dot(.) character at the end, the itext is appending "Widget" to them. IF my variable name on pdf template for a textbox is "Payment transaction no." then itextpdf makes it as "Payment Transaction No.Widget"
Why does this happen ? and suggestions about handling it, because as a part of data validation i need to pick up pdf field names and validate them with those saved in form configuration settings in the database.
Is there any other such kind of wierd possibility that might occur ? Please provide those cases.

Safely display html encoded values in Rails

Assuming I have the following string:
Frozen Synapse – A Business Mini-Postmortem!
Is there a way to white list specific html encoded values or should I just perform:
string.gsub('–', '-')
to produce the desired output in an HTML view:
Frozen Synapse – A Business Mini-Postmortem!
Edit: there may be other html in the string that I don't want to allow. I want to white list certain html encoded characters (like a dash).
You can use the html_safe method in your view. E.g.
<%="Frozen Synapse – A Business Mini-Postmortem!".html_safe%>

How do I remove HTML from the SAS URL access method?

What is the most convenient way to remove all the HTML tags when using the SAS URL access method to read web pages?
This should do what you want. Removes everything between the <> including the <> and leaves just the content (aka innerHTML).
Data HTMLData;
filename INDEXIN URL "http://www.zug.com/";
input;
textline = _INFILE_;
/*-- Clear out the HTML text --*/
re1 = prxparse("s/<(.|\n)*?>//");
call prxchange(re1, -1, textline);
run;
I think the methodology is not to remove the HTML from the page, but identify the standard patterns for the data you are trying to capture. This is the perl / regular expressions type methodology.
An example might be some data or table that comes so many characters after the logo image. You could write a script to keep only the data.
If you want to post up some html, maybe we can help decode it.

Resources