I'm looking for a way to write an xpath/schematron test to identify a specific node any time it contains any sort of non-white space, unwrapped text anywhere directly within the node (meaning possibly among, but not in a child element). So if my xml looks like this:
<root>
...
<node>
<arbitraryChild/>
Find me
<arbitraryChild>Don't find me</arbitraryChild>
more text
</node>
...
<node>
<arbitraryChild/> <arbitraryChild/>
<arbitraryChild>Don't find me</arbitraryChild>
</someNode>
...
</node>
It would identify the first instance of somenode, but not the second. I've tried about every variation of contains(...), text(), and test="..." I can think of, but clearly I'm approaching this from the wrong direction.
test="normalize-space(text()[1])"
My parser complains and fails any time I use text() and it hits a node with text with children interspersed in the middle of the string (it tells me "a sequence of more than one node is not allowed as the first argument..."). So by simply going after the first text node, I can definitively say that there is text in the node. Still, this seems dumb. There's got to be a better approach... – wolfmason