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

Default rule for passing matched elements thru unchang

Subject: Default rule for passing matched elements thru unchanged?
From: Brad Cox <bcox@xxxxxxxxxxxxxxxxx>
Date: Tue, 26 Feb 2002 23:56:14 -0500
xsl default rule
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.

My best shot so far doesn't do it; it deletes everything but show elements.

<xsl:template match="show" priority="1">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="*"><xsl:apply-templates/></xsl:template>

<xsl:template match="text()|@*"><xsl:value-of select="normalize-space(text())"/></xsl:template>

And of course, copy-of won't work because it copies (and ignores) the language rules (like show).

No doubt, the match="*" rule needs to generate the current node explicitly before calling apply-templates. But I don't see how to regenerate a node with its attributes.

Could someone pleae advise? Thanks!

--
Brad Cox, PhD; bcox@xxxxxxxxxxxxxxxxx 703 361 4751
o For industrial age goods there were checks and credit cards.
   For everything else there is http://virtualschool.edu/mybank
o Java Interactive Learning Environment http://virtualschool.edu/jile
o Java Web Application Architecture: http://virtualschool.edu/jwaa



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.