Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: ETL Documentation using XSLT

  1. #1
    Join Date
    May 2008

    Default ETL Documentation using XSLT


    I just want to share this idea and hopefully the community can develop it further.

    I needed a way to document the ETL in kettle for ktr and kjb files in a way that it generates HTML files to be printed.

    I found the easy way is to use xslt transforms on ktr and kjb files.

    The steps are...
    1. Copy your ktr kjb files to a new folder "doc"
    2. Copy the attached xslt files into the doc folder
    3. Use a script to insert this line right after the <?xml> tag (line 1)
    <?xml-stylesheet type="text/xsl" href="kettle_job_xslt.xml"?> for kjb
    <?xml-stylesheet type="text/xsl" href="kettle_trans_xslt.xml"?> for ktr
    4. Use any browser and open each kjb/ktr

    1. I am new to XML/XSLT. I use treebeard to edit and debug the XSLT file.

    2. Is it possible for spoon to ignore <?xml-stylesheet> tag when it opens a kjb or ktr file?
    If it is possible to ignore it, then we do not need to copy the ktr/kjb files into a separate folder.
    The xslt specs filename can be embedded in the kjb/ktr files.
    It would be great if the transformation setting or Job setting can add a field on the xslt filename and insert the transformation line when it writes the XML in KJB and KTR.

    3. Is there a way to create a diagram renderer?
    In a folder with all the kjb/ktr files, run a renderer and it opens each file and generate the jpeg of the diagram for each file.

    Attached Files Attached Files

  2. #2
    Join Date
    Aug 2007

    Default It rocks!

    Dear Herman,

    I've tested your idea and it's great! I've already sent it around to some coworkers and they loved it, too! Thank a lot for your kindness to share it, it is of great value for us.

    Best regards,

    Fábio de Salles
    (Pentaho Project - Now going after those Z/90 Adabas bases!!!)
    São Paulo - Brasil

  3. #3
    Join Date
    May 2008

    Default Further improvements

    I made several improvements...

    My project folder is organized as follows...
    - contains all ktr/kjb files
    - the PROJECT folder and all its contents are put on SVN using Tortoise

    - contains all documentation stuff for this project
    - contains all xslt scripts and jar to run XSLT process
    - it also contains .bat files to run the processor against all kjb and ktr and deposit the html of each kettle file in the documentation folder

    - I used xalan jar files required to run from command line.
    - I removed all the other jars/folders that are not relevant

    - contains all the image files from kettle/ui/images
    - These are the images of the steps and entries

    To capture the same stylesheet as the Pentaho wiki site, I copied the index.css from the site and put it in xslt folder

    My approach is to generate the html doc from the ktr and kjb and drop it into the documentation folder.
    To do this, you need to download xalan project in
    Then, you only need 4 files in place them in PROJECT/documentation/xslt/xalan/ folder
    1. serializer.jar
    2. xalan.jar
    3. xercesImpl.jar
    4. xml-apis.jar

    Write a bat file and place it in xalan folder...
    set CLASSPATH=.
    java org.apache.xalan.xslt.Process -IN %1 -XSL %2 -OUT %3
    Name this xalan.bat

    To convert a ktr/kjb file to html in Pentaho color scheme and style do this...

    in xalan directory...
    xalan.bat ../../../KETTLE.ktr ../kettle.xsl ../../KETTLE.ktr.html

    open the html file in any browser.

    It is working great for me.

    Actually, when you copy the ktr files and insert the xml-stylesheet tag using a script and drop it in the documentation folder, you can just open the ktr/kjb (with xml-stylesheet inserted) in a browser and it will be the same.

    What do you think?

    Can some one contribute more improvements on this idea?

    For my project, documentation is critical.

    Attached Files Attached Files

  4. #4

    Default Great!!

    Hi Herman.
    I have followed all the steps and working properly. Thank you very much.

  5. #5
    Join Date
    Dec 2012


    Hi all,

    It is working but its not showing ktr/kjb diagram in html file like kettlecookbook do,
    can we able to do tht? can anybody send exact xslt file?

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.