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

Re: Default rule for passing matched elements thru unc

Subject: Re: Default rule for passing matched elements thru unchanged?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 27 Feb 2002 11:56:37 -0500
rule 37 default
Brad,

To do this you want to adapt the identity stylesheet, which overrides XSLT's default templates with templates that copy the nodes, instead of just passing through them and copying their text content.

You can find the identity stylesheet in the XSLT spec (section 7.5) or in any number of places including the XSL FAQ, the list archives etc.

Heck, here it is:

<xsl:template match="node()|@*">
  <xsl:copy name="{name()}">
    <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
</xsl:template>

Your templates for 'show' etc. will override this one, but anything that you haven't matched with your own template, will simply be copied through by this one. (For elucidation of any of its mysteries, do a search for "XSLT identity transformation".)

BTW, are you the Brad Cox who wrote that awesome book about the economics of distributed objects? Cool. I lent my copy to someone and never got it back.

Cheers,
Wendell

At 11:56 PM 2/26/2002, you wrote:
I'm baffled by how to build an xslt stylesheet that recognizes specified elements while passing those not specified through unchanged. The application intends to add programming capabilities to ordinary xhtml documents; e.g. show, if, foreach, etc, where these might appear anywhere, such as within xhtml elements. I'd rather not enumerate every imaginable xhtml element name; I don't have the complete list.


======================================================================
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
======================================================================


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.