<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: [lazyweb] Microformat databinding</title>
	<atom:link href="http://netzooid.com/blog/2007/12/11/lazyweb-microformat-databinding/feed/" rel="self" type="application/rss+xml" />
	<link>http://netzooid.com/blog/2007/12/11/lazyweb-microformat-databinding/</link>
	<description>gettin all zoidal on ya</description>
	<lastBuildDate>Sat, 24 Jul 2010 09:48:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Dan Diephouse</title>
		<link>http://netzooid.com/blog/2007/12/11/lazyweb-microformat-databinding/comment-page-1/#comment-21562</link>
		<dc:creator>Dan Diephouse</dc:creator>
		<pubDate>Sun, 16 Dec 2007 19:55:02 +0000</pubDate>
		<guid isPermaLink="false">http://netzooid.com/blog/2007/12/11/lazyweb-microformat-databinding/#comment-21562</guid>
		<description>Christian: yeah that is definitely an option.

Peter: I don&#039;t think XStream will do that... Velocity is definitely an option, but still more work than I want it to be.</description>
		<content:encoded><![CDATA[<p>Christian: yeah that is definitely an option.</p>
<p>Peter: I don&#8217;t think XStream will do that&#8230; Velocity is definitely an option, but still more work than I want it to be.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Backlund</title>
		<link>http://netzooid.com/blog/2007/12/11/lazyweb-microformat-databinding/comment-page-1/#comment-20943</link>
		<dc:creator>Peter Backlund</dc:creator>
		<pubDate>Wed, 12 Dec 2007 18:31:38 +0000</pubDate>
		<guid isPermaLink="false">http://netzooid.com/blog/2007/12/11/lazyweb-microformat-databinding/#comment-20943</guid>
		<description>Try XStream or a template engine (Freemarker, Velocity)</description>
		<content:encoded><![CDATA[<p>Try XStream or a template engine (Freemarker, Velocity)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Ullenboom</title>
		<link>http://netzooid.com/blog/2007/12/11/lazyweb-microformat-databinding/comment-page-1/#comment-20907</link>
		<dc:creator>Christian Ullenboom</dc:creator>
		<pubDate>Wed, 12 Dec 2007 11:35:58 +0000</pubDate>
		<guid isPermaLink="false">http://netzooid.com/blog/2007/12/11/lazyweb-microformat-databinding/#comment-20907</guid>
		<description>My solution is not using a Person-POJO, but I think a POJO should not be JAXB-annotated to write a microformat. So mapping to an intermediate is IMO a good design decision.</description>
		<content:encoded><![CDATA[<p>My solution is not using a Person-POJO, but I think a POJO should not be JAXB-annotated to write a microformat. So mapping to an intermediate is IMO a good design decision.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Ullenboom</title>
		<link>http://netzooid.com/blog/2007/12/11/lazyweb-microformat-databinding/comment-page-1/#comment-20906</link>
		<dc:creator>Christian Ullenboom</dc:creator>
		<pubDate>Wed, 12 Dec 2007 11:32:00 +0000</pubDate>
		<guid isPermaLink="false">http://netzooid.com/blog/2007/12/11/lazyweb-microformat-databinding/#comment-20906</guid>
		<description>import java.util.*;
import javax.xml.bind.*;
import javax.xml.bind.annotation.*;

public class MicroformatViaJaxb
{
  public static void main( String[] args ) throws JAXBException
  {
    Microformat mf = new Microformat();
    mf.elements.add( new Element( &quot;name&quot;, &quot;Christian Ullenboom&quot; ) );
    mf.elements.add( new Element( &quot;address&quot;, &quot;1 Main St&quot; ) );
    mf.elements.add( new Element( &quot;phone&quot;, &quot;+15555551212&quot; ) );

    //

    JAXBContext context = JAXBContext.newInstance( Microformat.class );
    Marshaller m = context.createMarshaller();
    m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );
    m.marshal( mf, System.out );
  }
}

@XmlRootElement( name = &quot;div&quot; )
class Microformat
{
  @XmlAttribute( name = &quot;class&quot; )
  public String key = &quot;person&quot;;

  @XmlElement( name = &quot;span&quot; )
  public List elements = new ArrayList();
}

class Element
{
  @XmlAttribute( name = &quot;class&quot; )
  public String key;

  @XmlValue
  public String value;

  public Element()
  {
  }

  public Element( String key, String value )
  {
    this.key = key;
    this.value = value;
  }
}</description>
		<content:encoded><![CDATA[<p>import java.util.*;<br />
import javax.xml.bind.*;<br />
import javax.xml.bind.annotation.*;</p>
<p>public class MicroformatViaJaxb<br />
{<br />
  public static void main( String[] args ) throws JAXBException<br />
  {<br />
    Microformat mf = new Microformat();<br />
    mf.elements.add( new Element( &#8220;name&#8221;, &#8220;Christian Ullenboom&#8221; ) );<br />
    mf.elements.add( new Element( &#8220;address&#8221;, &#8220;1 Main St&#8221; ) );<br />
    mf.elements.add( new Element( &#8220;phone&#8221;, &#8220;+15555551212&#8243; ) );</p>
<p>    //</p>
<p>    JAXBContext context = JAXBContext.newInstance( Microformat.class );<br />
    Marshaller m = context.createMarshaller();<br />
    m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );<br />
    m.marshal( mf, System.out );<br />
  }<br />
}</p>
<p>@XmlRootElement( name = &#8220;div&#8221; )<br />
class Microformat<br />
{<br />
  @XmlAttribute( name = &#8220;class&#8221; )<br />
  public String key = &#8220;person&#8221;;</p>
<p>  @XmlElement( name = &#8220;span&#8221; )<br />
  public List elements = new ArrayList();<br />
}</p>
<p>class Element<br />
{<br />
  @XmlAttribute( name = &#8220;class&#8221; )<br />
  public String key;</p>
<p>  @XmlValue<br />
  public String value;</p>
<p>  public Element()<br />
  {<br />
  }</p>
<p>  public Element( String key, String value )<br />
  {<br />
    this.key = key;<br />
    this.value = value;<br />
  }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick Mueller</title>
		<link>http://netzooid.com/blog/2007/12/11/lazyweb-microformat-databinding/comment-page-1/#comment-20832</link>
		<dc:creator>Patrick Mueller</dc:creator>
		<pubDate>Wed, 12 Dec 2007 01:59:02 +0000</pubDate>
		<guid isPermaLink="false">http://netzooid.com/blog/2007/12/11/lazyweb-microformat-databinding/#comment-20832</guid>
		<description>No, I haven&#039;t.  But this looks interesting.  Because it results in a closer shape to JSON than the typical way people would serialize (your example above).  Specifically, if you serialize this way, you could standardize the elements you used for &#039;objects&#039; (div), attributes (span), arrays (ol), etc.</description>
		<content:encoded><![CDATA[<p>No, I haven&#8217;t.  But this looks interesting.  Because it results in a closer shape to JSON than the typical way people would serialize (your example above).  Specifically, if you serialize this way, you could standardize the elements you used for &#8216;objects&#8217; (div), attributes (span), arrays (ol), etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Diephouse</title>
		<link>http://netzooid.com/blog/2007/12/11/lazyweb-microformat-databinding/comment-page-1/#comment-20793</link>
		<dc:creator>Dan Diephouse</dc:creator>
		<pubDate>Tue, 11 Dec 2007 23:28:07 +0000</pubDate>
		<guid isPermaLink="false">http://netzooid.com/blog/2007/12/11/lazyweb-microformat-databinding/#comment-20793</guid>
		<description>Not AFAIK. That would output something like:

&lt;person&gt;
&lt;name&gt;...&lt;/name&gt;
&lt;/person&gt;

The point here is to get out XHTML microcontent as opposed to just straight up XML.</description>
		<content:encoded><![CDATA[<p>Not AFAIK. That would output something like:</p>
<p>&lt;person&gt;<br />
&lt;name&gt;&#8230;&lt;/name&gt;<br />
&lt;/person&gt;</p>
<p>The point here is to get out XHTML microcontent as opposed to just straight up XML.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Perepelytsya</title>
		<link>http://netzooid.com/blog/2007/12/11/lazyweb-microformat-databinding/comment-page-1/#comment-20780</link>
		<dc:creator>Andrew Perepelytsya</dc:creator>
		<pubDate>Tue, 11 Dec 2007 22:11:49 +0000</pubDate>
		<guid isPermaLink="false">http://netzooid.com/blog/2007/12/11/lazyweb-microformat-databinding/#comment-20780</guid>
		<description>Hey Dan, won&#039;t JAXB, JPOX or the like with annotations on the POJO address this?</description>
		<content:encoded><![CDATA[<p>Hey Dan, won&#8217;t JAXB, JPOX or the like with annotations on the POJO address this?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

