This post originated from an RSS feed registered with Java Buzz
by Brian McCallister.
Original Post: Atom via XMLBeans
Feed Title: Waste of Time
Feed URL: http://kasparov.skife.org/blog/index.rss
Feed Description: A simple waste of time and weblog experiment
Latest Java Buzz Posts
Latest Java Buzz Posts by Brian McCallister
Latest Posts From Waste of Time
Advertisement
Got tired of futzing learning XSD etc so started on something potentially useful. First step, get Atom feeds working through xmlbeans . Success!
public void testCreateFeedType()
{
AuthorType author = AuthorType.Factory.newInstance();
author.setEmail("brian@skife.org");
author.setName("Brian McCallister");
author.setUrl("http://kasparov.skife.org/blog/");
assertTrue(author.validate());
FeedType feed = FeedType.Factory.newInstance();
feed.setAuthor(author);
feed.setCopyright("copyright 2004 BMc");
feed.setId("http://kasparov.skife.org/blog/test.atom");
feed.setTitle("Test Feed");
feed.setVersion("0.3");
feed.setModified(Calendar.getInstance());
assertTrue(feed.validate());
FeedDocument doc = FeedDocument.Factory.newInstance();
doc.setFeed(feed);
assertTrue(doc.validate());
System.err.println(doc);
}
gives me
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<title>Test Feed</title>
<author>
<name>Brian McCallister</name>
<url>http://kasparov.skife.org/blog/</url>
<email>brianm@apache.org</email>
</author>
<id>http://kasparov.skife.org/blog/test.atom</id>
<copyright>copyright 2004 BMc</copyright>
<modified>2004-01-21T23:26:19.586-05:00</modified>
</feed>
I'll take small victories =) Next step is persisting these things to xindice , and pulling em back out. Then Cocoon enters the picture and the real fun can begin. Oh fun day!
Read: Atom via XMLBeans