English grammar issue in Template::Semantic::Cookbook

9 views
Skip to first unread message

Terrence Brannon

unread,
Feb 14, 2010, 12:57:12 AM2/14/10
to squatting-framework
I'm glad that the author of Template::Semantic has joined us here on
the squatting mailing list, where all topics are on topic, including
wondering if he's related to Isao Tomita, the synth musician (here's
one of my favorite songs from him: http://www.youtube.com/watch?v=38W9Os31oMk
)

Anyway, I'm wondering about the first sentence in this section:
http://bit.ly/dqBgUR

"""The following example is output with NOT <div class="foo">foo</div>
like <div>foo</div> because LibXML cannot find class attribute in
<div>."""

I think this should be:

"""The following example is NOT output as <div class="foo">foo</div>
but instead as <div>foo</div> because LibXML cannot find class
attribute in <div>."""

What do the English experts in the group think?

Brock

unread,
Feb 14, 2010, 11:37:44 AM2/14/10
to squatting...@googlegroups.com
On 2010.02.13.21.57, Terrence Brannon wrote:
| I'm glad that the author of Template::Semantic has joined us here on
| the squatting mailing list, where all topics are on topic, including
| wondering if he's related to Isao Tomita, the synth musician (here's
| one of my favorite songs from him: http://www.youtube.com/watch?v=38W9Os31oMk
| )

Indeed, greetings and welcome!

I was comparing Template::Semantic with my DOMTemplate, and the biggest
difference (for the API, internals are quite a bit better for
Template::Semantic) is that my templates use 'set' which is similar to
'process'. The big difference is that 'set' modifies the document
in-place. So I have some code that I'll change from this:

my $tpl = DOMTemplate->new('tpl/accounting.html');
$tpl->set('.username' => $username);
$tpl->set('#item_name' => "Deposit for $username");
# ...
$self->display( $tpl->render );

to this:

my $tpl = Template::Semantic->new('tpl/accounting.html');
$tpl = $tpl->process('.username' => $username);
$tpl = $tpl->process('#item_name' => "Deposit for $username");
# ...
$self->display( $tpl->as_string );

after fixing up my template a bit to be more parseable, of course. So
the question is -- any chance of getting a ->set that does ->process in
place for Template::Semantic? :)

The table-looping mechanism is different too, but I like how
Template::Semantic does it. In DOMTemplate I have a fill_rows method
that is more specific to tables, so less useful overall.

Good stuff! :)

--Brock

Tomita

unread,
Feb 15, 2010, 12:39:53 AM2/15/10
to squatting-framework
> I'm glad that the author of Template::Semantic has joined us here on
> the squatting mailing list, where all topics are on topic, including
> wondering if he's related to Isao Tomita, the synth musician (here's
> one of my favorite songs from him:http://www.youtube.com/watch?v=38W9Os31oMk
> )
Thank you for inviting me.

> I think this should be:
>
> """The following example is NOT output as <div class="foo">foo</div>
> but instead as <div>foo</div>  because LibXML cannot find class
> attribute in <div>."""
>
> What do the English experts in the group think?

I think that you are an expert from me ;)
committed it.
http://github.com/tomi-ru/Template-Semantic/commit/4874be595cae972e305f696f808478fa64f6f172

Reply all
Reply to author
Forward
0 new messages