<?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: Simple and efficient XML parsing using JAXB 2.0</title>
	<atom:link href="http://www.javarants.com/2006/04/30/simple-and-efficient-xml-parsing-using-jaxb-2-0/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javarants.com/2006/04/30/simple-and-efficient-xml-parsing-using-jaxb-2-0/</link>
	<description>Rants about Java and other internet technologies by Sam Pullara</description>
	<lastBuildDate>Mon, 08 Mar 2010 00:20:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Nathaniel Harward</title>
		<link>http://www.javarants.com/2006/04/30/simple-and-efficient-xml-parsing-using-jaxb-2-0/comment-page-1/#comment-1045</link>
		<dc:creator>Nathaniel Harward</dc:creator>
		<pubDate>Wed, 03 Mar 2010 14:49:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.javarants.com/?p=980#comment-1045</guid>
		<description>And here&#039;s the link which I conveniently forgot :)&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://code.google.com/p/ndh-commons/&quot; rel=&quot;nofollow&quot;&gt;http://code.google.com/p/ndh-commons/&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>And here&#39;s the link which I conveniently forgot <img src='http://www.javarants.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://code.google.com/p/ndh-commons/" rel="nofollow">http://code.google.com/p/ndh-commons/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nathaniel Harward</title>
		<link>http://www.javarants.com/2006/04/30/simple-and-efficient-xml-parsing-using-jaxb-2-0/comment-page-1/#comment-1044</link>
		<dc:creator>Nathaniel Harward</dc:creator>
		<pubDate>Wed, 03 Mar 2010 14:47:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.javarants.com/?p=980#comment-1044</guid>
		<description>I realize this post is rather old, but in the event anyone (including Sam) is still reading it -- this post got me thinking and I created something (free, GPL) somewhere in between the examples here and the LDK+ library mentioned by Lolke.  It&#039;s in its infancy, but perhaps someone would find it useful.</description>
		<content:encoded><![CDATA[<p>I realize this post is rather old, but in the event anyone (including Sam) is still reading it &#8212; this post got me thinking and I created something (free, GPL) somewhere in between the examples here and the LDK+ library mentioned by Lolke.  It&#39;s in its infancy, but perhaps someone would find it useful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Java &#8211; Object XML Mapping &#171; WebMoli &#8211; Rediscover the Basics</title>
		<link>http://www.javarants.com/2006/04/30/simple-and-efficient-xml-parsing-using-jaxb-2-0/comment-page-1/#comment-999</link>
		<dc:creator>Java &#8211; Object XML Mapping &#171; WebMoli &#8211; Rediscover the Basics</dc:creator>
		<pubDate>Wed, 18 Nov 2009 02:30:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.javarants.com/?p=980#comment-999</guid>
		<description>[...] http://www.javarants.com/2006/04/30/simple-and-efficient-xml-parsing-using-jaxb-2-0/comment-page-1/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://www.javarants.com/2006/04/30/simple-and-efficient-xml-parsing-using-jaxb-2-0/comment-page-1/" rel="nofollow">http://www.javarants.com/2006/04/30/simple-and-efficient-xml-parsing-using-jaxb-2-0/comment-page-1/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://www.javarants.com/2006/04/30/simple-and-efficient-xml-parsing-using-jaxb-2-0/comment-page-1/#comment-1013</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Mon, 28 Sep 2009 13:19:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.javarants.com/?p=980#comment-1013</guid>
		<description>Thanks for your great effort.&lt;br&gt;When i tried to test the code which you wrote, it throws the following exception while unmarshalling&lt;br&gt;&lt;br&gt;java.lang.IllegalStateException: reader must be on a START_ELEMENT event, not a 4 event&lt;br&gt;	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:368)&lt;br&gt;	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:354)&lt;br&gt;	at com.fawry.test.TestJAXBUnmarshaller.testParseEfficiently(TestJAXBUnmarshaller.java:72)&lt;br&gt;	at com.fawry.test.TestJAXBUnmarshaller.main(TestJAXBUnmarshaller.java:31)&lt;br&gt;&lt;br&gt;I hope if you have answer to my question</description>
		<content:encoded><![CDATA[<p>Thanks for your great effort.<br />When i tried to test the code which you wrote, it throws the following exception while unmarshalling</p>
<p>java.lang.IllegalStateException: reader must be on a START_ELEMENT event, not a 4 event<br />	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:368)<br />	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:354)<br />	at com.fawry.test.TestJAXBUnmarshaller.testParseEfficiently(TestJAXBUnmarshaller.java:72)<br />	at com.fawry.test.TestJAXBUnmarshaller.main(TestJAXBUnmarshaller.java:31)</p>
<p>I hope if you have answer to my question</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://www.javarants.com/2006/04/30/simple-and-efficient-xml-parsing-using-jaxb-2-0/comment-page-1/#comment-987</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Mon, 28 Sep 2009 06:19:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.javarants.com/?p=980#comment-987</guid>
		<description>Thanks for your great effort.&lt;br&gt;When i tried to test the code which you wrote, it throws the following exception while unmarshalling&lt;br&gt;&lt;br&gt;java.lang.IllegalStateException: reader must be on a START_ELEMENT event, not a 4 event&lt;br&gt;	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:368)&lt;br&gt;	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:354)&lt;br&gt;	at com.fawry.test.TestJAXBUnmarshaller.testParseEfficiently(TestJAXBUnmarshaller.java:72)&lt;br&gt;	at com.fawry.test.TestJAXBUnmarshaller.main(TestJAXBUnmarshaller.java:31)&lt;br&gt;&lt;br&gt;I hope if you have answer to my question</description>
		<content:encoded><![CDATA[<p>Thanks for your great effort.<br />When i tried to test the code which you wrote, it throws the following exception while unmarshalling</p>
<p>java.lang.IllegalStateException: reader must be on a START_ELEMENT event, not a 4 event<br />	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:368)<br />	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:354)<br />	at com.fawry.test.TestJAXBUnmarshaller.testParseEfficiently(TestJAXBUnmarshaller.java:72)<br />	at com.fawry.test.TestJAXBUnmarshaller.main(TestJAXBUnmarshaller.java:31)</p>
<p>I hope if you have answer to my question</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lolke Dijkstra</title>
		<link>http://www.javarants.com/2006/04/30/simple-and-efficient-xml-parsing-using-jaxb-2-0/comment-page-1/#comment-970</link>
		<dc:creator>Lolke Dijkstra</dc:creator>
		<pubDate>Fri, 19 Jun 2009 05:58:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.javarants.com/?p=980#comment-970</guid>
		<description>Hi Sam,&lt;br&gt;&lt;br&gt;Thanks for your swift reply!&lt;br&gt;&lt;br&gt;Actually I&#039;ve developed an alternative approach based on SAX and MDE. More specifically, what I do, I use a code generator to generate the code from the schema. &lt;br&gt;&lt;br&gt;The approach uses a common framework and the generator extends these framework classes. In principle for each complextype a JavaBean class is generated, but whether or not this class should be stored with its parent is configurable. For more information please see my website: &lt;a href=&quot;http://www.dijkstra-ict.com&quot; rel=&quot;nofollow&quot;&gt;http://www.dijkstra-ict.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;I also wrote an article that explains the approach. You can find it on the site. &lt;br&gt;Let me know if you&#039;re interested to see how it compares to the alternative.&lt;br&gt;&lt;br&gt;Kind regards,&lt;br&gt;Lolke Dijkstra</description>
		<content:encoded><![CDATA[<p>Hi Sam,</p>
<p>Thanks for your swift reply!</p>
<p>Actually I&#39;ve developed an alternative approach based on SAX and MDE. More specifically, what I do, I use a code generator to generate the code from the schema. </p>
<p>The approach uses a common framework and the generator extends these framework classes. In principle for each complextype a JavaBean class is generated, but whether or not this class should be stored with its parent is configurable. For more information please see my website: <a href="http://www.dijkstra-ict.com" rel="nofollow">http://www.dijkstra-ict.com</a></p>
<p>I also wrote an article that explains the approach. You can find it on the site. <br />Let me know if you&#39;re interested to see how it compares to the alternative.</p>
<p>Kind regards,<br />Lolke Dijkstra</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: spullara</title>
		<link>http://www.javarants.com/2006/04/30/simple-and-efficient-xml-parsing-using-jaxb-2-0/comment-page-1/#comment-969</link>
		<dc:creator>spullara</dc:creator>
		<pubDate>Thu, 18 Jun 2009 16:52:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.javarants.com/?p=980#comment-969</guid>
		<description>Hi Lolke,&lt;br&gt;&lt;br&gt;There is no way for JAXB to not parse the children of an element that you unmarshall.  For your case I would use StAX to go all the way down to the Batch object then use JAXB to parse each individual transaction.&lt;br&gt;&lt;br&gt;Sam</description>
		<content:encoded><![CDATA[<p>Hi Lolke,</p>
<p>There is no way for JAXB to not parse the children of an element that you unmarshall.  For your case I would use StAX to go all the way down to the Batch object then use JAXB to parse each individual transaction.</p>
<p>Sam</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lolke Dijkstra</title>
		<link>http://www.javarants.com/2006/04/30/simple-and-efficient-xml-parsing-using-jaxb-2-0/comment-page-1/#comment-968</link>
		<dc:creator>Lolke Dijkstra</dc:creator>
		<pubDate>Thu, 18 Jun 2009 12:32:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.javarants.com/?p=980#comment-968</guid>
		<description>This is very interesting and it probably works for many cases but I was wondering would it work if you need both the encompassing element and its children. For example:&lt;br&gt;&lt;br&gt;&lt;batch&gt;&lt;br&gt;	&lt;info&gt;some generic info&lt;/info&gt;&lt;br&gt;	&lt;..&gt;&lt;br&gt;	&lt;br&gt;	&lt;!-- sequence of many transactions --&gt;&lt;br&gt;	&lt;tx&gt;&lt;br&gt;		&lt;src&gt;...&lt;br&gt;			&lt;addr&gt;...&lt;br&gt;			&lt;/addr&gt;&lt;br&gt;		&lt;/scr&gt;&lt;br&gt;		&lt;dst&gt;...&lt;/dst&gt;&lt;br&gt;		&lt;..&gt;&lt;br&gt;	&lt;/tx&gt;&lt;br&gt;	&lt;!-- many more tx...--&gt;&lt;br&gt;&lt;/batch&gt;&lt;br&gt;&lt;br&gt;So now I would like to process the batch having an object of type Batch:&lt;br&gt;&lt;br&gt;class Batch {&lt;br&gt;	public String getInfo()...&lt;br&gt;	public List&lt;TxType&gt; getTxs()...&lt;br&gt;	}&lt;br&gt;	&lt;br&gt;and the Tx:&lt;br&gt;&lt;br&gt;class Tx {&lt;br&gt;	SrcType getScr()...&lt;br&gt;	DstType getDst()...&lt;br&gt;	...&lt;br&gt;	}&lt;br&gt;&lt;br&gt;Obviously, using the sparse (memory efficient) approach I would expect the getTxs() to just return an empty List&lt;TxType&gt;, whereas in the straightforward approach this list would contain the actual Tx children.&lt;br&gt;&lt;br&gt;So, the thing is, when you use JAXB to parse the unmarshall the parent, it there a way to instruct it to not store the transaction in the List and use JAXB to process these separately?&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Lolke</description>
		<content:encoded><![CDATA[<p>This is very interesting and it probably works for many cases but I was wondering would it work if you need both the encompassing element and its children. For example:</p>
<p>&lt;batch&gt;<br />	&lt;info&gt;some generic info&lt;/info&gt;<br />	&lt;..&gt;</p>
<p>	&lt;!&#8211; sequence of many transactions &#8211;&gt;<br />	&lt;tx&gt;<br />		&lt;src&gt;&#8230;<br />			&lt;addr&gt;&#8230;<br />			&lt;/addr&gt;<br />		&lt;/scr&gt;<br />		&lt;dst&gt;&#8230;&lt;/dst&gt;<br />		&lt;..&gt;<br />	&lt;/tx&gt;<br />	&lt;!&#8211; many more tx&#8230;&#8211;&gt;<br />&lt;/batch&gt;</p>
<p>So now I would like to process the batch having an object of type Batch:</p>
<p>class Batch {<br />	public String getInfo()&#8230;<br />	public List&lt;TxType&gt; getTxs()&#8230;<br />	}</p>
<p>and the Tx:</p>
<p>class Tx {<br />	SrcType getScr()&#8230;<br />	DstType getDst()&#8230;<br />	&#8230;<br />	}</p>
<p>Obviously, using the sparse (memory efficient) approach I would expect the getTxs() to just return an empty List&lt;TxType&gt;, whereas in the straightforward approach this list would contain the actual Tx children.</p>
<p>So, the thing is, when you use JAXB to parse the unmarshall the parent, it there a way to instruct it to not store the transaction in the List and use JAXB to process these separately?</p>
<p>Thanks,<br />Lolke</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: spullara</title>
		<link>http://www.javarants.com/2006/04/30/simple-and-efficient-xml-parsing-using-jaxb-2-0/comment-page-1/#comment-887</link>
		<dc:creator>spullara</dc:creator>
		<pubDate>Thu, 29 Jan 2009 14:59:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.javarants.com/?p=980#comment-887</guid>
		<description>Parsing the entire document.</description>
		<content:encoded><![CDATA[<p>Parsing the entire document.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neel Sukhadia</title>
		<link>http://www.javarants.com/2006/04/30/simple-and-efficient-xml-parsing-using-jaxb-2-0/comment-page-1/#comment-886</link>
		<dc:creator>Neel Sukhadia</dc:creator>
		<pubDate>Thu, 29 Jan 2009 14:21:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.javarants.com/?p=980#comment-886</guid>
		<description>The performance measurements are for for the entire document or for a single element&#039;s parse?Thanks.</description>
		<content:encoded><![CDATA[<p>The performance measurements are for for the entire document or for a single element&#39;s parse?Thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
