Skip to Content
avatar image
Former Member

XSLT mapping to remove parent node

Hello All,

I need to remove parent node from mapping in PI 7.1 version (jdk1.5) . I have tried with java mapping but we do not have lower versions of jdk in our client network. So please help me with XSLT mapping to remove parent node. Below is my test data (marked in bold). from this i need to delete

urn.oc.com:AutomationMonitoring"> and end tag .

<?xml version="1.0" encoding="UTF-8"?> urn.oc.com:AutomationMonitoring"> <ns1:getMessageListResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:rn8="java:sap/standard" xmlns:rn7="urn:java.lang" xmlns:rn6="urn:com.sap.aii.mdt.api.data" xmlns:rn5="http://schemas.xmlsoap.org/soap/encoding/" xmlns:rn4="urn:com.sap.exception" xmlns:rn3="urn:com.sap.aii.mdt.server.adapterframework.ws" xmlns:rn2="urn:com.sap.aii.mdt.api.data.esiext" xmlns:rn1="urn:com.sap.aii.mdt.server.adapterframework.ws.esiext" xmlns:rn0="urn:java/lang" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:AdapterMessageMonitoringVi"> <ns1:Response> <ns2:list xmlns:ns2="urn:com.sap.aii.mdt.server.adapterframework.ws"> <ns2:AdapterFrameworkData> <ns2:cancelable> <ns3:value xmlns:ns3="urn:com.sap.aii.mdt.api.data">asfd</ns3:value> 2 </ns2:cancelable> <ns2:connectionName>asfd</ns2:connectionName> <ns2:credential>****</ns2:credential> <ns2:direction>INBOUND</ns2:direction> <ns2:editable> <ns3:value xmlns:ns3="urn:com.sap.aii.mdt.api.data">true</ns3:value> </ns2:editable> <ns2:endTime>2017-09-01T06:14:16.897-04:00</ns2:endTime> <ns2:endpoint>abcd</ns2:endpoint> <ns2:errorCategory>abcd</ns2:errorCategory> <ns2:errorCode>abcd</ns2:errorCode> <ns2:headers>abcd</ns2:headers> <ns2:interface> <ns3:name xmlns:ns3="urn:com.sap.aii.mdt.api.data">true</ns3:name> <ns3:namespace xmlns:ns3="urn:com.sap.aii.mdt.api.data">abcd</ns3:namespace> </ns2:interface> <ns2:isPersistent>true</ns2:isPersistent> <ns2:messageID>9263d5fd-f103-1ed7-a3df-86a2e2338034</ns2:messageID> <ns2:messageKey>9263d5fd-f103-1ed7-a3df-86a2e2338034\INBOUND\444141350\EO\0\</ns2:messageKey> <ns2:messageType>Recv</ns2:messageType> <ns2:nodeId>123</ns2:nodeId> <ns2:persistUntil>2017-09-11T05:59:15.660-04:00</ns2:persistUntil> <ns2:protocol>XI</ns2:protocol> <ns2:qualityOfService>EO</ns2:qualityOfService> <ns2:receiverInterface> <ns3:name xmlns:ns3="urn:com.sap.aii.mdt.api.data">abcd</ns3:name> <ns3:namespace xmlns:ns3="urn:com.sap.aii.mdt.api.data">abcd</ns3:namespace> </ns2:receiverInterface> <ns2:receiverName>abcd</ns2:receiverName> <ns2:receiverParty> <ns3:agency xmlns:ns3="urn:com.sap.aii.mdt.api.data">http://sap.com/xi/XI</ns3:agency> <ns3:name xmlns:ns3="urn:com.sap.aii.mdt.api.data"/> <ns3:schema xmlns:ns3="urn:com.sap.aii.mdt.api.data">XIParty</ns3:schema> </ns2:receiverParty> <ns2:restartable> <ns3:value xmlns:ns3="urn:com.sap.aii.mdt.api.data">true</ns3:value> </ns2:restartable> <ns2:retries>3</ns2:retries> <ns2:retryInterval>300000</ns2:retryInterval> <ns2:scheduleTime>2017-09-01T06:14:16.642-04:00</ns2:scheduleTime> <ns2:senderInterface> <ns3:name xmlns:ns3="urn:com.sap.aii.mdt.api.data">abcd</ns3:name> <ns3:namespace xmlns:ns3="urn:com.sap.aii.mdt.api.data">abcd</ns3:namespace> </ns2:senderInterface> <ns2:senderName>abcd</ns2:senderName> <ns2:senderParty> <ns3:agency xmlns:ns3="urn:com.sap.aii.mdt.api.data">http://sap.com/xi/XI</ns3:agency> <ns3:name xmlns:ns3="urn:com.sap.aii.mdt.api.data"/> <ns3:schema xmlns:ns3="urn:com.sap.aii.mdt.api.data">XIParty</ns3:schema> </ns2:senderParty> <ns2:sequenceNumber>0</ns2:sequenceNumber> <ns2:serializationContext/> <ns2:startTime>2017-09-01T05:59:15.660-04:00</ns2:startTime> <ns2:status>systemError</ns2:status> <ns2:timesFailed>4</ns2:timesFailed> <ns2:transport>HTTP</ns2:transport> <ns2:version>0</ns2:version> <ns2:wasEdited> <ns3:value xmlns:ns3="urn:com.sap.aii.mdt.api.data">false</ns3:value> </ns2:wasEdited> </ns2:AdapterFrameworkData> </ns2:list> <ns2:number xmlns:ns2="urn:com.sap.aii.mdt.server.adapterframework.ws">2</ns2:number> <ns2:warning xmlns:ns2="urn:com.sap.aii.mdt.server.adapterframework.ws">false</ns2:warning> </ns1:Response> </ns1:getMessageListResponse> </ns0:MT_SetData>

Thanks in Advance

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Sep 27, 2017 at 06:38 PM

    Try this.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 27, 2017 at 09:34 AM

    Hi Swetha,

    The J2SE 5.0 JDK can be found in the Java archives page. :)

    Regards,

    Mark

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 27, 2017 at 10:01 AM

    Hi Swetha!

    And why not just to set compiler compliance level in NWDS (Eclipse) project's properties?

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 27, 2017 at 10:49 AM

    For XSLT the below code should help you.

    <?xml version="1.0" encoding="UTF-8"?>
    urn.oc.com="http:test" xmlns:ns0="http:test" xmlns:xsl=" http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:rn8="java:sap/standard" xmlns:rn7="urn:java.lang" xmlns:rn6="urn:com.sap.aii.mdt.api.data" xmlns:rn5="http://schemas.xmlsoap.org/soap/encoding/" xmlns:rn4="urn:com.sap.exception" xmlns:rn3="urn:com.sap.aii.mdt.server.adapterframework.ws" xmlns:rn2="urn:com.sap.aii.mdt.api.data.esiext" xmlns:rn1="urn:com.sap.aii.mdt.server.adapterframework.ws.esiext" xmlns:rn0="urn:java/lang" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:AdapterMessageMonitoringVi" xmlns:ns2="urn:com.sap.aii.mdt.server.adapterframework.ws">
    <xsl:template match="@* | node()">
    <xsl:copy>
    <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
    </xsl:template>
    urn.oc.com:AutomationMonitoring">
    <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="ns0:MT_SetData">
    <xsl:apply-templates/>
    </xsl:template>
    </xsl:stylesheet>

    Define xmlns:urn.oc.com and ns0 as per the requirement I just kept it as test.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2017 at 11:04 AM

    Thanks Manoj.

    XSLT code works fine which is given by you.

    Add comment
    10|10000 characters needed characters exceeded