[Laszlo-user] [Laszlo-dev] Your vote needed: Text formatting and datapaths

Vagelis Papadogiannakis papas at source.gr
Wed Jul 11 13:25:43 PDT 2007


Hello everybody,

Please consider changing dataformat to textformat as shown bellow.

<text datapath="person/" textformat="'%s %s'" data=$path
{'firstName/text()', 'lastName/text()'} />


Vagelis




On 7/11/07, P T Withington <ptw at openlaszlo.org> wrote:
> On 2007-07-11, at 15:49 EDT, Henry Minsky wrote:
>
> > On 7/11/07, James Robey <jrobey at laszlosystems.com> wrote:
> >>
> >> Wow, a major reduction in code size and removes lexically spurious
> >> layouts
> >> too!
> >>
> >>
> >> *If i were king*:
> >> <text datapath="person/" text="%s %s" format="$path{'firstName/text
> >> ()',
> >> 'lastName/text()'}" />
> >>
> >
> > I vote for that one!
>
> Problems:
>
> 1) `text` is the actual content of the text node.  You don't want the
> compiler to magically guess that if there are %'s in the content that
> it should do something different.
>
> 2) `format` is a method on text nodes.  We cause infinite pain when
> we try to have an attribute and a method with the same name.
>
> This suggestion is really choice 3 (which uses new attribute names to
> avoid the problems above):
>
>    <text datapath="person/" dataformat="'%s %s'" data=$path
> {'firstName/text()', 'lastName/text()'} />
>
> (I showed `dataformat` as being an expression, so you could have a
> variable format if you liked.)
>
> So, should I infer you and James really like choice 3?
>
>
>


More information about the Laszlo-user mailing list