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

Re: apply-templates, rule-based, and saxon - REPLY

Subject: Re: apply-templates, rule-based, and saxon - REPLY
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Fri, 11 May 2001 08:21:25 +0100
saxon default template
Hi Kevin,

> But isn't this conflicting to the philosophy behind template rules,
> unless I am wrong in my thinking: only if you specify a template
> rule will that element be matched and displayed in the output? Or,
> do I need to match on every element in the source document?

The built-in templates are designed so that you get a behaviour that's
similar to HTML/CSS, where you only have to define rules for the
things that you want to be formatted *differently* - everything gets
shown, but some of it might be in a different colour or whatever. It's
an inheritance from XSL(T)'s background in formatting documents.

If you don't like that behaviour, you can add different default
templates to get the default behaviour you want.  If you want nothing
to be shown by default, then add an empty template that matches the
text() nodes:

<xsl:template match="text()" />

If you want everything to be copied by default, then add the identity
template as a default:

<xsl:template match="@*|node()">
   <xsl:copy>
      <xsl:copy-of select="@*|node()" />
   </xsl:copy>
</xsl:template>

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 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.