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

how to <xsl:apply-templates /> for ELEMENT nodes only?

Subject: how to <xsl:apply-templates /> for ELEMENT nodes only?
From: Terence Kearns <terencek@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 30 Mar 2004 17:03:54 +1000
xsl apply templates node
At the moment, I have

<!-- lots of imported templates in this XSL file -->
<xsl:template match="/">
<html>
<head>
<title>UC Policy Database</title>
<link rel="StyleSheet" type="text/css" href="policydb_content.css"/>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<xsl:call-template name="header"/>
<xsl:apply-templates select="//menu" mode="menu"/>&#xa0; <xsl:apply-templates />
<xsl:call-template name="footer"/>
</body>
</html>
</xsl:template>


But in order to stop the text node from being spewed out by default, I have to explicityly surpress it with
<xsl:template match="//text()" />


While this works, surely there is a more elegant way. The source XML uses an informal schema designed by someone else which mixes text with elements (document centric schema). I'm halfway through overhauling their XSLT templates and I just want all templates matching any type of element to be applied.



--
Terence Kearns
ph: +61 2 6201 5516
Enterprise Applications Developer
Enterprise Systems Support and Development
Information and Communications Technology (ICT) Services
University of Canberra, Australia - http://www.canberra.edu.au

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.