You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the code snippet below (last 3 lines), the doc says, "A null implies Namespace.NO_NAMESPACE", but I was getting a child if passing explict null, while no hits passing Namespace.NO_NAMESPACE.
ns - Namespace to search within. A null implies Namespace.NO_NAMESPACE.
Yes, if you follow the code path getChild(cname, ns) uses ElementFilter internally and just passes through the second argument and ElementFilter has logic where a null namespace acts like a wildcard. If you just call getChild(cname) then it explicitly uses NO_NAMESPACE. Could change behavior or change the docs.
Yes, if you follow the code path getChild(cname, ns) uses ElementFilter internally and just passes through the second argument and ElementFilter has logic where a null namespace acts like a wildcard. If you just call getChild(cname) then it explicitly uses NO_NAMESPACE. Could change behavior or change the docs.
Thanks for your explanation!
I found this wildcard very useful, because I was just searching for method "get child of any namespace", that's what getChild(cname, null) is doing.
Consider the code snippet below (last 3 lines), the doc says, "A null implies Namespace.NO_NAMESPACE", but I was getting a child if passing explict
null
, while no hits passingNamespace.NO_NAMESPACE
.http://www.jdom.org/docs/apidocs/org/jdom2/Element.html#getChild(java.lang.String,%20org.jdom2.Namespace)
The text was updated successfully, but these errors were encountered: