Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: XML input step

  1. #1
    samatar hassan Guest

    Default XML input step

    Hello all,

    This day, i worked on XML input step.
    The goal is to loop on a specified node and then extract path.

    The number of rows is the number of occurence found.

    I made some (simple) tests on the following file :

    <?xml version="1.0" encoding="UTF-8"?>
    <Rows>
    <Row><Nom>Hassan</Nom><Prenom>sam</Prenom><Age>29</Age></Row>
    <Row><Nom>Hassan</Nom><Prenom>Isaac</Prenom><Age>3</Age></Row>
    <Row><Nom>Hassan</Nom><Prenom>Emilie</Prenom><Age>25</Age></Row>
    <Row><Nom>Hassan</Nom><Prenom>Souleyman</Prenom><Age>1</Age></Row>
    </Rows>

    Image we want to get the Name, Prenom (First name) and age like :

    Nom | Prenom | Age
    -------------------------
    Hassan | sam | 29
    Hassan | Isaac | 3
    Hassan | Emilie | 25

    Hassan | Souleyman | 1

    You have just to define :

    - Loop XPath = Rows/Row

    and fields :

    - Name XPath Type
    Col1 Nom String
    Col2 Prenom String
    Col3 Age Integer

    I also made all vars env sensible.

    The process is simple bur powerfull.
    I attached the code (for the moment it's an update of the XML input)

    I will probably create another XML input step ( Too many XML step ??? :-) )

    I attached the sample transformation and the sample XML file.

    Rgds

    Samatar HASSAN








    ___________________________________________________________________________
    D

  2. #2
    Matt Casters Guest

    Default RE: XML input step

    Dear Samatar,

    That sounds great. However, if it's not backward compatible (and it is
    probably not), you should not be changing the existing step.
    Call it XML Input XPath or something and give it a different ID.

    All the best,

    Matt


    _____

    From: kettle-developers (AT) googlegroups (DOT) com
    [mailto:kettle-developers (AT) googlegroups (DOT) com] On Behalf Of samatar hassan
    Sent: Sunday, May 20, 2007 5:31 AM
    To: kettle-developers (AT) googlegroups (DOT) com
    Subject: XML input step


    Hello all,
    <file:///C:/DOCUME%7E1/Aniga/LOCALS%7E1/Temp/moz-screenshot.jpg>
    This day, i worked on XML input step.
    The goal is to loop on a specified node and then extract path.

    The number of rows is the number of occurence found.

    I made some (simple) tests on the following file :

    <?xml version="1.0" encoding="UTF-8"?>
    <Rows>
    <Row><Nom>Hassan</Nom><Prenom>sam</Prenom><Age>29</Age></Row>
    <Row><Nom>Hassan</Nom><Prenom>Isaac</Prenom><Age>3</Age></Row>
    <Row><Nom>Hassan</Nom><Prenom>Emilie</Prenom><Age>25</Age></Row>
    <Row><Nom>Hassan</Nom><Prenom>Souleyman</Prenom><Age>1</Age></Row>
    </Rows>

    Image we want to get the Name, Prenom (First name) and age like :

    Nom | Prenom | Age
    -------------------------
    Hassan | sam | 29
    Hassan | Isaac | 3
    Hassan | Emilie | 25
    Hassan | Souleyman | 1

    You have just to define :

    - Loop XPath = Rows/Row

    and fields :

    - Name XPath Type
    Col1 Nom String
    Col2 Prenom String
    Col3 Age Integer

    I also made all vars env sensible.

    The process is simple bur powerfull.
    I attached the code (for the moment it's an update of the XML input)

    I will probably create another XML input step ( Too many XML step ??? :-) )

    I attached the sample transformation and the sample XML file.

    Rgds


    Samatar HASSAN


    _____

    Ne gardez plus qu'une seule adresse mail ! Copiez vos mails
    <http://www.trueswitch.com/yahoo-fr/> vers Yahoo! Mail



    --~--~---------~--~----~------------~-------~--~----~
    You received this message because you are subscribed to the Google Groups "kettle-developers" group.
    To post to this group, send email to kettle-developers (AT) googlegroups (DOT) com
    To unsubscribe from this group, send email to kettle-developers-unsubscribe (AT) g...oups (DOT) com
    For more options, visit this group at http://groups.google.com/group/kettle-developers?hl=en
    -~----------~----~----~----~------~----~------~--~---

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.