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

Method insertAttr

basex-core/src/main/java/org/basex/data/Data.java:720–727  ·  view source on GitHub ↗

Inserts standalone attributes (without root element). @param pre target PRE value (insertion position) @param par target parent PRE value of node @param source clip with source data

(final int pre, final int par, final DataClip source)

Source from the content-addressed store, hash-verified

718 * @param source clip with source data
719 */
720 public final void insertAttr(final int pre, final int par, final DataClip source) {
721 // #1168/2: store one by one (otherwise, namespace declarations may be added more than once)
722 for(int s = 0; s < source.fragments; s++) {
723 final int start = source.start + s;
724 insert(pre + s, par, new DataClip(source.data, start, start + 1));
725 }
726 attSize(par, ELEM, attSize(par, ELEM) + source.size());
727 }
728
729 /**
730 * Inserts a data instance at the specified PRE value. Notes:

Callers 3

addAttributeMethod · 0.95
applyMethod · 0.80
applyMethod · 0.80

Calls 3

insertMethod · 0.95
attSizeMethod · 0.95
sizeMethod · 0.65

Tested by 1

addAttributeMethod · 0.76