How can I output all of the text in a node, including the text in its children nodes while excluding the text in "a" nodes?
相关问题
- XML - XSLT - document() function inside count() fu
- Using XSLT to select after EACH instance in a stri
- XSLT open other xml files
- How to use MSbuild property in TransformXml task?
- Using asp objects in .NET - Max compatibility
相关文章
- xslt localization
- convert xml to soap request using xslt transformat
- XALAN register Extension Function like in SAXON
- How to group using XSLT
- How to reformat XML with group-adjacent (XSLT)
- AddExtensionObject - Performance
- Transforming HTML nodes with XSLT in chrome/webkit
- visual studio 2015 xsl debugging transformation fa
if you're currently processing your node.
should return all the textual content
I believe this is what you're looking for:
It selects all text nodes that are not children of anchor tags.
Make use of the built-in template rule for text nodes, which is to copy them to the result. Even for a new processing mode that you specify ("all-but-a" in the code below), the built-in rules will work: for elements, (recursively) process children; for text nodes, copy. You only need to override one of them, the rule for
<a>
elements, hence the empty template rule, which effectively strips out the text.For a complete description of how the built-in template rules work, check out the "Built-in Template Rules" section of "How XSLT Works" on my website.