|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Value-of, copy-of
Mike Ferrando <mikeferrando@xxxxxxxxx> wrote: > I would like to exclude some elements from my copy-of output. Well, Wendell gave you already a solution for your specific problem. However, it could also be handled as special case of the more general problem "How do i copy a node tree with small changes?" (this is actually a FAQ). The general solution is to start out with the generic copy template <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template> and then override it with templates for the "small changes", for example in your case "do nothing for C1007 and C1010 elements": <xsl:template match="C1007|C1010"/> You have to be careful, this would also delete these elements elsewhere, if you want to do this only in a specific context you could write <xsl:template match="C1001/C1007|C1001/C1010"/> (delete only if they are a child of C1001) or, more general <xsl:template match="C1001//C1007|C1001//C1010"/> (delete only if they are a descendant of C1001) You see, this approach is easier to extend, but bear in mind that Wendells tailored solution might have a noticable performance advantage. Regards 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! Cast Your Vote
We need your help – Vote for DataDirect XML Products!
Winners and finalists announced at SOA World Conference in November. 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
|







