Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Help with GetDataFromXML

  1. #1

    Default Help with GetDataFromXML

    I am using trying to use GetDataFromXML to parse the following XML which is passed in from a web services component:

    Code:
    <cis:NetworkResponse xmlns:cis="http://www.company.com/information/services">
    	<cis:ReturnCode>SUCCESS</cis:ReturnCode>
    	<cis:ProvisionedDevice>
    		<cis:Type>MultimediaTerminalAdapter</cis:Type>
    		<cis:Make>MOTOROLA CORPORATION</cis:Make>
    		<cis:Model>SBV5220</cis:Model>
    		<cis:SerialNumber/>
    		<cis:DOCSISVersion>2.0</cis:DOCSISVersion>
    		<cis:HardwareVersion>2.0</cis:HardwareVersion>
    		<cis:SoftwareVersion>0.8</cis:SoftwareVersion>
    		<cis:CmMacAddress>00:00:00:00:00:01</cis:CmMacAddress>
    		<cis:CmCOS>service_level_1</cis:CmCOS>
    		<cis:CmAutoDiscovered/>
    		<cis:CmDHCPCriteria>genericCM</cis:CmDHCPCriteria>
    		<cis:CmStatus>ACTIVE</cis:CmStatus>
    		<cis:MtaMacAddress>00:00:00:00:00:02</cis:MtaMacAddress>
    		<cis:MtaCOS>service_level_2</cis:MtaCOS>
    		<cis:MtaFQDN></cis:MtaFQDN>
    		<cis:MtaDHCPCriteria>genericMTA</cis:MtaDHCPCriteria>
    		<cis:MtaNumPorts>2</cis:MtaNumPorts>
    		<cis:MtaStatus>ACTIVE</cis:MtaStatus>
    		<cis:MtaVtns/>
    	</cis:ProvisionedDevice>
    </cis:NetworkResponse>
    In the GetDataFromXML component, I set the Content tab as follows:

    Code:
    Loop XPath: NetworkResponse
    Namspace aware: (checked)
    and the fields tab as:

    Code:
    name: NTWK_RETURN_CODE    xpath: ReturnCode     element: Node     type: String
    name: NTWK_DEVICE_TYPE      xpath: ProvisionedDevice/Type    element: Node     type: String
    But for some reason, none of my fields are being populated and I cannot figure out why... can anyone help please?

    Here are some debugging statements from the component if they are of any help:

    Code:
    2009/06/24 16:18:50 - Get data from XML.0 - data.NAMESPACE: {cis=http://www.company.com/information/services}
    2009/06/24 16:18:50 - Get data from XML.0 - data.NSPath: []
    2009/06/24 16:18:50 - Get data from XML.0 - data.PathValue: /NetworkResponse
    2009/06/24 16:18:50 - Get data from XML.0 - node:
    <cis:NetworkResponse xmlns:cis="http://www.company.com/information/services">
    	<cis:ReturnCode>SUCCESS</cis:ReturnCode>
    	<cis:ProvisionedDevice>
    		<cis:Type>MultimediaTerminalAdapter</cis:Type>
    		<cis:Make>MOTOROLA CORPORATION</cis:Make>
    		<cis:Model>SBV5220</cis:Model>
    		<cis:SerialNumber/>
    		<cis:DOCSISVersion>2.0</cis:DOCSISVersion>
    		<cis:HardwareVersion>2.0</cis:HardwareVersion>
    		<cis:SoftwareVersion>0.8</cis:SoftwareVersion>
    		<cis:CmMacAddress>00:00:00:00:00:01</cis:CmMacAddress>
    		<cis:CmCOS>service_level_1</cis:CmCOS>
    		<cis:CmAutoDiscovered/>
    		<cis:CmDHCPCriteria>genericCM</cis:CmDHCPCriteria>
    		<cis:CmStatus>ACTIVE</cis:CmStatus>
    		<cis:MtaMacAddress>00:00:00:00:00:02</cis:MtaMacAddress>
    		<cis:MtaCOS>service_level_2</cis:MtaCOS>
    		<cis:MtaFQDN></cis:MtaFQDN>
    		<cis:MtaDHCPCriteria>genericMTA</cis:MtaDHCPCriteria>
    		<cis:MtaNumPorts>2</cis:MtaNumPorts>
    		<cis:MtaStatus>ACTIVE</cis:MtaStatus>
    		<cis:MtaVtns/>
    	</cis:ProvisionedDevice>
    </cis:NetworkResponse>
    2009/06/24 16:18:50 - Get data from XML.0 - nodeTypeName: Element
    2009/06/24 16:18:50 - Get data from XML.0 - XPath: ReturnCode
    2009/06/24 16:18:50 - Get data from XML.0 - nodeValue: 
    2009/06/24 16:18:50 - Get data from XML.0 - XPath: ProvisionedDevice/Type
    2009/06/24 16:18:50 - Get data from XML.0 - nodeValue: 
    2009/06/24 16:18:50 - Get data from XML.0 - Read row: [Ljava.lang.Object;@18a3a1d
    Thanks.

    Keith

  2. #2
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    I just tried with your sample data, but using the "Get ..." buttons.

    instead of the "NetworkResponse"

    I got "cis:NetworkResponse" and "cis:ReturnCode" and "cis:ProvisionedDevice/cis:Type"

    But I did get data...

  3. #3

    Default Thanks...

    I thought I tried that and got an error... long day I guess...

    Thanks.

    Keith

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.