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

Design problem - print header information only if some

Subject: Design problem - print header information only if some element exists in the detail.
From: "Dung, Ming-tzung" <Ming-tzung_Dung@xxxxxxxxxxxxx>
Date: Wed, 24 Apr 2002 11:37:12 -0600
print header
   I have an input XML source as the following:
<!-- could have multiple detail information. -->
    I need to output the content of the Header ONLY IF certain information
exists in the detail. (Let us called this as the satisfied Detail). Besides,
each satisfied Detail needed to print out after the Header. The design
forces also includes that the testing condition may grow complex in the
I guess that I have two ways in solving this; however, none of the solution
I come up with is not a good solution.
  Pass the document to one XSL for filtering out the 'unsatisfied' Detail.
Then pass the filtered XML to the XSLT again for  output. 
  ==>Disadvantage - the performance.
   Use <xsl:for-each > to select the satisfied Detail node.
   ==>Disadvantage: If the condition grows complex, I am not sure whether
the select attribute within the <xsl:for-each> can fulfill the needs. In
addition, If there are multiple detail, how I can print the Detail element
once only within the <xsl:for-each> body? (The only solution for this I can
see is have two <xsl:for-each>. The first one is check there is any Detail
satisfied. If yes, print the header information. Then the second print out
the detail. )

  Thanks in advance!!

Ming-tzung Dung

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.