on 2024 Sep 03 7:09 AM
I want to extract 2-attributes from XML. The names of attribute for extraction from this xml is -
ERPNumber,
ProcurementUnit/UniqueName
UniqueName
My XML structures look like this -
<SimplifiedRequest>
<CancelExportRequest>
<OrdHeader_Item>
<item>
<ERPNumber>Y465643</ERPNumber>
<ProcurementUnit>
<UniqueName>6604</UniqueName>
</ProcurementUnit>
<UniqueName>EPT10053-V3</UniqueName>
<VersionNumber>3</VersionNumber>
<custom>
<CustomBoolean name="SuppressOrder">false</CustomBoolean>
<CustomString name="Test"/>
<CustomString name="SupplierID">AEQ600:0000399413</CustomString>
</custom>
</item>
</OrdHeader_Item>
</CancelExportRequest>
</SimplifiedRequest>
Can you help me here?
Request clarification before answering.
Hi Rakesh,
There are multiple ways to achieve your requirement to extract the values as requested.
The simplest among them would be to use a Content Modifier and extract the attribute values to be stored in properties. This can be achieved using creating properties with relevant XPath expressions. We can create three properties by configuring XPaths as below for the Content Modifier
For ERPNumber:
For ProcurementUnit_UniqueName:
For UniqueName (directly under item):
Alternatively, you can use groovy script or XSLT transformation if you have some other extra steps where you want to use the extracted values instead of storing in properties for further usage.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, try:
/SimplifiedRequest/CancelExportRequest/OrdHeader_Item/item/ERPNumber
/SimplifiedRequest/CancelExportRequest/OrdHeader_Item/item/ProcurementUnit/UniqueName
/SimplifiedRequest/CancelExportRequest/OrdHeader_Item/item/UniqueName
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.