[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl/xslt coding standard
Hi Jeni,
You wrote: If exclude-result-prefixes works OK, why introduce something new? OK. I understand the problem now. How about another approach to the problem? Generalise the whitespace stripping process to also strip nominated elements? This may even have the benefit of improving runtime performance by not having to skip over embedded documentation elements during processing. Proposal: In addition to <xsl:strip-space>, allow <xsl:strip-nodes> This element requires a 'select' attribute. Any node matching the XPath expression given by the 'select' attribute is stripped from the stylesheet, including its descendants. The default value is 'processing-instruction()| text()[string-length(normalize-space()) = 0]'. xsl:strip-space and xsl:preserve-space modify the nodes to be stripped in the obvious manner. For example, to specify that embedded DocBook elements get stripped: <xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:doc='http://www.docbook.org/documentation/1.0'> <xsl:strip-nodes select='doc:book|doc:article'/> <xsl:template match='/'> <p>This appears in the result</p> <doc:book xmlns=''> <title>Embedded Doco</title> <p>This does not appear in the result</p> </doc:book> </xsl:template> </xsl:stylesheet> -- Steve Ball | XSLT Standard Library | Training & Seminars Zveno Pty Ltd | Web Tcl Complete | XML XSL Schemas http://www.zveno.com/ | TclXML TclDOM | Tcl, Web Development Steve.Ball@xxxxxxxxx +---------------------------+--------------------- Ph. +61 2 6242 4099 | Mobile (0413) 594 462 | Fax +61 2 6242 4099 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
|