[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: how to <xsl:apply-templates /> for ELEMENT nodes o
Hi, > 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"/>  The same advice as always, using // is expensive and you should avoid it if you can. > <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()" /> Simple "text" will suffice. > While this works, surely there is a more elegant way. The source XML There's nothing inelegant about your solution. The other approach, possibly preferable, is that you don't select the nodes you don't want to be processed. That is, instead of <xsl:apply-templates /> use <xsl:apply-templates select="*" /> or what ever the content model contains. Cheers, Jarno - Epsilon Minus: Freedom
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|