if (!(nodeTest instanceof NameTest)) {
break;
}
NameTest nameTest = (NameTest) nodeTest;
QName childName = getQualifiedName(nameTest.getFingerprint(),
namePool, contextUris);
if (Axis.CHILD == axisExpr.getAxis()) {
if (NodeKindTest.ELEMENT.getNodeKindMask() != nameTest.getNodeKindMask()) {
break;
}
NodeList children = ((Element) contextNode).getElementsByTagNameNS(childName.getNamespaceURI(),
childName.getLocalPart());
if ((children == null) || (children.getLength() == 0)) {
Node child = document.createElementNS(childName.getNamespaceURI(),
DOMUtils.getQualifiedName(childName));
contextNode.appendChild(child);
contextNode = child;
} else if (children.getLength() == 1) {
contextNode = children.item(0);
} else {
break;
}
} else if (Axis.ATTRIBUTE == axisExpr.getAxis()) {
if (NodeKindTest.ATTRIBUTE.getNodeKindMask() != nameTest.getNodeKindMask()) {
break;
}
Attr attribute = ((Element) contextNode).getAttributeNodeNS(childName.getNamespaceURI(), childName.getLocalPart());
if (attribute == null) {