[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Table Row processing pattern

Subject: Re: Table Row processing pattern
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Oct 2004 07:41:22 -0400
xsl table row
At 2004-10-26 16:23 +1300, Fraser Crichton wrote:
I need to make sure an element actually exists in a document (sometimes it will sometimes it won't) before processing it as the row of a table (the table should only be there if the elements exist) otherwise I get XHTML / FO validation errors to do with empty table bodies.

Rather than stick markup around the apply-templates (and get the validation errors) or all kinds of conditional stuff in the template

"all kinds of conditional stuff"??


Unless I'm missing something, just do:

  <xsl:if test="qcr:ExemptionRow">
    <table ...>
      ...
      <tbody>
        <xsl:apply-templates select="qcr:ExemptionRow"/>
      </tbody>
    </table>
  </xsl:if>

I presume (??) that an effective way of dealing with the problem is to nest the markup in the first match on the elements I want to make into table rows and then "reprocess" that row and all subsequent rows.

Walking through it all I suppose that would work, but it would be a bear to maintain ... think of the long-term consequences and having other people who need to maintain your code.


What I'm interested in is what could go wrong with this solution,

Someone trying to support it later would have problems.


is it an appropriate XSL style

I think not ... I would judge it quite inappropriate when a simpler and more easily maintainable solution can be found.


and what performance implications could it have?

I suspect your way is slower than the above way ... but not by much ... I'm more concerned about understanding and working with the code.


I hope you find this helpful.

....................... Ken

--
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.