Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: How 2 read XML tag and insert into Tables

  1. #1
    Join Date
    May 2013
    Posts
    7

    Default How 2 read XML tag and insert into Tables

    Hi Friends

    I need help. Well I am having xml file and i want to read the tag and insert into table . so please help me out in this regards.
    I am attaching the file also .

    <D1>
    <STUDENT NAME="DEEPAK" MARKS="83" GRADE="A" />
    <STUDENT NAME="MOHAN" MARKS="61" GRADE="B" />
    <STUDENT NAME="DIVAKAR" MARKS="97" GRADE="A" />
    <STUDENT NAME="PRADEEP" MARKS="51" GRADE="C" />
    <STUDENT NAME="SAGAR" MARKS="87" GRADE="A" />
    </D1>



    With Regards

    Mohan K
    Attached Files Attached Files
    Last edited by asktomohan; 02-04-2014 at 01:24 AM.

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    I suggest you read about "Get Data From XML" and "Table Output" for a start.
    So long, and thanks for all the fish.

  3. #3
    Join Date
    May 2013
    Posts
    7

    Default

    Hai,

    Thanks for the reply.
    I want to keep the data from excel into Temp table with the table table has the columns NAME,MARKS,GRADE.

    If it is a normal XML file with closing and ending tags i can port it easily.But the file which i attached is little different.

    Please help me in this.

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Attributes are normal XML, too

    With XLoop = //STUDENT you can read MARKS as shown.

    Name:  GDFX.png
Views: 31
Size:  8.0 KB
    So long, and thanks for all the fish.

  5. #5
    Join Date
    May 2013
    Posts
    7

    Default

    marabu

    Thanks for the help . It replay work.

  6. #6
    Join Date
    May 2013
    Posts
    7

    Default

    Dear marabu

    well i am new requirement. that is i have table xml file by //student and got the marks with @marks
    but in my XML file if I don't ahve //student tag then my job is throuw error.

    my requirement is if i don't have tag with my job should not send me error i should run it.

    Please help me in this regards

    With Regards

    Mohan K

  7. #7
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Did you enable option "Ignore empty file" on tab "Content" of step "Get data from XML"?

    Please, attach a transformation with sample data, if you need further help.
    So long, and thanks for all the fish.

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.