Formatting a XML string
268612Nov 7 2011 — edited Nov 8 2011Hi,
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