Lists Home |
Date Index |
Pete Cordell wrote:
> 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:-
Personally I'd stay away from data binding for use cases like this.
Dealing with mixed content is hardly the only problem. You also have to
deal with repeated elements, omitted elements, and order. Child elements
just don't work well as fields. You can of course fix all this, but then
you end up with something about as complicated as DOM.
Data binding is a plausible solution for going from objects and classes
to XML documents and schemas; but it's a one-way ride. Going the other
direction: from documents and schemas to objects and classes is much
more complicated and generally not worth the hassle.
Elliotte Rusty Harold firstname.lastname@example.org
XML in a Nutshell 3rd Edition Just Published!