Robin Berjon writes:
 > This is untested, but it's probably a pointer in the right direction, which 
 > is to use <xsp:attribute> (which works very much like <xsl:attribute>):
 > 
 > <esql:row-results>
 >      <category>
 >              <xsp:attribute name='name'>
 >                      <esql:get-string column='name'/>
 >              </xsp:attribute>
 >         <!--  add book elements after I get the categories worked out  -->
 >      </category>
 > </esql:row-results>

That did the trick. Thank you very much!

Another question: Now my XSP file is very big. My first instinct is to
put all of the boring bits (esql:driver, esql:dburl, etc.) into a
template that I can call, but XSP doesn't seem to have anything like
templates in XSLT. I would also like to change deep loops into
subroutines (err...templates) too, so it is easier to read the
structure of the document, so it is more like this:

<template name="category">
   <category>
           <xsp:attribute name="name">
                   <esql:get-string column="name">
                </xsp:attribute>
                <call-template name="books-in-category">
                   <parameter name="name">
                                <xsp:attribute name="value">
                                   <esql:get-int column="category_id"/>
                                </xsp:attribute>
                        </parameter>
                </call-template>
        </category>
</template>


<template name="books-in-category">
   <xsp:comment>Call the book template once for each book
                                         element</xsl:comment>
        ...
</template>


<template name="book">
   ...
</template>

   I have the feeling that this is the wrong approach, and would like
to heard what others think. Thanks!


-- 
--chris

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to