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!

select XMLElement - want some whitespace or newlines!

470756Nov 21 2005 — edited Nov 23 2005
Hi -

I'm using XML SQL psuedo functions to make an XML document. It's making valid XML, but it's hideous to read. The SQL select is actually a select ... into in a PL/SQL function. Is there any way to force some newlines or spaces after the end tags, so the message would be more readable in a text editor?

EXAMPLE:
SELECT XMLElement("OBSERVATION-DATA",
XMLAttributes('http://www.w3.org/2001/XMLSchema-instance' AS "xmlns:xsi",
'C:\Documents and Settings\rmercer\My Documents\Rick\projects\LAPHIN\Maps\canonical_v2\canonical_lab_v3.xsd' AS "xsi:noNamespaceSchemaLocation"),
XMLForest(
XMLForest(
c_SOURCEEXT as "SOURCE-IDENT",
c_SOURCEROOT as "SOURCE-ROOT",
c_SOURCEEXT as "SOURCE-FACILITY-IDENT",
c_SOURCEROOT as "SOURCE-FACILITY-ROOT",
) as "SOURCE-INFORMATION", -- end of source info forest
XMLForest(
XMLConcat( XMLElement("PERSON-ID-NUMBER", MPERSON.PERSON_UID),
.....
) -- end of main forest
) into v_OBSXML
FROM nbs_msgine.msgin_person MPERSON,
......

GIVES A REALLY LONG LINE OF OUTPUT:
<SOURCE-INFORMATION><SOURCE-IDENT>LABCORP</SOURCE-IDENT><SOURCE-ROOT>999.5.1.2.1</SOURCE-ROOT><SOURCE-FACILITY-IDENT>LABCORP</SOURCE-FACILITY-IDENT><SOURCE-FACILITY-ROOT>999.5.1.2.1</SOURCE-FACILITY-ROOT><RECVR-IDENT>LADOH</RECVR-IDENT><RECVR-ROOT>999.5.1.1.5</RECVR-ROOT><RECVR-FACILITY-IDENT>LADOH</RECVR-FACILITY-IDENT><RECVR-FACILITY-
.......

Thanks!
Andy Russo
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 21 2005
Added on Nov 21 2005
3 comments
957 views