@Override public E createChildElement(E parent, String tag, Map<String, String> attrs) { return createElement(Point.<N>end(parent), tag, attrs); }
@Override public E createElement(Point<N> point, String tagName, Map<String, String> attributes) { // TODO(danilatos): Validate point is in document. indexed doc should throw an exception // when calling getLocation anyway. Preconditions.checkNotNull(tagName, "createElement: tagName must not be null"); Point.checkPoint(this, point, "MutableDocumentImpl.createElement"); try { begin(); int location = doc.getLocation(point); consume(createElement(tagName, new AttributesImpl(attributes), at(location))); Point<N> result = doc.locate(location); return doc.asElement(result.isInTextNode() ? doc.getNextSibling(result.getContainer()) : result.getNodeAfter()); } finally { end(); } }