Hitachi Vantara Pentaho Community Forums
Results 1 to 22 of 22

Thread: RSS XML Output

  1. #1
    Join Date
    May 2007
    Posts
    21

    Default RSS XML Output

    Has anyone successfully generated RSS XML using Kettle?


    I can get Kettle to generate this.

    <?xml version="1.0" encoding="UTF-8"?>
    <Channel>
    </Channel>

    but I need this

    <?xml version="1.0" encoding="UTF-8"?>
    <rss version="2.0">
    <Channel>
    </Channel>

    Kettle can generate 99.9% of what I need out of the box, but I do not know how to add the <rss version="2.0"> element to the top of the file before adding the channels and items.


    Any help would be appreciated.

  2. #2
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    Well in that case, perhaps you can apply a small XSLT after XML generation?

  3. #3
    Join Date
    May 2007
    Posts
    21

    Default XSLT Transform

    Matt,

    Do you have any samples, suggestions or direction on what an XSLT transform would look like to do this?

    I am not that familiar with XSLT.

    I am familiar with the SAX XML parser, but that is not available in PDI, right?

  4. #4
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    I'm no XSLT expert myself, although I have used it a few times in the past. (To fix a faulty CWM reference model no less)

    XSLT is actually pretty powerful. The typical use is to read XML data to transfer that into formatted HTML document etc.
    However, the simple use is to convert XML to XML.
    I googled a few examples here: http://www.topxml.com/xsltStylesheet...XML_to_XML.asp

    As you can see, the .XSL document is not too hard to understand. Adding a fixed attribute would surely be possible. Unfortunately I don't have the time to figure it out for you. Given the fact that I love to dabble with these things, that's a real shame.

    Matt

  5. #5
    Join Date
    May 2007
    Posts
    21

    Default XML to XML

    Thanks Matt.

    I will give it a go and post back my findings.

    Maybe an RSS Output in Kettle's future?

  6. #6
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    Actually, someone should write a plugin for it and just put it in our plugin list.
    It's not that hard to do in any case.

    Anyone? Anyone? Anyone? Bueller?

  7. #7
    Join Date
    Sep 2008
    Posts
    7

    Default RSS output would be great

    I am at this exact same point also.

    I can get this.

    <?xml version="1.0" encoding="UTF-8"?>
    <Channel>
    </Channel>

    but I need this

    <?xml version="1.0" encoding="UTF-8"?>
    <rss version="2.0">
    <Channel>
    </Channel>

    I also tried to pass <items> in a variable/field to --> custom output item fields --> RSS plug-in.

    For some reason it adds an extra <item /> . Wierd.
    is there another way?

    <?xml version="1.0" encoding="iso-8859-1" ?>
    - <rss version="2.0">
    - <channel>
    <title>Name</title>
    <description>Clydes Description</description>
    <link>www.link.com</link>
    <category>kettle</category>
    - <item>
    <item />
    <unique_id>54321</unique_id><contact_name>Janet </contact_name><company_address>1234 Agent company address</company_address><company_city>Sarasota</company_city> </item>
    - <item>
    <item />
    <unique_id>54321</unique_id><contact_name>Janet </contact_name><company_address>1234 Agent company address</company_address><company_city>Sarasota</company_city>
    </item>
    </channel>
    </rss>


    Seems like there should be simple work around, but I have been working all day and can not find it.
    Please, Please help
    Thanks
    Clyde
    Last edited by cbaxter; 09-28-2008 at 06:16 AM.

  8. #8
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    Dear Thread Hijacker, RSS Input and Output steps have already been written as a plugin:

    http://wiki.pentaho.com/display/EAI/...ation+Plug-Ins

  9. #9
    Join Date
    Sep 2008
    Posts
    7

    Default

    Sorry, didnt mean to hijack the thread, this seemed like the right place to post since I have the same problem as the original poster.

    I actually have been using the RSS plug-in.
    the problem is as I mentioned earlier

    I pass <items> in a variable/field to -->
    "custom output item fields" of the RSS plug-in.

    For some reason the plug-in adds an extra <item /> tag to the output.
    (please see the example RSS output in my last post.)


    Pentaho is absolutely great but I seem to have hit a wall trying to output a custom rss format.
    Any help is appreciated.
    Thanks in advance.
    Last edited by cbaxter; 09-28-2008 at 09:42 PM.

  10. #10

    Default

    Hi Clyde,

    Can you please post your sample transformation?

    Thanks

    (I reply to your private mail)

    Samatar
    Samatar

  11. #11
    Join Date
    Sep 2008
    Posts
    7

    Default RSS Sample Transformation

    Hello Samatar,
    Thanks for your fast response.
    I have attached the rss_test.ktr file for viewing.
    Again Many Thanks for your help.
    Clyde
    Attached Files Attached Files

  12. #12
    Join Date
    Nov 1999
    Posts
    459

    Default XML Output hack

    Another possibility is to use the
    http://wiki.pentaho.com/display/EAI/Add+XML
    or in 3.1: http://wiki.pentaho.com/display/EAI/XML+Join
    Look at the examples in samples/transformations/Add XML ....

    Since we have the great Get Data from XML input step in 3.1, I think it's time to work on the XML output side....

    HTH,
    Jens
    Last edited by jbleuel; 09-30-2008 at 04:14 AM. Reason: hack mentioned before does not work.... closing element tag is wrong

  13. #13

    Default

    I think it's time to work on the XML output side....

    --> Yeah..thinking of it a wile.

    Samatar
    Samatar

  14. #14
    Join Date
    Sep 2008
    Posts
    7

    Default

    Hi Samatar,
    I Tested the updated RSS output plugin you sent on 3.1 and now it works fine.
    Excited !
    Many, Many Thanks for your help and for this great plugin.
    Best Regards
    Clyde

  15. #15
    Join Date
    Sep 2008
    Posts
    7

    Smile cdata and georss for rss plugin

    Hi Samatar,
    Just a few questions regarding rss plugin please .

    I tried using some CDATA tags in variables Ex.
    "<![CDATA[Some Data]]>"
    but I am getting..
    "&lt;![CDATA[Some Data]]&gt;"

    Any Ideas?

    Also,

    I am wondering if we could add simple georss features to the plugin example: <georssoint>45.256 -110.45</georssoint>
    using this for ROME http://georss.geonames.org/

    Best Regards
    Clyde

  16. #16

    Default Nice

    Hi Clyde,
    that's true, we did not mask so using CDATA tags should not work.
    Regarding GoRSS, we use already ROME to produce regular RSS output, so it won't be difficult to add GeoRSS Producer.

    If you want to add theses feature, you can send me an email explaining what kind of changes you want with examples.

    Take care

    Samatar
    Samatar

  17. #17
    Join Date
    Sep 2008
    Posts
    7

    Default RSS Namespace Options

    Hello Samatar,

    Hope all is well, Ive been unable to reach you by email this week regarding the possible CDATA or georss features for your plugin.

    Also wondering about a custom namespaces feature to allow for additional tags.

    examples:

    rss version="2.0" xmlns:georss="http://www.georss.org/georss"
    or
    rss version="2.0" xmlns:g="http://base.google.com/ns/1.0"

    or many more flavors here:
    http://www.feedforall.com/directory-namespace.htm

    If possible it would be great.

    I have nearly finished my project and would love to make further use of your rss plugin.

    Please let me know if there is anything I can do to help.

    Many Thanks
    Clyde
    Last edited by cbaxter; 10-11-2008 at 07:26 PM.

  18. #18
    Join Date
    Apr 2008
    Posts
    123

    Default

    Samatar,

    Nice RSS plug in. Clyde's suggestion to add a place to define custom namespaces would be necessary for me to make use of this. I am attempting to interface with google base and their RSS and ATOM xml feeds require the use of namespaces to define their custom fields:

    from the website: http://base.google.com/support/bin/a...n&answer=58085

    Code:
    <?xml version="1.0"?>
    <rss version="2.0" 
    xmlns:g="http://base.google.com/ns/1.0" 
    xmlns:c="http://base.google.com/cns/1.0">
    <channel><title>Google Jobs</title>
    <link>http://www.google.com/support/jobs/</link>
    <description>Information about job openings at Google Inc.</description>
    <item>
    <title>HR Analyst - Mountain View</title>
    <link> http://www.google.com/support/jobs/bin/topic.py?dep_id=1077&amp;loc_id=1116</link>
    <description>We have an immediate need for an experienced analytical HR professional.
    The ideal candidate has a proven record of developing analytical frameworks to make
    fact-based decisions.</description>
    <g:image_link>http://www.google.com/images/google_sm.gif</g:image_link>
    <g:expiration_date>2005-11-15</g:expiration_date>
    <g:job_function>Analyst</g:job_function>
    <g:location>1600 Amphitheatre Parkway, Mountain View, CA, 94043, USA</g:location>
    <c:language_skills type="string">Fluent in English and German</c:language_skills>
    <c:prior_experience_years type="int">5</c:prior_experience_years>
    <c:start_date type="date">2005-11-15</c:start_date>
    </item>
    </channel>
    </rss>
    This is the format we would need to take advantage of the RSS 2.0 google base data feed functionality.

    Thanks - Roco
    Last edited by roco; 11-10-2008 at 06:17 PM.

  19. #19

    Default

    Hi Roco,
    i am currently working on it (this feature is easy to add) so i will update very soon.


    Thanks & Take care

    Samatar
    Samatar

  20. #20
    Join Date
    Mar 2008
    Posts
    12

    Default Xml

    I'm also really interested in this feature.
    Is it available now?

    Thanks

    Pierre

  21. #21
    Join Date
    Mar 2008
    Posts
    12

    Question XML Attributes

    Is there a way to manage XML attributes using different Kettle XML steps?

  22. #22
    Join Date
    Sep 2008
    Posts
    7

    Default RSS Output plugin initial test results

    Hi Samatar,

    Sorry for the delay between replies.

    I performed some testing on the rss output plugin.

    Please find attached example transformation.

    It seems the output is still throwing error for custom name space items .
    ie:

    <item>
    georss:point
    g:location

    throws error similar to following:

    2009/01/26 21:10:58 - Rss Output plugin.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : org.dom4j.IllegalAddException: No such namespace prefix: georss is in scope on: org.dom4j.tree.DefaultElement@1e352bf [Element: <item attributes: []/>] so cannot add element: georss:point

    Also

    I tried using some CDATA tags in <item><description> tags
    Ex.:

    "<item><description><![CDATA[Some HTML]]></item></description>"

    but still getting..

    "&lt;![CDATA[Some HTML]]&gt;"

    Looking forward to hearing from you and MANY THANKS for your help

    Clyde
    Attached Files Attached Files

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.