Search in sources :

Example 6 with AxisIterator

use of net.sf.saxon.tree.iter.AxisIterator in project sirix by sirixdb.

the class TestNodeWrapper method testGetAttributeValue.

@Test
public void testGetAttributeValue() throws SirixException {
    final Processor proc = new Processor(false);
    node = new NodeWrapper(new DocumentWrapper(mHolder.getSession(), proc.getUnderlyingConfiguration()), 1);
    final AxisIterator iterator = node.iterateAxis(Axis.ATTRIBUTE);
    final NodeInfo attribute = (NodeInfo) iterator.next();
    node.getNamePool().allocate(attribute.getPrefix(), attribute.getURI(), attribute.getLocalPart());
    // Only supported on element nodes.
    // node = (NodeWrapper) node.getParent();
    assertEquals("j", node.getAttributeValue(attribute.getFingerprint()));
}
Also used : Processor(net.sf.saxon.s9api.Processor) NodeInfo(net.sf.saxon.om.NodeInfo) AxisIterator(net.sf.saxon.tree.iter.AxisIterator) NameTest(net.sf.saxon.pattern.NameTest) Test(org.junit.Test)

Aggregations

NameTest (net.sf.saxon.pattern.NameTest)6 AxisIterator (net.sf.saxon.tree.iter.AxisIterator)6 Test (org.junit.Test)5 NodeInfo (net.sf.saxon.om.NodeInfo)3 Processor (net.sf.saxon.s9api.Processor)2 File (java.io.File)1 XMLEventReader (javax.xml.stream.XMLEventReader)1 NamespaceNodeImpl (net.sf.saxon.tree.iter.NamespaceIterator.NamespaceNodeImpl)1 NodeWriteTrx (org.sirix.api.NodeWriteTrx)1 Session (org.sirix.api.Session)1 XMLShredder (org.sirix.service.xml.shredder.XMLShredder)1