On Thu, Nov 18, 2010 at 8:37 PM, Dennis Sosnoski <d...@sosnoski.com> wrote:
> Incidentally, http://jira.codehaus.org/browse/JIBX-397 appears to be
> mis-titled - it looks like it should be "Allow setting flexible='true' and
> ordered='true' at the same time. I'm looking into an easy work-around for
> this case now, based on using a DOM mapper that handles anything other than
> the specified namespace.
>
You're right, it should have said "Allow setting flexible='true' and
ordered='true' at the same time". Sorry about that.
On Thu, Nov 18, 2010 at 8:37 PM, Dennis Sosnoski <d...@sosnoski.com> wrote:
> The issue with "flexible" unmarshalling is that JiBX normally generates
> code based on the expected order of elements in order to get the most
> efficient processing - at any point in the unmarshalling it can just check
> for the next expected element, and if it's not found skip to the following
> one, an approach that works very well with a pull parser. So-called
> "flexible" unmarshalling instead requires that it look at the element name
> and then fan-out for processing based on that name.
>
> For 2.0 I'm planning better handling of this case, but it's always going to
> be somewhat ugly.
>
I'll take your word for it... but I'm still curious about this (pardon my
ignorance). If this is too complicated to explain just say so and I'll stop
asking :-)
The difficulty seems backwards. It seems that supporting flexible="true"
should actually be easier in the ordered="true" case than in the
ordered="false" case. In the ordered="true" case, if you see something other
than the next expected element, you just skip it and go on to the next one
(as you described above). It seems like only in the ordered="false" case do
you need to do any kind of lookup operation...
Ah, perhaps you're requiring the parser to distinguish between an unknown
element and an out-of-order element? Then a lookup would be required. But a
lookup is required in the ordered="false" case, so we already know how to do
that... ?
-Archie
--
Archie L. Cobbs
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users