Skip to Main Content

Integration

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!

How do I parse root tag of XML string within XML element?

3428679Jul 22 2017 — edited Jul 26 2017

I have been struggling for a few days.  I have an element in /UniversalInterchange/Body that is an ANYTYPE.  I can change my XSD to have /UniversalInterchange/Body as a string if needed.  However, I have an application that is embedding well formed XML string in the body of an Interchange envelope, and this XML string can have different root Elements.  In the below the root element of the XML string is UniversalShipment, but there will be instances where it will be UniversalEvent, NativeOrganization, or others.  This message is coming from my ERP system but the body of the Interchange needs to be extracted, and the root element of the body needs to be

verified, so I can run a mediator or and if statement in my bpel process and do different things depending on the root element of the well formed xml string embedded in the XML node /UniversalInterchange/Body.

I am struggling to use parseescapedxml, parsexml, assign activities, and xslt's correctly.

I have the schemas for all the different variations of the XML string coming from the Body, but I need to know which one to use, which is why I need to get the data first so I can pass the xml string to the proper xsd.  Any suggestions?

<?xml version="1.0" encoding="utf-8"?><UniversalInterchange xmlns="http://www.ABC.com/Schemas/Universal/2011/11" version="1.1">

  <Header>

    <SenderID>ABC</SenderID>

    <RecipientID>123</RecipientID>

  </Header>

  <Body>This is of Anytype in XSD.  I can change it to string type if needed

    <UniversalShipment xmlns="http://www.cargowise.com/Schemas/Universal/2011/11" version="1.1">

  <Shipment>

.

.

.

</Shipment>

</UniversalShipment>

</Body>

This post has been answered by Martien van den Akker on Jul 24 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 23 2017
Added on Jul 22 2017
10 comments
941 views