Richard Lewis wrote:
> 1) Stop it from producing empty elements.
> <duration><esql:get-string column="duration" /></duration>

I guess you need to put it inside a Java if statement.
You can wrap it all in a logicsheet, for convenience:

        <my:get-element column="duration"/>

Something like this (untested):

        <xsl:template match="my:get-element">
          <xsp:logic>
            if (<esql:get-string column="[EMAIL PROTECTED]"/>.length() > 0) {
              <xsl:element name="[EMAIL PROTECTED]">
                <esql:get-string column="[EMAIL PROTECTED]"/>
              </xsl:element>
            }
          </xsp:logic>
        </xsl:template>


> 2) Some of my fields (e.g. biography) are long textual fields which
> include line spaces. Is there a way to capture those lines and wrap
> them up in elements?

Again untested:

        String biography = <esql:get-string column="biography"/>;
        for (String para : biography.split("\\n\\s*\\n")) {
          <l><xsp:expr>para</xsp:expr></l>
        }

All the other methods I can think of are less reliable, less performant
and much more lenghty.


Tobia

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

Reply via email to