MCPcopy Create free account
hub / github.com/BaseXdb/basex / isId

Method isId

basex-core/src/main/java/org/basex/util/XMLToken.java:281–284  ·  view source on GitHub ↗

Checks if the specified name is an ID/IDREF attribute (IDREF: local name must contain 'idref'; ID: local name must contain 'id', but not 'idref'). The correct approach would be to gather all ID/IDREF attributes and store them as metadata. @param name name @param idref ID/IDREF flag @return result of

(final byte[] name, final boolean idref)

Source from the content-addressed store, hash-verified

279 * @return result of check
280 */
281 public static boolean isId(final byte[] name, final boolean idref) {
282 final byte[] id = lc(local(name));
283 return idref ? contains(id, REF) : contains(id, ID) && !contains(id, REF);
284 }
285
286 /**
287 * Encodes a token to a valid NCName.

Callers 3

idsMethod · 0.95
addMethod · 0.95
containsIdsMethod · 0.95

Calls 3

containsMethod · 0.65
lcMethod · 0.45
localMethod · 0.45

Tested by

no test coverage detected