<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Thats correct; the find method on an xml.etree.ElementTree.Element instance only search through children.<div class=""><br class=""></div><div class="">The search through all descendants is done with the iterfind method, which returns a Python iterator.</div><div class=""><br class=""></div><div class="">I think the code you would use would be something like</div><div class=""><br class=""></div><div class="">list( cn.iterfind("componentInfo") )[0].get("name")</div><div class=""><br class=""></div><div class="">This is brittle code in the sense that it will fail badly if the cn node does not have any componentInfo descendant (a IndexError exception)</div><div class=""><br class=""></div><div class="">Vince Marchetti</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Mar 17, 2019, at 2:40 AM, John Carlson <<a href="mailto:yottzumm@gmail.com" class="">yottzumm@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Monaco; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0"><tbody class=""><tr class=""><td style="padding: 0in;" class=""><div id="vt100" style="border: 1pt solid windowtext; padding: 1pt;" class=""><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="od"><span style="color: rgb(191, 191, 191);" class="">import xml.etree.ElementTree </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="ev"><span style="color: rgb(191, 191, 191);" class="">from bs4 import BeautifulSoup </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="od"><span style="color: rgb(191, 191, 191);" class=""> </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="ev"><span style="color: rgb(191, 191, 191);" class="">soup = xml.etree.ElementTree.parse(open("../../../../../../specifications/X3dUni</span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="od"><span style="color: rgb(191, 191, 191);" class="">fiedObjectModel-3.3.xml")).getroot() </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="ev"><span style="color: rgb(191, 191, 191);" class="">bsoup = BeautifulSoup(open("../../../../../../specifications/X3dUnifiedObjectMod</span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="od"><span style="color: rgb(191, 191, 191);" class="">el-3.3.xml"), "xml") </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="ev"><span style="color: rgb(191, 191, 191);" class=""> </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="od"><span style="color: rgb(191, 191, 191);" class="">print("BeautifulSoup==========================================================")</span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="ev"><span style="color: rgb(191, 191, 191);" class="">cns = bsoup.find_all("ConcreteNode") </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="od"><span style="color: rgb(191, 191, 191);" class="">for cn in cns: </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="ev"><span style="color: rgb(191, 191, 191);" class=""> print(cn["name"]+" component is") </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="od"><span style="color: rgb(191, 191, 191);" class=""> print(cn.find("componentInfo")["name"]) </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="ev"><span style="color: rgb(191, 191, 191);" class=""> </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="od"><span style="color: rgb(191, 191, 191);" class="">print("ElementTree==========================================================") </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="ev"><span style="color: rgb(191, 191, 191);" class="">cns = soup.iter("ConcreteNode") </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="od"><span style="color: rgb(191, 191, 191);" class="">for cn in cns: </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="ev"><span style="color: rgb(191, 191, 191);" class=""> print(cn.get("name")+" component is") </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="od"><span style="color: rgb(191, 191, 191);" class=""> print(cn.find("componentInfo").get("name")) </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre></div></td></tr></tbody></table><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0"><tbody class=""><tr class=""><td style="padding: 0in;" class=""><div id="vt100" style="border: 1pt solid windowtext; padding: 1pt;" class=""><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="od"><span style="color: rgb(191, 191, 191);" class="">Snip<o:p class=""></o:p></span></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="od"><span style="color: rgb(191, 191, 191);" class=""><o:p class=""> </o:p></span></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="od"><span style="color: rgb(191, 191, 191);" class="">ElementTree========================================================== </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="ev"><span style="color: rgb(191, 191, 191);" class="">Anchor component is </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="od"><span style="color: rgb(191, 191, 191);" class="">Traceback (most recent call last): </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="ev"><span style="color: rgb(191, 191, 191);" class=""> File "pythonerror.py", line 17, in </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="od"><span style="color: rgb(191, 191, 191);" class=""> print(cn.find("componentInfo").get("name")) </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="ev"><span style="color: rgb(191, 191, 191);" class="">AttributeError: 'NoneType' object has no attribute 'get' </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre></div></td></tr></tbody></table><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Apparently find does not find grand children as this code works:<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0"><tbody class=""><tr class=""><td style="padding: 0in;" class=""><div id="vt100" style="border: 1pt solid windowtext; padding: 1pt;" class=""><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: inherit, serif; line-height: 14.800000190734863px; background-color: black; background-position: initial initial; background-repeat: initial initial;" class=""><span class="od"><span style="color: rgb(191, 191, 191);" class="">print(cn.find("InterfaceDefinition").find("componentInfo").get("name")) </span></span><span style="color: rgb(191, 191, 191);" class=""><o:p class=""></o:p></span></pre></div></td></tr></tbody></table><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><span style="caret-color: rgb(0, 0, 0); font-family: Monaco; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Monaco; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Monaco; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">x3d-public mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Monaco; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="mailto:x3d-public@web3d.org" style="color: rgb(149, 79, 114); text-decoration: underline; font-family: Monaco; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">x3d-public@web3d.org</a><br style="caret-color: rgb(0, 0, 0); font-family: Monaco; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" style="color: rgb(149, 79, 114); text-decoration: underline; font-family: Monaco; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a></div></blockquote></div><br class=""></div></body></html>