How to create a RSS feed from compiled classes?

Aug 20, 2008 at 12:36 PM
Hi there,

I compiled the Rss 2.0 schema, and I got the classes from it (Java code). Everything fine, and my question is about how to populate the TRss element ?

my goal:

<rss version="2.0">
    <chanel>
       <title>test</title>
    </chanel>
</rss>

  my last trial:

            Rss rssFeed = new Rss();
            rssFeed.getOtherAttributes().put(new QName("", "version"), "2.0");

            TRssChannel channel = new TRssChannel();
            channel.getTitleOrLinkOrDescription().put(new QName("http://www.thearchitect.co.uk/schemas/rss-2_0", "title"), "Cars @ Cejug Classifieds");



a code sample in any language would be cool :)
Coordinator
Sep 7, 2008 at 6:49 PM
Logged as work item 11187
http://www.codeplex.com/rss2schema/WorkItem/View.aspx?WorkItemId=11187
Coordinator
Sep 9, 2008 at 7:36 AM
Release rss2schema-2.0.2.14 includes C# code samples showing how to construct an example RSS 2.0 feed file using data classed generated by the .NET xsd.exe tool.

Download release rss2schema-2.0.2.14
http://www.codeplex.com/rss2schema/Release/ProjectReleases.aspx?ReleaseId=17143
Sep 9, 2008 at 9:12 AM
Great job, but there is a detail: ItemsChoiceType1

from the Microsoft documentation: "This API supports the .NET Framework infrastructure and is not intended to be used directly from your code."

I am looking for an equivalent structure in Java.. actually, the schema compiled using wsimport and it is useful in the Java side, but I am still missing the way of constructing an item in my Java code. I will try to use Enumeration instead of ItemsChoiceType1 but I am not sure about that..

Please keep your good work with this schema, we are quite close to have fully interoperability in this RSS document.

Other tip:  I needed to convert the type Rss in to an xml element Rss.. because I can't declare messages using types in WSDL (ok, I can create my own wrapper, but then the return type of my service is not pure RSS anymore...
Sep 9, 2008 at 9:36 AM
following the tips of this article: http://www.ibm.com/developerworks/xml/library/ws-tip-xsdchoice.html

we can replace the unbounded choice of Channel and Item elements by polymorphic model: generating exactly the same xml results an with a fully interoperable code in both .Net and Java..

how about that ?
Sep 9, 2008 at 10:48 AM
I found a workaround in Java: http://kingsfleet.blogspot.com/2008/07/working-round-xsdchoice-binding-issue.html
Mar 1, 2009 at 9:41 AM
Is there anyone who managed to do this in C++?