|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] xsl:copy with 'exclude'
Hello all. Here is a predicament. I'm sure, given the right knowledge, that it is simple. Lacking that knowledge, I'm finding it bloody hard! For the sake of argument... I have a datastructure like : <gui> <filling> </filling> . . .<---- lots of other stuff . </gui> I would like to copy everything in the gui tags, so I use copy-of. However, I would like to EXCLUDE the <filling> tags. I assumed that this would involve some derivative of the identity function, <xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version="1.0" > <xsl:template match="@*|*|processing-instruction()|comment()|text()"> <xsl:copy> <xsl:apply-templates select="*|@*|text()|processing-instruction()|comment()" /> </xsl:copy> </xsl:template> where it would use an "if" clause before the inner apply-templates to prevent recursion whenever it was "about to" copy a filling tag. This "about to" is causing me problems. How does the algorithm tell what node it's currently in? If I use value-of then it returns the content of that node. Would such an "if" statement approach then be the best way to tackle the problem? My apologies if this is a trivial and obvious problem. Kindest Regards, Ben
|
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
|







