Xpath - matching all occurences of attribute (at any nested level)
This is an open discussion with 3 replies, filed under XSLT.
Search
How does your complete template look like?
Nils, your question was the very spur I needed to find the solution!
I thought it was a problem with this template, but in fact it was being over-ridden by another, and it wasn't nesting that was the problem. In case it helps anyone else, I had this:
<xsl:template match="ul" priority="1" mode="html"> <ul class="list-unstyled"> <xsl:copy-of select="./node()" /> </ul> </xsl:template>
So it needed to be changed to <xsl:apply-templates select="./node()" mode="html" />
for templates to apply to the ul contents, and now it's behaving as expected.
Thanks.
Glad you figured it out.
Create an account or sign in to comment.
I'm using the Ninja Technique to output content from a textarea with a TinyMCE editor.
Some people are adding entries with inline styles, and rather than getting them to clean it up, I'm trying to strip them at the point of output.
I can remove them from the top-level elements, but not from nested ones with the following:
I've tried
//@style
and*/@style
, but I'm still getting style attributes in nested elements.Could anyone suggest an xpath expression that will strip them all?
Thanks, Fish