[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: copy part of the original document
On Monday 30 December 2002 22:52, you wrote: > I want to copy the whole document, as it is, except when the heading of a > section has an attribute (name="Entwurf"). Then this section and all its > children should not be copied. ... > I have tried it with something like: > <xsl:template match="section[heading/@name='Entwurf']"> > <xsl:copy-of select=".."> > <xsl:apply-templates > select="*|@*|processing-instruction()|text()"/> </xsl:copy-of> > </xsl:template> ... > But the parser (4xslt) says, "Illegal child 'xsl:apply-templates' within > element 'xsl:copy-of'" You are on the right track: use the generic copy-through template and override it for the elements you want to change. Unfortunately, you missed some fine points. The xsl:copy-of element copies the whole selected node set into the output. The element does not take any children, this caused the error message you got. Also, you told the porcesso to copy the whole tree starting from the parent of the section, which is not what you stated above as your goal. If you want to omit the whole section having a heading with a name attribute value of "Entwurf", simply write an *empty* template: <xsl:template match="section[heading/@name='Entwurf']"/> Yes, that's all. J.Pietschmann 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
|