RE: [xsl] Grouping into a table (for vertical alignment)

Subject: RE: [xsl] Grouping into a table (for vertical alignment)
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 01 Jun 2004 11:11:21 -0400
Daniel,

Nice job. Glad it's working.

      <xsl:when test="position() = 1 or not(preceding-sibling::info or
preceding-sibling::input or preceding-sibling::password or
preceding-sibling::memo or preceding-sibling::check or
preceding-sibling::radio or preceding-sibling::combo)">

Are you sure you don't need to see if just the immediately preceding sibling is one of those elements?


<a>
<info>
<b>
<c>
<info>
<d>

This will test true for <c> as well as for <b> or <d>.

(I haven't traced the code well enough to know for sure: maybe this distinction comes out in the wash.)

Likewise
    <xsl:if test="following-sibling::info or following-sibling::input or
following-sibling::password or following-sibling::memo or
following-sibling::check or following-sibling::radio or
following-sibling::combo">

You might need to be checking just the single sibling immediately following, not all the elements on that axis.


test="following-sibling::*[1][self::info or self::input or self::password or
                              self::memo or self::check or self::radio or
                              self::combo]"

(Note that I haven't actually tested and don't know these to be bugs for a fact: I'm just suspicious.)

If this is the case, the logic

    <xsl:if test="following-sibling::info or following-sibling::input or
following-sibling::password or following-sibling::memo or
following-sibling::check or following-sibling::radio or
following-sibling::combo">
      <xsl:for-each select="following-sibling::node()[1]">
        <xsl:call-template name="lineInTable"/>
      </xsl:for-each>
    </xsl:if>

Could be


<xsl:apply-templates mode="lineInTable"
select="following-sibling::*[1][self::info or self::input or self::password or
self::memo or self::check or self::radio or
self::combo]"/>


(and you'd switch that named template to a moded template).

At 11:43 PM 5/30/2004, you wrote:
Just a short comment, when using <xsl:call-template/> you cannot use a
"select="... really find that inconvienent.

That's what modes are for.


Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


Current Thread