示例#1
0
 private XedCursor findChildAttr(
     final Attr attr, final XedCursor cursorParent, final XedCursor cursorType) {
   final Xed xed = cursorParent.getXed();
   final Element elementParent = cursorParent.getElement();
   final TypeInstance typeInstance = cursorType.getTypeInstance();
   final Attr attrIt =
       (elementParent == null) ? null : ElementU.getAttributeNode(elementParent, attr.getName());
   return ((attrIt == null) ? null : new XedCursor(xed, cursorType, attrIt, 0, typeInstance));
 }
示例#2
0
 public final XedCursor findTypeInstanceChild(final String name, final XedCursor cursor) {
   final Element element = cursor.getElement();
   final XedCursor cursorType = findTypeInstance(name, cursor);
   XedCursor cursorChild = null;
   final TypeInstance typeInstance = cursorType.getTypeInstance();
   final TypeInstance.NodeType nodeType =
       (typeInstance == null) ? null : typeInstance.getNodeType();
   if (TypeInstance.NodeType.attribute.equals(nodeType)) {
     cursorChild = findChildAttr(ElementU.getAttributeNode(element, name), cursor, cursorType);
   } else if (TypeInstance.NodeType.element.equals(nodeType)) {
     cursorChild =
         findChildElement(ElementU.getChild(element, typeInstance.getQName()), cursor, cursorType);
   }
   return cursorChild;
 }