Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: how to pass parameters in xsl step in a job

  1. #1
    Join Date
    Nov 2016
    Posts
    9

    Default how to pass parameters in xsl step in a job

    Hello,

    I'm trying to pass parameters in a xsl step
    My job
    Name:  job.JPG
Views: 128
Size:  19.9 KB
    the xsl transformation
    Name:  xsl1.jpg
Views: 115
Size:  26.4 KB
    Name:  xsl2.jpg
Views: 97
Size:  25.5 KB
    the way I try to get parameters values in the xsl file
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        version="2.0" >
        <xsl:output indent="no" cdata-section-elements="data" />
        <xsl:param name="idSite" />
        <xsl:param name="pathToCSV" select="'FichierCSV.csv'"/>
          <xsl:template match="/">
                  <group id="{$idSite}" file="{$pathToCSV}" />
         </xsl:template>
    </xsl:stylesheet>
    the $idSite value come from the previous step by a set Variable Valid in the parent job.
    And I get the correct value in the Simple evaluation
    but in xml I get the values
    Code:
    <group id="" file="FichierCSV.csv" />
    Can someone explain to me how to pass these parameters to the xsl file.
    I really appreciate any help you can provide.

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

    Default

    I think that your "name" and "value" in the parameter panel are not correct.
    For value you should use the actual value, not the parameter.
    -- Mick --

  3. #3
    Join Date
    Nov 2016
    Posts
    9

    Default

    Thanks for your answer.
    The actual value is in a variable idSite.
    Name:  simple evaluation.JPG
Views: 94
Size:  35.9 KB
    I can get its value in step Simple evaluation
    how should I write it in the parameter panel to use the variable as value
    if I replace ${idSite} by 123456 that doesn't change anything
    Last edited by katwes; 03-03-2017 at 06:30 AM.

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

    Default

    Quote Originally Posted by katwes View Post
    how should I write it in the parameter panel to use the variable as value
    Easy.

    You enter parameter names in the column titled "Value".
    Of course, the variable references must go into the "Name" column.
    So long, and thanks for all the fish.

  5. #5
    Join Date
    Nov 2016
    Posts
    9

    Default

    thanks a lot, it works.
    That means that the columns title are switched ?

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

    Default

    Yes.

    Never trust names ...
    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.