[Laszlo-dev] [Laszlo-user] Your vote needed: Text formatting and datapaths
James Robey
jrobey at laszlosystems.com
Wed Jul 11 13:50:56 PDT 2007
I get the feeling your saying that there is an issue using the
compiler to pull apart $path() statements and doing things with them
at runtime other then what's intended. Is that what you're trying to
say?
I'd imagine this:
$path{'path/one', 'path/two'} is directly translated into
constraintOne and constraintTwo, which i guess isn't what you want -
you want that constraint to be applied when you say it is. Am i close
as to why you have to 'guess' at the contents of the text node?
On Jul 11, 2007, at 3:59 PM, P T Withington 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-dev
mailing list