Skip to Main Content

SQL & PL/SQL

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!

Formatting a XML string

268612Nov 7 2011 — edited Nov 8 2011
Hi,

Can anyone help please.
I have an XML string held in a CLOB. I want to convert it to either another CLOB or a VARCHAR2
but with the necessary indents and line feeds to make it readable.

E.g. This is just a small part of the CLOB value
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header><ns0:StandardHeader xmlns:ns0="http://find.org.uk"><ns0:RequestingInstitution>555</ns0:RequestingInstitution><ns0:OwningMemberNumber>555</ns0:OwningMemberNumber><ns0:ManagingMemberNumber>555</ns0:ManagingMemberNumber><ns0:CurrentUser>27852</ns0:CurrentUser><ns0:SchemaVersion>2-00</ns0:SchemaVersion></ns0:StandardHeader></env:Header></env:Envelope>

to be formatted as:-
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header>
<ns0:StandardHeader xmlns:ns0="http://find.org.uk">
<ns0:RequestingInstitution>555</ns0:RequestingInstitution>
<ns0:OwningMemberNumber>555</ns0:OwningMemberNumber>
<ns0:ManagingMemberNumber>555</ns0:ManagingMemberNumber>
<ns0:CurrentUser>27852</ns0:CurrentUser>
<ns0:SchemaVersion>2-00</ns0:SchemaVersion>
</ns0:StandardHeader>
</env:Header>
</env:Envelope>

Please Note - The post seems to have lost the indentation in the formatted example above.

Thanks

Edited by: CitizenChad on Nov 7, 2011 1:17 PM

Edited by: CitizenChad on Nov 7, 2011 1:19 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 6 2011
Added on Nov 7 2011
5 comments
470 views