Forum Discussion
You can place an XML Parser snap at the head of the pipeline to parse the XML request content. To send an XML response back to the client, you’ll need to use an XML Formatter with an unlinked output and clear the ‘Root element’ field so that a separate binary document will be created for every document that flows through the XML Formatter.
@tstack, thanks so much for your input… so I’ve built the following pipeline which successfully executes in Ultra:
In my original pipeline I was passing in a URL parameter which was being captured as a pipeline parameter. In Ultra, I want to capture this pipeline parameter by passing a parameter to the “Pipeline Execute” snap in my pipeline. However, based on the documentation for Ultra… I have two questions:
- Are URL query parameters for an HTTP POST request with an XML payload accessible from within an Ultra pipeline? If so, how are they accessed?
- If the answer is no, then would it be possible to access the binary document’s headers from within the Ultra pipeline? If so how would this be done?
Attached is an example pipeline. Note that you will need to extend the XSD defined for the XML Formatter, but this should solve this request.
Example_XML_attributes_to_elements_2020_06_29.slp (7.8 KB)
Note that you will need to rename the following attachments to remove the “.txt” extension - this was done just so I could upload.
catalog_with_attributes.xsd.txt (762 Bytes) catalog_with_attributes.xml.txt (201 Bytes)- Dhivya_Aroma16 years agoNew Contributor III
Hi KoryKnick,
Thanks for the solution. This worked. I understand that xsd is mandatory for the transformation.
Regards,
Dhivya.
- Dhivya_Aroma16 years agoNew Contributor III
Sorry. Only values are pasted and not the tags.
<catalog> <plant botanical="Sanguinaria canadensis" zone="4" light="Mostly Shady">Bloodroot</plant> <plant botanical="Aquilegia canadensis" zone="3" light="Mostly Shady">Columbine</plant> </catalog>
Thank you for providing your input. Can you also provide an example of your desired output?
- Dhivya_Aroma16 years agoNew Contributor III
This is the expected result
<catalog> <plant> <botanical>Sanguinaria canadensis</botanical> <zone>4</zone> <light>Mostly Shady</light> <plantValue>Bloodroot</plantValue> </plant> <plant> <botanical>Aquilegia canadensis</botanical> <zone>3</zone> <light>Mostly Shady</light> <plantValue>Columbine</plantValue> </plant> </catalog>
Once all the attributes are converted to element the final value of plant (i.e., Columbine) needs the new tag name, like here, I have provided plantValue.