Example usage for org.apache.commons.jxpath.ri.model NodePointer getPointerByID

List of usage examples for org.apache.commons.jxpath.ri.model NodePointer getPointerByID

Introduction

In this page you can find the example usage for org.apache.commons.jxpath.ri.model NodePointer getPointerByID.

Prototype

public Pointer getPointerByID(JXPathContext context, String id) 

Source Link

Document

Locates a node by ID.

Usage

From source file:org.firesoa.common.jxpath.XMLModelTestCase.java

public void testID() {
    context.setIdentityManager(new IdentityManager() {
        public Pointer getPointerByID(JXPathContext context, String id) {
            NodePointer ptr = (NodePointer) context.getPointer("/");
            ptr = ptr.getValuePointer(); // Unwrap the container
            return ptr.getPointerByID(context, id);
        }// w ww  .  j  av  a  2  s . co  m
    });

    assertXPathValueAndPointer(context, "id(101)//street", "Tangerine Drive", "id('101')/address[1]/street[1]");

    assertXPathPointerLenient(context, "id(105)/address/street", "id(105)/address/street");
}