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

It would be great if this syntax can be used for other components also.
-Vandana

On 7/11/07, P T Withington <[EMAIL PROTECTED]> wrote:

I like that idea!

Maybe instead of allowing multiple $path expressions, we should in
general allow multiple data arguments:

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

Then you could say things like:

<text
   textformat="You have %d items in your cart, for a total of $%6.2d"
   data="${cart.itemCount}, ${cart.total}"
/>

On 2007-07-11, at 16:25 EDT, Vagelis Papadogiannakis wrote:

> 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 <[EMAIL PROTECTED]> wrote:
>> On 2007-07-11, at 15:49 EDT, Henry Minsky wrote:
>>
>> > On 7/11/07, James Robey <[EMAIL PROTECTED]> 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?
>>
>>
>>


Reply via email to