28.10.08

Adding encoding -processing Instruction to XML When Using File Adapter

By default when using Oracle File Adapter to produce XML documents, no encoding="<charset>" attribute is used in the <?xml version="1.0"?> processing instruction.

Default PI:

<?xml version="1.0" ?>

and wanted PI:

<?xml version="1.0" encoding="UTF-8" ?>

 

The way to make this work (at least in 10.1.3.4) is to update the XML schema to include two new options in the schema definition.

           xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
           nxsd:encoding="UTF-8">

So, adding these attributes will make the schema look like:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.fi.oracle.com/harri.kaukovuo"
           elementFormDefault="qualified" attributeFormDefault="unqualified"
           xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
           nxsd:encoding="UTF-8">
<xs:element name="ORDERS">
...

</xs:element>

</xs:schema>

No comments: