0

I am writing a report in Oracle XML Publisher for Application also know as Oracle BI Publisher for Applications (not BI Publisher Professional Edition for BI). My problem is that when developing the data template (attached to the data definition) to specify the SQL needed for the report, there doesn't seem to be a way to add custom xml to the xml output that the data template will produce (other than the output of the SQL).

I would like to add the following code:

<html lang="en">
<meta http-equiv="X-UA-Compatible" content="IE=7" />

as per Why is IE failing to show UTF-8 encoded text?.

This is due to Internet explorer 11 producing Chinese characters instead of the xml output I need to develop my report.

Does anyone know how I can add custom xml to the output produced by the data definition?

Community
  • 1
  • 1
Superdooperhero
  • 7,584
  • 19
  • 83
  • 138

1 Answers1

1

Custom XML

I'd suggest making a custom PL/SQL program that generates the XML. It will not only run faster, but also allow you to do whatever you want with the output. This will require some programming knowledge.

I can't put a complete copy of our program here, but I can give you some pointers:

You would make the program to append XML snippets to a running XML clob.

clob_gen_xml_line := '<?xml version="1.0"?>';
DBMS_LOB.append (clob_genrate_xml, clob_gen_xml_line);

At some point the program will read the clob to make output.

DBMS_LOB.READ (clob_genrate_xml,
amount,
offset,
buffer);
offset := offset + amount;  

FND_FILE.PUT(FND_FILE.output, buffer);

Make sure to free up the memory.

DBMS_LOB.freeTemporary (clob_genrate_xml);

Define an executable in the IT Sysadmin responsibility, method = PL/SQL stored Procedure, make sure to put the correct package.procedure into the executable file name field.

Define a concurrent program, listing the executable you just made. Make sure the output format is XML.

Define a matching data definition. No need to upload an XML/SQL file, since the executable will provide the XML.

Finally, create your template and link to the data definition.

Special Characters

With all of that said, I'm not sure if that will solve your Chinese character problem. It may be related to XML and non UTF-8 characters. There's tons of documentation online for that. But generally, you will want to represent the character with the unicode code point.

Example

To produce: Ampersand and then a copyright symbol

Like: &©

XML should be

<test>&#x0026;&#x00A9;</test>

List of entity references https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

EdHayes3
  • 1,777
  • 2
  • 16
  • 31
  • Thanks. I do often write out custom xml, but mostly I want to use the Oracle data templates. So my question still remains as to how to make the data template output custom xml in addition to the generated xml – Superdooperhero Nov 30 '16 at 08:48
  • Should be able to easily duplicate the SQL of the seeded data definition into custom XML, duplicate the template to use the custom data definition. Its difficult to understand what your actual problem is. What are you expecting in the output? Have you tried the two-byte/special character solution? You can test that by putting that data in the database which the XML is already pulling out. The rendering (in IE, PDF, etc.) should then interpret it correctly. There is a "Character set" configuration in the data definition or template, HTML section. That may be worth looking into. – EdHayes3 Dec 05 '16 at 15:17
  • Do you have a link to more information about "There is a "Character set" configuration in the data definition or template, HTML section" – Superdooperhero Dec 06 '16 at 16:46