I am writing a BPEL component that interacts with a backend web service that returns an escaped string. This string could be a couple of different types of XML. The header for each xml type is the same. The root element is always a <BATCH> element that contains an TYPE attribute. I need to perform different functions based which type of XML is returned. Is there Java embedded function that will parse the XML for me and return the TYPE attribute value?
What type would Var_XML be? This is were I am having the difficulty. I have used parseXML before to parse a string to a speicified schema type. The problem I am running into is I am trying to determine what type the XML is based on the input. Therefore I do not know what type I would make the Var_XML variable in your example.
That is very easy. Create a canonical schema for your possible result xmls. This canonical should contain all possible combinations of result strings.
Once your canonical schema is ready. You can copy your output variable to corresponding part of your canonical schema.
Just make sure you use proper logic while doing this copy operations in canonical schema otherwise you will get exception.You can use switch activity to identify logical points.