Pentaho

 View Only

 Get Data from XML step help

  • Pentaho
  • Kettle
  • Pentaho
Ryan Nicosia's profile image
Ryan Nicosia posted 08-27-2021 17:08

I'm needing to pull out IP Address and Name from the following XML using the Get Data from XML step but can't figure it out. Since both values are at the same level, what do do do for xpath to get both values out into a single row / 2 columns for this server?

 

<RESTXMLResponse>

<PropertySetClassChildrenResponse>

<PropertySetClassChildren>

<PropertySetClasses totalCount="0"/>

<PropertySetInstances totalCount="1">

<PropertySetInstance name="testserver.test.com_Instance" description="" type="/type/PropertySetClasses/SystemObject/ADMIN/SERVER_PROPERTY" dbKey="DBKey:SPropertySetInstanceModelKeyImpl:26108311-26108311" objectId="DBKeyObjectId:2654033:26108311" uri="/id/SystemObject/ADMIN/SERVER_PROPERTY/DBKeyObjectId:2654033:26108311" modelType="PROPERTY_SET_INSTANCE" modelTypeId="5319">

<PropertyValues totalCount="2">

<PropertyValue name="IP_ADDRESS" type="String" uri="/id/SystemObject/ADMIN/SERVER_PROPERTY/DBKeyObjectId:2654033:26108311/PropertyValues/IP_ADDRESS" value="192.168.0.1"/>

<PropertyValue name="NAME" type="String" uri="/id/SystemObject/ADMIN/SERVER_PROPERTY/DBKeyObjectId:2654033:26108311/PropertyValues/NAME" value="testserver.test.com"/>

</PropertyValues>

</PropertySetInstance>

</PropertySetInstances>

<Groups totalCount="0"/>

</PropertySetClassChildren>

</PropertySetClassChildrenResponse>

</RESTXMLResponse>

 

Current Loop Xpath: RESTXMLResponse/PropertySetClassChildrenResponse/PropertySetClassChildren/PropertySetInstances/PropertySetInstance/PropertyValues/PropertyValue

 

I've tried different variations of Xpath and Loop Xpaths but can't get it to output. I need one row that shows the Name and IP address

 

 

Ryan Nicosia's profile image
Ryan Nicosia

Capture