How can I convert HTML to PL/SQL?

Viewed 116

How would I convert this HTML code to PL/SQL ?

<div class='hsftic_cui_banner' style='text-align:center;margin:auto;width:35%;z- 
index:2147483647; padding: 7px;background-color: #ff9800;color: white;'><span 
class='cui_closebtn' style='margin-left: 15px;color: white;font-weight: bold;float: 
right;font-size: 18px;line-height: 20px;cursor: pointer;transition: 0.3s;' 
onclick="this.parentElement.style.display='none';">&times;</span><strong>System contains 
Controlled Unclassified Information (CUI)</strong></div>

There are two ways to generate the code; one uses HTP.PRINT calls before each line in the source, the other concatinates the calls by piping ('||') the separate lines of HTML together. How this differs is seen when the HTML is rendered by modplsql.

Cant seem to figure out the exact conversion.

1 Answers

I assume your question is how you can generate this html in pl/sql using mod_plsql or ords?

html itself does not care about lines and this is just something that you use to make your html source code more readable.

If you want to generate individual lines in the generated html you will either have to use htp.p instead of htp.print or append a newline at the end of each line.

Generally speaking it does not matter:

  • use a single htp.p for all the html
  • use a single htp.p for concatenated lines html
  • use multiple htp.p for each "line" of html

Purely for performance reasons you should use as few htp calls as possible and generate as little html (no newline) as possible.

Related