OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   RE: [xml-dev] Mixed content in data-binding (Was: Re: [xml-dev] Interest

[ Lists Home | Date Index | Thread Index ]

nly interested in.
> Being guilty of being a code-head (and a binding one at that 
> - can it get 
> worse!), I'm keen to know how you'd like us to make a better 
> fist of it. 
> One way of binding the example of "<p>This is <strong>very</strong> 
> important</p>" might be to have a class structure that (with 
> any unused 
> elements ignored) looks like:-
>     class p
>     {
>         string cdata1;        // = "This is "
>         class strong strong;
>         string cdata2;        // = " important"
>     };

That seems to handle the specific example and not the class of all possible
instances (which hasn't been defined here).

If I was modelling this data in Java I would use a List of Objects each of
which is either a String or a StrongElement or an EmphElement or one of the
various other things that's allowed to appear. Alternatively I might use a
TextNode rather than a String, if I want to hold information other than its

Of course Java (even Java 5) wouldn't give me any strong typing on that.

Michael Kay


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS