Use:
div/text()[string-length(normalize-space()) > 0]
This expression, when evaluated with the parent of the provided XML fragment as the context node, selects all non-white-space-only text-node children of any div
child of the context node.
Here is complete verification:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/*">
<xsl:for-each select=
"div/text()[string-length(normalize-space()) > 0]">
"<xsl:value-of select="."/>"
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
when this transformation is applied on the provided XML fragment (wrapped in a top element to become well-formed XML document):
<t>
<div>
<div>not this</div>
1<br/>
<div>not this</div>
1<br/>
1<br/>
<div>not this</div></div>
<div>
<div>not this</div>
2
<div>not this</div>
2
2
<div>not this</div></div>
<div>
<div>not this</div>
3
<div>not this</div>
3
3
<div>not this</div></div>
</t>
the wanted, correct result is produced:
"
1"
"
1"
"
1"
"
2
"
"
2
2
"
"
3
"
"
3
3
"