[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: default template (was:RE: text() and not())
Andrew,
Also, following David's example (below), if inside x you only want to process a, an <xsl:apply-templates select="a"/> is very effective. Combining this with the empty template approach David shows, and you almost never have to suppress text nodes. Getting rid of text you don't want by overriding the default template matching "text()" seems like an effective expedient until you start discovering how often you need to override your own new default. I think that's the situation you're in. One gotcha to watch out for is that the expression <xsl:value-of select="text()"/> does not get you the value of all text node children of the current node, but only of the first one. So xsl:value-of is less useful than it might first appear, and has to be used with this limitation in mind. Cheers, Wendell At 10:57 AM 1/8/02, David wrote: If you have an element <x> that has all sorts of children that yuu don't want to process, it is more nomal to have a template for x which does not call apply-templates and so naturally doesn't process its children than it is to use a template for x that does use apply templates and then make templates for each child that does nothing. ====================================================================== 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
|
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
|