Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Simple XML Data Extract - Please help

  1. #1

    Question Simple XML Data Extract - Please help

    Pentaho Build 5.0.1-stable

    When I preview rows, my field called "URLPayload" contains below for each row:

    The URLPayload field contains this data:
    <data>
    <UrlServiceData ver="1.0">
    <payload>
    <content isUrl="true">iwantthisdata</content>
    </payload>
    <poster>posterdata</poster>
    <background>backgrounddata</background>
    <type>XHTML</type>
    <cacheimages>False</cacheimages>
    <overlaytext>True</overlaytext>
    <showlaunchprompt>True</showlaunchprompt>
    <titles>
    <title>titledata</title>
    </titles>
    <descriptions>
    <description>descriptiondata</description>
    </descriptions>
    </UrlServiceData>
    </data>

    I'm trying to get the data in 'content', and I have the Get XML Data Step configured as such:

    File tab:
    XML Source is defined in a field? Checked
    get XML source from a field - URLPayload

    Content tab:
    Loop XPath - /data/UrlServiceData/payload
    Encoding - UTF-8
    Do not raise an error if no files - Checked

    Fields tab:
    Name XPath Element Result type Type
    content content Node Value of String

    I've tried so many different combinations without luck, can you guys tell me how to get "iwantthisdata" from the content element?

    Thanks,

    Deepak

  2. #2

    Thumbs up Solved

    Quote Originally Posted by deepak.suthar View Post
    Pentaho Build 5.0.1-stable

    When I preview rows, my field called "URLPayload" contains below for each row:

    The URLPayload field contains this data:
    <data>
    <UrlServiceData ver="1.0">
    <payload>
    <content isUrl="true">iwantthisdata</content>
    </payload>
    <poster>posterdata</poster>
    <background>backgrounddata</background>
    <type>XHTML</type>
    <cacheimages>False</cacheimages>
    <overlaytext>True</overlaytext>
    <showlaunchprompt>True</showlaunchprompt>
    <titles>
    <title>titledata</title>
    </titles>
    <descriptions>
    <description>descriptiondata</description>
    </descriptions>
    </UrlServiceData>
    </data>

    I'm trying to get the data in 'content', and I have the Get XML Data Step configured as such:

    File tab:
    XML Source is defined in a field? Checked
    get XML source from a field - URLPayload

    Content tab:
    Loop XPath - /data/UrlServiceData/payload
    Encoding - UTF-8
    Do not raise an error if no files - Checked

    Fields tab:
    Name XPath Element Result type Type
    content content Node Value of String

    I've tried so many different combinations without luck, can you guys tell me how to get "iwantthisdata" from the content element?

    Thanks,

    Deepak
    Figured it out, I changed:
    Content tab:
    Loop XPath - /data/UrlServiceData/payload/content

    Fields tab:
    Name XPath Element Result type Type
    content . Node Value of String

Tags for this Thread

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.