Jump to content

search xml document that has an unknown structure


S Simm

Recommended Posts

I have a process with an xml document in the form of a string as input. I would like to convert this string to xml and then search the contents using xpath expressions. (specifically I'm looking for elements with a specific name)

The problem is that the xml document could be any xml, so I don't have a xml schema for it.

Is this possible If so, how Everything xml related seems to want an XML Schema.

thanks, much obliged!

Link to comment
Share on other sites

You could use the Parse XML activity with XML validation disabled but it would be difficult to do anything with the resulting structure.

A basic approach would be to use the XPATH functions substring-before / substring-after to extract the values of the XML tags that you are looking for (it would work if you have a limited number of tags).

Another approach would be to use an XSLT transformation (with the XSLT transform activity).

You may also use an XML Any structure to handle the incoming string and then use Coercion in later Mappings.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...