XSLT - how to match any non-text node children?

I am new to XSLT and I cannot figure out how to get the xsl: if it matches when there are no child tags.

I want this to match:

<context>
    howdy
</context>

      

And this is not:

<context>
    <child>
        howdy
    </child>
</context>

      

+1


a source to share


2 answers


the corresponding xpath expression should look like this:



//context[not(./*)]

      

+2


a source


You can also specify count(child::*) = 0 .



+1


a source







All Articles