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

Re: what are node set fragments and why are they ruining my

Subject: Re: what are node set fragments and why are they ruining my life?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 15 Dec 1999 10:38:40 GMT
Re: what are node set fragments and why are they ruining my
> - Phil Lanch and David Carlisle suggest using
> <xsl:for-each select="xt:node-set($members)">

well I said that this extension could be used to get back a node set,
but probably (if I understood quite what you want to do, which I don't)
you wouldn't need this as you could avoid building a result tree
fragment too early (which appears to be your problem)

> But even though I can do a <xsl:copy-of select="$members"/> in the main template,
> <xsl:for-each select="$members"> gives me a "cannot convert to node-set" error,

That's to be expected.

> and <xsl:for-each select="xt:node-set($members)"> has only 1 loop
> pass, not 2.
well node-set isn't standard of course, but probably it is putting a
root node on it, so in that case you probaly want
  "xt:node-set($members)/*"

> I have a god-awful select expression that I want to re-use in various
> places. I could use an ENTITY, but i'd rather just modularize by
> using a call-template 

so why not just do that?

If you have

<xsl:template name="god-awful">
  <xsl:apply-templates
     select="foo|a/b[@xx]/c[@aa and @dd='this']|aa[dd[cc]]"/>
</xsl:template>


then you can just use

<xsl:call-template name="god-awful"/>

whenever you want to do an apply based on that select expression in some
other template.

David


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


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.