verifyObjectState(new ODOMXPath(attribute, NAMESPACES), xpath, map);
// Check using text.
xpath = "/parent/text()";
parent = new Element("parent");
Text text = new Text("textExample");
parent.addContent(text);
verifyObjectState(new ODOMXPath(text), xpath, emptyMap);
verifyObjectState(new ODOMXPath(text, namespacesNull), xpath, emptyMap);
verifyObjectState(new ODOMXPath(text, NAMESPACES), xpath, map);
// Check using ODOMObservable.
xpath = "/parent/textExample";
parent = new Element("parent");
ODOMObservable node = (ODOMElement) factory.element("textExample");
parent.addContent((Element) node);
verifyObjectState(new ODOMXPath(node), xpath, emptyMap);
verifyObjectState(new ODOMXPath(node, namespacesNull), xpath, emptyMap);
verifyObjectState(new ODOMXPath(node, NAMESPACES), xpath, map);
// Check using element.
xpath = "/parent/element";
parent = new Element("parent");
Element start = new Element("startElement");
element = new Element("element");
parent.addContent(element);
verifyObjectState(new ODOMXPath(start, element), xpath, emptyMap);
verifyObjectState(new ODOMXPath(start, element, namespacesNull), xpath,
emptyMap);
verifyObjectState(new ODOMXPath(start, element, NAMESPACES), xpath, map);
// Check using attribute.
xpath = "/parent/@attribute";
parent = new Element("parent");
start = new Element("startElement");
attribute = new Attribute("attribute", "");
parent.setAttribute(attribute);
verifyObjectState(new ODOMXPath(start, attribute), xpath, emptyMap);
verifyObjectState(new ODOMXPath(start, attribute, namespacesNull), xpath,
emptyMap);
verifyObjectState(new ODOMXPath(start, attribute, NAMESPACES), xpath, map);
// Check using text.
xpath = "/parent/text()";
parent = new Element("parent");
text = new Text("textExample");
parent.addContent(text);
start = new Element("startElement");
verifyObjectState(new ODOMXPath(start, text), xpath, emptyMap);
verifyObjectState(new ODOMXPath(start, text, namespacesNull), xpath,
emptyMap);