Pentaho

 View Only
  • 1.  How do I create XML with a dynamic parent element?

    Posted 02-03-2024 12:21

    I'm using the Save XML step and I am trying to use a parameter as the value for the "Row XML element" field, but this does not seem to work.  When I enter "${LoaderParentType}" as the value for this field, the generated xml has a row node that looks like this: <${LoaderParentType}>. How can I make this node name dyanmic? Thanks. 

     



    ------------------------------
    Josh Howe
    Systems Engineer
    SS&C Technologies
    ------------------------------


  • 2.  RE: How do I create XML with a dynamic parent element?

    Posted 02-05-2024 08:49

    Hi Josh,

    pls could you provide screen of step settings? IMHO this is not possible in step, only via trans injection.



    ------------------------------
    Petr Prochazka
    Systems Engineer
    P.V.A. systems s.r.o.
    ------------------------------



  • 3.  RE: How do I create XML with a dynamic parent element?

    Posted 02-05-2024 09:17
    Thanks Petr. Screenshot is below. I am new to Pentaho, and I'm sorry but I don't follow you regarding trans injection. If the below is impossible, which step type should I use to create XML with a dynamic row tag name? 


    ------------------------------
    Josh Howe
    Systems Engineer
    SS&C Technologies
    ------------------------------



  • 4.  RE: How do I create XML with a dynamic parent element?

    Posted 02-05-2024 09:35

    This field is not dynamic, so you can not use property for name.

    You can create variants of XML Output and write data by specific step. Add this variable to stream via Add variables step and choose flow via ex. Swtich / case step.

    Or use metadata injection, see ex. Metadata injection - read a CSV file.ktr in samples/transformations dir.



    ------------------------------
    Petr Prochazka
    Systems Engineer
    P.V.A. systems s.r.o.
    ------------------------------