Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Get Data from XML

  1. #1
    Join Date
    Apr 2008
    Posts
    1,771

    Question Get Data from XML

    Hi.
    I am trying to get some data from an xml file and I'm struggling to extract one little bit of info.
    I am using "Get data from xml" step and I had a look at the samples, but still cannot find a solution.

    The xml looks like:
    </osgb:queryExtent>
    <osgb:topographicMember>
    <osgb:TopographicArea fid='osgb1000000042000683'>
    <osgb:featureCode>10056</osgb:featureCode>
    <osgb:version>11</osgb:version>
    <osgb:versionDate>2008-11-18</osgb:versionDate>
    <osgb:theme>Land</osgb:theme>
    <osgb:calculatedAreaValue>6741.446944</osgb:calculatedAreaValue>
    <osgb:changeHistory>
    <osgb:changeDate>2001-02-01</osgb:changeDate>
    <osgb:reasonForChange>New</osgb:reasonForChange>
    </osgb:changeHistory>

    The part in bold is what I cannot extract.
    I can get the feature code, the version, version date, theme and so on, but not the fid long number.
    In my "Get data from XML" I selected as a path "/osgb:FeatureCollection/osgb:topographicMember/osgb:TopographicArea".

    Any suggestions?
    Thanks.
    -- Mick --

  2. #2
    Join Date
    Dec 2009
    Posts
    609

    Default

    Hi Mick,

    wast there something about @fid to get the Attribute instead of the value inside the element?
    (untested)

    HTH,

    Tom
    Also known as "_TomS_" on IRC (##pentaho and ##saiku)
    Feeling curious? Visit my blog on http://me-myself-and-it.blogspot.de/

  3. #3
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    Hi Tom.
    wast there something about @fid to get the Attribute instead of the value inside the element?
    I'm sorry but I don't really understand what you mean

    I have uploaded 2 screenshots.
    One shows the Get Data from XML setting, the other one shows a preview of the data.

    I can see every info, but not the "osgb:TopographicArea fid", therefore my guess is that I have to use some smart script or something.. but I haven't got any idea on how to do that

    Just to expand a bit on my issue: for each XML file there are multiple osgb:TopographicArea fid and I need to get each of them with their associated data.
    Attached Images Attached Images   
    -- Mick --

  4. #4
    Join Date
    Dec 2009
    Posts
    609

    Default

    Hi Mick,

    could you provide a sample-snippet of the whole XML structure/data?
    Or is this confidential-data which must not be shared?

    Tom
    Also known as "_TomS_" on IRC (##pentaho and ##saiku)
    Feeling curious? Visit my blog on http://me-myself-and-it.blogspot.de/

  5. #5
    Join Date
    Dec 2009
    Posts
    609

    Default

    Hi Mick,

    no worries, I figured a sample from your first post.
    Have a look here:
    http://screencast.com/t/C59jdFfKWkYT

    Hope this helps,

    Tom
    Also known as "_TomS_" on IRC (##pentaho and ##saiku)
    Feeling curious? Visit my blog on http://me-myself-and-it.blogspot.de/

  6. #6
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    Hi Tom,
    you're a genius :-)

    It's working like a charm, thanks.
    -- Mick --

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.