Select all "children" that contain a certain attribute ("attribute_nm") but exclude all children of the children (and so on) that contain the same attribute.
The "real" case:
How to adjust this query...
$("#main_span").find("[attribute_nm]");
... to select only the items appointed below...
<span id="main_span">
<span attribute_nm> <!-- Select that PARENT and its contents! -->
<!-- MORE HTML... -->
<span attribute_nm> <!-- DO NOT select that CHILD and its contents! -->
</span>
<!-- MORE HTML... -->
<span attribute_nm> <!-- Do not select that child and its contents! -->
</span>
<!-- MORE HTML... -->
<span attribute_nm> <!-- Do not select that child and its contents! -->
</span>
<!-- MORE HTML... -->
</span>
<span attribute_nm> <!-- Select that PARENT and its contents! -->
<!-- MORE HTML... -->
<span attribute_nm> <!-- DO NOT select that CHILD and its contents! -->
</span>
<!-- MORE HTML... -->
<span attribute_nm> <!-- Do not select that child and its contents! -->
</span>
<!-- MORE HTML... -->
<span attribute_nm> <!-- Do not select that child and its contents! -->
</span>
<!-- MORE HTML... -->
</span>
<!-- MORE HTML... -->
</span>