Question about using the Rome library for RSS

Discussion in 'Java' started by J_Zanetti, Jan 23, 2007.

  1. J_Zanetti

    J_Zanetti Guest

    Hello everybody,

    Im using the library Rome to create the RSS feed for the contents of my
    application. I post my question on this ng since I dont know where I
    can find experts on this library and I didnt find anything about it on
    documentation :)
    I have a problem trying to write the content of a tag, (ie TITLE). I
    need to be able to write CDATA content instad of normal text, this
    causes the creation of not well formed XML.
    Is any function or external library that gives me a method to format a
    text into CDATA or escape the wrong chars?

    Thank you!
    J_Zanetti, Jan 23, 2007
    #1
    1. Advertising

  2. J_Zanetti wrote:
    > Hello everybody,
    >
    > Im using the library Rome to create the RSS feed for the contents of my
    > application. I post my question on this ng since I dont know where I
    > can find experts on this library and I didnt find anything about it on
    > documentation :)
    > I have a problem trying to write the content of a tag, (ie TITLE). I
    > need to be able to write CDATA content instad of normal text, this
    > causes the creation of not well formed XML.
    > Is any function or external library that gives me a method to format a
    > text into CDATA or escape the wrong chars?
    >
    > Thank you!


    I have used Rome quite recently. In order to keep the well-formedness,
    I used Apache's StringEscapeUtils. It has an API for escapeXML(String
    yourString) : String which handles escaping the String for XML. I did
    notice that I did not need it for RSS 1.0 and 2.0, but I ran into
    issues with Atom 1.0. Eventually I ended up using this call for all the
    content (link/title/description, etc.) for all feed types..to be safe.

    Anyway, you might want to look into this API - It is a part of Apache
    Commons' lang distribution. The version of Rome I am using is 0.9.

    -cheers,
    Manish
    Manish Pandit, Jan 23, 2007
    #2
    1. Advertising

  3. J_Zanetti

    J_Zanetti Guest

    On 24 Gen, 00:43, "Manish Pandit" <> wrote:
    > I used Apache's StringEscapeUtils.
    > I did notice that I did not need it for RSS 1.0 and 2.0, but I ran into
    > issues with Atom 1.0. Eventually I ended up using this call for all the
    > content (link/title/description, etc.) for all feed types..to be safe.


    Thank you,
    I will take a look at this API.
    Why you say you didnt need this API for RSS 1.0 and 2.0? Do you think
    Rome can handle the content itself?
    Its strange that such useful tool like Rome doesn't provide any method
    for CDATA contents. It would be nice to find a solution that allows me
    to write special chars in my RSS.

    Thanks!
    J_Zanetti, Jan 24, 2007
    #3
  4. J_Zanetti

    J_Zanetti Guest

    On 24 Gen, 00:43, "Manish Pandit" <> wrote:
    > I used Apache's StringEscapeUtils.


    I tried this class...it works fine , thank you for your advice!
    Just it is 200Kb library for a single function use, could this create
    performances problems? Im kind of newbie ;)

    Anyway the EscapeXML makes greatly its job!
    Thanks again!!
    J_Zanetti, Jan 24, 2007
    #4
  5. On Jan 24, 7:41 am, "J_Zanetti" <> wrote:
    > On 24 Gen, 00:43, "Manish Pandit" <> wrote:
    >
    > > I used Apache's StringEscapeUtils.I tried this class...it works fine , thank you for your advice!

    > Just it is 200Kb library for a single function use, could this create
    > performances problems? Im kind of newbie ;)
    >
    > Anyway the EscapeXML makes greatly its job!
    > Thanks again!!


    Glad it worked for you!

    Yeah - I still do not know why the RSS 1.0 and 2.0 formats came out
    just fine, even with malformed content in the description section. If I
    run into any issue(s), I will let you know, so that you can take
    appropriate measures in case you might encounter the same.

    There should be no performance impact for that call - it is a local
    method call. The only impact is that your distribution's footprint is
    now 200k bigger due to the extra jar file :)

    -cheers,
    Manish
    Manish Pandit, Jan 24, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sal
    Replies:
    0
    Views:
    828
  2. rlh

    Job in Rome

    rlh, Jun 20, 2006, in forum: Java
    Replies:
    0
    Views:
    465
  3. Jonathan Groll
    Replies:
    1
    Views:
    259
    Kouhei Sutou
    Jun 27, 2009
  4. Replies:
    16
    Views:
    684
    Arne Vajhøj
    May 3, 2013
  5. Replies:
    31
    Views:
    568
    Arne Vajhøj
    May 3, 2013
Loading...

Share This Page