W3C home > Mailing lists > Public > public-qt-comments@w3.org > March 2003

Re: Use Cases 1.2.4.1 (TREE-Q1): wrong solution

From: Jonathan Robie <jonathan.robie@datadirect-technologies.com>
Date: Thu, 06 Mar 2003 13:34:08 -0500
Message-Id: <5.2.0.9.0.20030306112704.03b13e28@ncmail.datadirect-technologies.com>
To: MW <onlymails@gmx.net>, public-qt-comments@w3.org

At 05:07 PM 3/6/2003 +0100, MW wrote:

>I have another shorter and correct TREE-Q1:
>
>define function toc($book as element) as element*
>{
>         for $section in $book/section
>         return
>                 <section>
>                 { $section/@* , $section/title , toc($section) 
> }
>                 </section>
>}
>
><toc>
>{ toc(document("book.xml")/book) }
></toc>

Hi Michael,

I took that solution, just changing $book to $book-or-section in the 
function. Your email does not contain your full name - if you want credit 
for this solution in the document, please let me know your complete name.

>-----------------------------------------------------
>
>Furthermore you can express TREE-Q6 similarly as:
>
>define function toc($book as element) as element*
>{
>         for $section in $book/section
>         return
>                 <section>
>                 { $section/@* , $section/title }
>                         <figcount>
>                         { count($section/figure) }
>                         </figcount>
>                 { toc($section) }
>                 </section>
>}
>
><toc>
>{ toc(document("book.xml")/book) }
></toc>
>
>
>Michael
Received on Thursday, 6 March 2003 13:34:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:14:24 GMT