NodeWrapper implements SiblingCountingNode { @Override public String getBaseURI() { String baseURI = null; NodeInfo node = this; while (node != null) { baseURI = node.getAttributeValue(StandardNames.XML_BASE); if (baseURI == null) { node = node.getParent(); } else { break; } } if (baseURI == null) { baseURI = mDocWrapper.getBaseURI(); } return baseURI; } NodeWrapper(final DocumentWrapper docWrapper, final long nodeKeyToStart); @Override Value atomize(); @Override int compareOrder(final NodeInfo node); void copy(final Receiver out, final int copyOption,
			final int locationId); @Override void generateId(final FastStringBuffer buf); @Override String getAttributeValue(final int fingerprint); @Override String getBaseURI(); @Override int getColumnNumber(); @Override Configuration getConfiguration(); @Override int[] getDeclaredNamespaces(final int[] buffer); @Override String getDisplayName(); @Override long getDocumentNumber(); @Override DocumentInfo getDocumentRoot(); @Override int getFingerprint(); @Override int getLineNumber(); @Override String getLocalPart(); @Override int getNameCode(); @Override NamePool getNamePool(); @Override int getNodeKind(); @Override NodeInfo getParent(); @Override String getPrefix(); @Override NodeInfo getRoot(); @Override final String getStringValue(); @Override final CharSequence getStringValueCS(); @Override String getSystemId(); int getTypeAnnotation(); @Override String getURI(); @Override boolean hasChildNodes(); @Override boolean isId(); @Override boolean isIdref(); @Override boolean isNilled(); @Override boolean isSameNodeInfo(final NodeInfo pOther); @Override AxisIterator iterateAxis(final byte axisNumber); @Override AxisIterator iterateAxis(final byte axisNumber, final NodeTest nodeTest); @Override void setSystemId(final String systemId); @Override SequenceIterator getTypedValue(); @Override int getSiblingPosition(); long getKey();  }
@Test public void testGetBaseURI() throws Exception { final File source = new File("src" + File.separator + "test" + File.separator + "resources" + File.separator + "data" + File.separator + "testBaseURI.xml"); final Session session = generateSession(); final NodeWriteTrx wtx = session.beginNodeWriteTrx(); final XMLEventReader reader = XMLShredder.createFileReader(source); final XMLShredder shredder = new XMLShredder.Builder(wtx, reader, Insert.ASFIRSTCHILD).commitAfterwards().build(); shredder.call(); wtx.close(); final Processor proc = new Processor(false); final NodeInfo doc = new DocumentWrapper(session, proc.getUnderlyingConfiguration()); doc.getNamePool().allocate("xml", "http: "base"); doc.getNamePool().allocate("", "", "baz"); final NameTest test = new NameTest(Type.ELEMENT, "", "baz", doc.getNamePool()); final AxisIterator iterator = doc.iterateAxis(Axis.DESCENDANT, test); final NodeInfo baz = (NodeInfo) iterator.next(); assertEquals("http: session.close(); mDatabase.close(); }