Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to realize external UTF16 / AL16UTF16 xml file into DB XMLTYPE?

403077Jan 4 2004 — edited Jan 5 2004
Hi people,

Happy New Year to all who observe it! :)

DB version 9.2.0.4.
Platforms : Windows 2003 Server, Linux Red Hat 9.0.

We wish to unify our XML processing encoding and due to the use of .Net app servers it would (we suspect) increase our efficiency if we can accept XML as UCS2 / UTF16. [We don't necessarily need to DB process as UTF16 but I imagine it MAY speed our indexing etc performance if we could).

Currently our XML Schema refers to all the standard xsd types which seem to get automatically realized as VARCHAR2s and CLOBs.

Database and user session NLS_LANG are both AMERICA_AMERICAN.UTF8. (Production is likely to be ENGLISH_AUSTRALIA.UTF8)

Can anyone tell me the definitive way to realize an external UTF16 XML file to an XMLType under the above scenario?

My current issue is every time I attempt to load an external UTF16 file with XDB.XDB_UTILITIES.getXML* or getFileContent* [charset=>'AL16UTF16'] I get validation errors akin to

ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00210: expected '<' instead of '

Have I stuffed up? Should we be explicitly coercing all xml schema *CHAR? types as NVARCHAR / NCLOBs (using xdb:SQLType annotations)?

(This doesn't seem like the big issue though because we can't even load the UTF16 XML into a sessional XMLType instance rather than a schema mapped table form).

Does the parser automatically deal with the prefixed byte order mark? Any quick method of slicing it off if the parser doesn't understand? (i.e. How do I efficiently manipulate the CLOBs necessary to remove the BOM? DBMS_LOB.SUBSTR has proved not to be a good solution due to typecasting. Does it have to be DBMS_LOB.COPY to a temporary LOB or some such?)

Any suggestions or commiserations from anyone would be grand...

Thanks,

Lachlan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 2 2004
Added on Jan 4 2004
1 comment
461 views