I need to convert XML inside CDATA XML using a single XSLT.
I have XML, as shown below, with xml inside CDATA, as in the following xml.
<message channel-id="e01db0aa-b3db-4b6c-a055-7a0d5c1d1f20" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > <send-parameters> <agent-parameter multi-valued="false"> <name>Networks</name> <value><![CDATA[<Networks> <Network> <GroupCode>EXTPRI</GroupCode> <NetworkTypeId>LANI</NetworkTypeId> <OrgNetworkPlatformName>EON-0cbu0cust12301dcd-D-PCL-0002</OrgNetworkPlatformName> <OrgNetworkPlatformID>urn:vcloud:network:b7ccfd5f-cfd7-48eb-9dd6-1989b08d7b86</OrgNetworkPlatformID> </Network> <Network> <GroupCode>EXTPRI</GroupCode> <NetworkTypeId>LANI</NetworkTypeId> <OrgNetworkPlatformName>ABC-0cbu0cust12301dcd-D-PCL-XYZ</OrgNetworkPlatformName> <OrgNetworkPlatformID>urn:vcloud:network:b7ccfd5f-cfd7-48eb-9dd6-1989b08d7b86</OrgNetworkPlatformID> </Network> </Networks>]]></value> </agent-parameter> </send-parameters> </message>
I need to convert xml to:
<?xml version="1.0" encoding="UTF-8"?> <message xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" channel-id="7652d759-4b32-44d4-8a27-9e390f0cae7b"> <send-parameters> <agent-parameter multi-valued="false"> <name>ExternalPublicOrgNWPlatformID_DDC</name> <value>EON-0cbu0cust12301dcd-D-PCL-0002</value> </agent-parameter> <agent-parameter multi-valued="false"> <name>ExternalPublicOrgNWPlatformID_DS</name> <value>ABC-0cbu0cust12301dcd-D-PCL-XYZ</value> </agent-parameter> </send-parameters> </message>
This is an example of the output that I gave, it will contain several nodes inside the xml that I need to go through and generate the XML output file.
I use xslt, directing xpath to node inside the cdata of the original xml. but it is empty because it was not in a tree structure format.
I can not get the X-Path for xml inside CDATA. It works well if I delete CDATA in xml, but xml is sent from an external system that cannot be modified.
I can not use multiple xslts I need to apply one XSLT.
Could you offer me this.
Thank you very much pending ..
source share