use of org.eclipse.wst.xml.xpath2.processor.internal.types.AttrType in project webtools.sourceediting by eclipse.
the class AttributeTest method createAttrForXSDType.
private AnyType createAttrForXSDType(Node node, StaticContext sc) {
Attr attr = (Attr) node;
TypeModel typeModel = sc.getTypeModel();
TypeDefinition typedef = typeModel.getType(attr);
if (typedef != null) {
if (typedef.derivedFrom(type().namespace(), type().local(), getDerviationTypes())) {
anyType = new AttrType(attr, sc.getTypeModel());
}
} else {
anyType = new AttrType(attr, sc.getTypeModel());
}
return anyType;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.AttrType in project webtools.sourceediting by eclipse.
the class AttributeTest method createAttrType.
private AnyType createAttrType(Item at, StaticContext sc) {
anyType = new AttrType();
NodeType nodeType = (NodeType) at;
Node node = nodeType.node_value();
if (node == null) {
return anyType;
}
String nodeName = node.getLocalName();
if (wild()) {
if (type() != null) {
anyType = createAttrForXSDType(node, sc);
}
} else if (nodeName.equals(name().local())) {
if (type() != null) {
anyType = createAttrForXSDType(node, sc);
} else {
anyType = new AttrType((Attr) node, sc.getTypeModel());
}
}
return anyType;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.AttrType in project webtools.sourceediting by eclipse.
the class FnIDREF method processAttributes.
private static ResultBuffer processAttributes(Node node, List idrefs, ResultBuffer rs, EvaluationContext ec) {
if (!node.hasAttributes()) {
return rs;
}
NamedNodeMap attributeList = node.getAttributes();
for (int atsub = 0; atsub < attributeList.getLength(); atsub++) {
Attr atNode = (Attr) attributeList.item(atsub);
NodeType atType = new AttrType(atNode, ec.getStaticContext().getTypeModel());
if (atType.isID()) {
if (hasID(idrefs, atNode)) {
if (!isDuplicate(node, rs)) {
ElementType element = new ElementType((Element) node, ec.getStaticContext().getTypeModel());
rs.add(element);
}
}
}
}
return rs;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.AttrType in project webtools.sourceediting by eclipse.
the class FnID method processAttributes.
private static void processAttributes(Node node, List idrefs, ResultBuffer rs, EvaluationContext context) {
if (!node.hasAttributes()) {
return;
}
NamedNodeMap attributeList = node.getAttributes();
for (int atsub = 0; atsub < attributeList.getLength(); atsub++) {
Attr atNode = (Attr) attributeList.item(atsub);
NodeType atType = new AttrType(atNode, context.getStaticContext().getTypeModel());
if (atType.isID()) {
if (hasIDREF(idrefs, atNode)) {
if (!isDuplicate(node, rs)) {
ElementType element = new ElementType((Element) node, context.getStaticContext().getTypeModel());
rs.add(element);
}
}
}
}
}
Aggregations