[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: AW: simple conditional looping
At 09:03 AM 8/16/2004, Keyur wrote:
my xml code is as follows: <orders> <order id="1">ABC</order> <order id="2">XYZ</order> <order id="3">QWE</order> </orders> Cleaner than the method named after me would be to process the order nodes you have, and then pass the difference between 50 and their count to a recursive template that would emit the blank lines until zero (or less than zero) was reached: <xsl:template match="orders"> <xsl:apply-templates select="order"/> <xsl:call-template name="write-blanks"> <xsl:with-param name="counter" select="50 - count(order)"/> </xsl:call-template> </xsl:template> (Since you've already seen the recursive template I leave it to you to adjust it -- and get the numbering of the blank lines right. ;-) 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 ======================================================================
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|