[AWS] [Template Parser] How to use Cursor_Tag
Pascal Obry
pascal.obry at gmail.com
Mon May 3 21:58:03 CEST 2010
Mathieu,
> Currently , I'm encountering some difficulties. I wrote to Pascal Obry
> which advised me to ask my questions in this mailinglist.
> So, I''ve a data model which contains *messages*, these messages
> contain *words*.
>
> The part of the template dedicated to these messages looks like :
>
> @@TABLE@@
> <message name="@_MSG_NAME_@">....
> <word name="@_WORD_NAME_@">....
> @@END_TABLE@@
This looks like a matrix, no?
If MSG_NAME is a vector : "v1" & "v2"
and WORD_NAME a vector of vector:
"n1.1" & "n1.2"
"n2.1" & "n2.2"
Then:
@@TABLE@@
<message name="@_MSG_NAME_@">....
@@TABLE@@
<word name="@_WORD_NAME_@">....
@@END_TABLE@@
@@END_TABLE@@
will be transformed as:
<message name="v1">....
<word name="n1.1">....
<word name="n1.2">....
<message name="v2">....
<word name="n2.1">....
<word name="n2.2">....
Isn't this what you want?
> Actually, I don't know how I could find the good words matching a given
> message. Moreover, a given word could belong to many different messages.
Not sure I understand this.
> I've tried to understand how dynamic *Cursor_Tag *(see template parser
> API) works, because it seems to be the adequated tag to handle complexe
> structures.
Right. But what you have here is a basic structure for the templates
engine :)
Pascal.
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://www.obry.net - http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B
More information about the AWS
mailing list