|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Data-driven Display of records with variable numbe
Rich,
The usual approach to this is to use the name() or local-name() function to extract the names of your elements as strings, and then do string testing against those names in the predicate of an XPath, to select them. So when your context node is an unknown element type, you can still get all the nodes of that type that are, say, children of some othe node $parent, by saying $parent/*[name()=name(current())] ... you can even parameterize a name (again as a string) and pass it around between templates. So let's say you wanted to process a set of $records ... you could say <xsl:for-each select="$records">
<xsl:variable name="thisrecord" select=".">
<xsl:for-each select="/headers/*">
<xsl:apply-templates
select="$thisrecord/*[local-name()=local-name(current())]"/>
</xsl:for-each>
</xsl:for-each>... which applies templates only to the children of each member of $records whose names appear as the name of an element child of /headers, in the order they appear there. (In this example I used the local-name() function so you could keep your elements in separate namespaces if you wanted.) I hope this is enough to get you going. Cheers, Wendell At 04:05 PM 12/9/2004, you wrote: Is this possible in xslt-1.0? ====================================================================== 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
|

Cart








