/** * Determine whether the content type (if present) is nillable * * @return true if the content test (when present) can match nodes that are nilled */ public boolean isNillable() { // this should err on the safe side return nodetest1.isNillable() && nodetest2.isNillable(); }
/** * Determine whether the content type (if present) is nillable * @return true if the content test (when present) can match nodes that are nilled */ public boolean isNillable() { // this should err on the safe side return nodetest1.isNillable() || nodetest2.isNillable(); }
/** * Determine whether the content type (if present) is nillable * @return true if the content test (when present) can match nodes that are nilled */ public boolean isNillable() { // this should err on the safe side return nodetest1.isNillable() || nodetest2.isNillable(); }
/** * Determine whether the content type (if present) is nillable * * @return true if the content test (when present) can match nodes that are nilled */ public boolean isNillable() { // this should err on the safe side return nodetest1.isNillable() && nodetest2.isNillable(); }
private String makeString(boolean forExport) { if (nodetest1 instanceof NameTest && operator == Token.INTERSECT) { int kind = nodetest1.getPrimitiveType(); String skind = kind == Type.ELEMENT ? "element(" : "attribute("; String content = ""; if (nodetest2 instanceof ContentTypeTest) { SchemaType schemaType = ((ContentTypeTest) nodetest2).getSchemaType(); if (forExport) { schemaType = schemaType.getNearestNamedType(); } content = ", " + schemaType.getEQName(); if (nodetest2.isNillable()) { content += "?"; } } String name; if (nodetest1 instanceof NameTest) { name = nodetest1.getMatchingNodeName().getEQName(); } else { name = nodetest1.toString(); } return skind + name + content + ')'; } else { String nt1 = nodetest1 == null ? "item()" : nodetest1.toString(); String nt2 = nodetest2 == null ? "item()" : nodetest2.toString(); return '(' + nt1 + ' ' + Token.tokens[operator] + ' ' + nt2 + ')'; } }
private String makeString(boolean forExport) { if (nodetest1 instanceof NameTest && operator == Token.INTERSECT) { int kind = nodetest1.getPrimitiveType(); String skind = kind == Type.ELEMENT ? "element(" : "attribute("; String content = ""; if (nodetest2 instanceof ContentTypeTest) { SchemaType schemaType = ((ContentTypeTest) nodetest2).getSchemaType(); if (forExport) { schemaType = schemaType.getNearestNamedType(); } content = ", " + schemaType.getEQName(); if (nodetest2.isNillable()) { content += "?"; } } String name = nodetest1.getMatchingNodeName().getEQName(); return skind + name + content + ')'; } else { String nt1 = nodetest1 == null ? "item()" : nodetest1.toString(); String nt2 = nodetest2 == null ? "item()" : nodetest2.toString(); return '(' + nt1 + ' ' + Token.tokens[operator] + ' ' + nt2 + ')'; } }
boolean nillable1 = ((NodeTest) t1).isNillable(); boolean nillable2 = ((NodeTest) t2).isNillable();
boolean nillable1 = ((NodeTest) t1).isNillable(); boolean nillable2 = ((NodeTest) t2).isNillable();
/** * Add the "parameters" of the type to a Dictionary containing the type information * in structured form */ public void addTypeDetails(DictionaryMap map) { if (nodetest1 instanceof NameTest && operator == Token.INTERSECT) { map.initialPut("n", new StringValue(nodetest1.getMatchingNodeName().getEQName())); if (nodetest2 instanceof ContentTypeTest) { SchemaType schemaType = ((ContentTypeTest) nodetest2).getSchemaType(); if (schemaType != Untyped.getInstance() && schemaType != BuiltInAtomicType.UNTYPED_ATOMIC) { map.initialPut("c", new StringValue(schemaType.getEQName() + (nodetest2.isNillable() ? "?" : ""))); } } } }