[Home] [By Thread] [By Date] [Recent Entries]
Dear Eric,
At 08:27 PM 11/7/2006, you wrote: I have an excerpt of a wddx data being generated from query data in ColdFusion 5 and I need to simplify the structure with an intermediate xsl transform so that I can consume the simplified form in a mail merge First, a simple question: are you using XSLT 2.0? The reason I ask is that in XSLT 1.0 you can't generate nodes in the result by iterating over a set of numbers, which is effectively what you are trying to do here. xsl:for-each doesn't accept "from" and "to" attributes, as its purpose is to select a set of *nodes* (from the source tree) and operate with each of them in turn as the current node. (In this, it's really just a shortcut to allow you to do this locally without calling a new template rule, which is what you'd ordinarily do.) Due to its expanded data model, however, in XSLT 2.0 you can say <xsl:for-each select="1 to $rowCount">...</xsl:for-each> and (due to the semantics of the 'to' operator) operate over a sequence of numbers (integers, actually), 1 to whatever $rowCount is. Hence, in XSLT 2.0 the correction would be a simple syntax tweak. In XSLT 1.0, however, you would have to execute this recursively, calling a template from itself and counting up to or down from $rowCount with a parameter as you did so, to effect a stop condition. (There are examples from that in the XSL FAQ.) 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 ======================================================================
|

Cart



