W3C home > Mailing lists > Public > www-amaya@w3.org > July to September 2005

Re: Question about transformation syntax

From: Irene Vatton <Irene.Vatton@inrialpes.fr>
Date: Tue, 13 Sep 2005 11:01:05 +0200
To: Michael Palmer <mpalmer@sciborg.uwaterloo.ca>
Cc: www-amaya@w3.org
Message-Id: <200509131101.05382.vatton@inrialpes.fr>

On Monday 12 September 2005 17:06, Michael Palmer wrote:
> Hi,
>
> In the Amaya help page 'Using the HTML.trans File' it says:
>
> "In a pattern it is possible to express conditions on sequence of tags, on
> the content of a tag and on the existence and value of attributes."
>
> All examples on that page or in HTML.trans itself only seem to use the
> sequence and nesting of tags. I cannot find an explanation of the syntax or
> examples of usage with attributes, e.g. to transform something like
>
> <p class="magic1">placeholder1</p>
>
> to e.g.
>
> <ul class="magic2">
> <li>placeholder2</li>
> <li>placeholder3</li>
> </ul>
>
> Is that at all possible?

It's possible to transmit the class attribute with following rule
Bulleted list: (p|ol|menu|dir|pre|form)+;
        {
        p > <ul class=p.class>:<li style=p.style>;
        ol > <ul class=ol.class>;
        pre > ul:li.pre;
        form > ul:li.form;
        }

"class=p.class" says that the class attribute of the created <ul> is equal to 
to class attribute of the original <p>.
I made these changes in Amaya/amaya/HTML.trans to keep the class attribute.

>
> Also, in the above quote, does 'content of a tag' refer to nested tag
> structure or to actual data within a tag? If the latter, is there a
> description of the syntax anywhere?

It concerns nested tags, but of course transformations keep tags content.

>
> Thank you, Michael

-- 
     Irène.
-----
Irène Vatton                     INRIA Rhône-Alpes
INRIA                               ZIRST
e-mail: Irene.Vatton@inria.fr       655 avenue de l'Europe
Tel.: +33 4 76 61 53 61             Montbonnot
Fax:  +33 4 76 61 52 07             38334 Saint Ismier Cedex - France
Received on Tuesday, 13 September 2005 09:02:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:30:48 UTC