[Moved to laszlo-dev]

On Mar 24, 2006, at 9:15 AM, P T Withington wrote:

I think what you are running up against is a general problem with  

XML, though.  There are a number of cases in the language where you  

have an element that has a body and that conflicts with the element  

wanting to also permit properties.  <text> is another example of this  

issue.


This has come up in the context of the design of the components, as well: how to allow in-place declaration of combobox options, for example, while still allowing a non-data body for the combobox instance.

One idea I've been kicking around is to introduce an attribute that governs how the body is to be interpreted -- as XML data, or as more LZX. This is a bit weird because it makes the schema dynamic, but would be a clean solution otherwise. So you might have:

<dataset type="direct">
  <items><item>A</item></items>
</dataset>

<dataset type="remote">
  <handler name="ondata">...</handler>
</dataset>

To avoid the schema problems you could be more verbose and introduce a <data> tag:

<dataset type="direct">
  <data>
    <items><item>A</item></items>
  </data>
</dataset>

This is one direction I'd like to propose for the components design -- that "direct style" declarations become more verbose so that we can be more data-driven in implementation, and avoid the sort of syntactic limitations discussed in the original message in this thread.

We could then make the syntax less verbose with an XML rewrite engine inserted at the front of the tag compiler. Something using E4X and _javascript_, perhaps... But that's the topic for another time.

jim
_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to