Hi all 

Before beeing able to vote I should understand: How do formatting according
to #1 (using attribute 'layout') and formatting acordung to #2 (using
method 'format' and string-argument '%s %s') compare? While #1 obviously is
simple layout along y-axis, I cannot see in what kind of 'formatting' is
specified by the string '%s %s'. What, precisely, is that string about to
do, what's its meaning? Apologies, if that' a silly question.

Peter


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David Temkin
Sent: Friday, July 13, 2007 4:44 PM
To: P T Withington
Cc: [email protected] Users; OpenLaszlo development and bug
reporting
Subject: Re: [Laszlo-user] [Laszlo-dev] Your vote needed: Text
formattingand datapaths

#2 is good. Keeps things (moderately) straightforward and reduces the
amount of complexity for users and for implementors.

On Jul 11, 2007, at 11:43 AM, P T Withington wrote:

> We recently added a `format` method to the text tag that allows you to 
> format the content of a text tag using the standard printf-style 
> controls.  We think this will be most useful when data binding a text 
> node.  As an example, if you have an XML dataset of people with 
> firstName and lastName nodes, you currently would display each element 
> by saying:
>
> 1.  <view datapath="person/" layout="axis: x">
>       <text text="$path{'firstName/text()'}" />
>       <text text="$path{'lastName/text()'}" />
>     </view>
>
> With the addition of the format method, you can now say this more 
> compactly, using only 1 node, instead of 3 (which is also more
> efficient):
>
> 2.  <text datapath="person/"
>       ondata="format('%s %s', datapath.xpathQuery('firstName/text
> ()'), datapath.xpathQuery('lastName/text()'))"
>     />
>

Reply via email to