xsl-list
[Top] [All Lists]

Re: [xsl] using copy-of and substring-ing retaining child elements

2006-11-23 10:34:46


I think the faq has examples of this.

Just use apply-templates with a default "identity" template, and then
specific templates for things that you don't want to copy.

So in your case you want to do something with text nodes, so that;s

<xsl:template match="p/text()"> 
or
<xsl:template match="p//text()"> 
depending on whether you just want to look in the first level or any
text inside any element in a p.


counting chars across the element hierarchy can be tricky, but possible,
or perhaps you can just get away with an approximation such as


<xsl:template 
match="p/node()[string-length(preceding-sibling::node())&gt;100]"/> 

which zaps all children of the p, after a while.

David

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>