/// <summary> /// Get an enumerator that selects all the nodes on one of the XPath /// axes, provided they have a given name. The nodes selected are those of the principal /// node kind (elements for most axes, attributes for the attribute axis, namespace nodes /// for the namespace axis) whose name matches the name given in the second argument. /// </summary> /// <param name="axis"> /// The axis to be navigated, for example <c>XdmAxis.Child</c> for the child axis. /// </param> /// <param name="nodeName"> /// The name of the required nodes, for example <c>new QName("", "item")</c> to select /// nodes with local name "item", in no namespace. /// </param> /// <remarks> /// The nodes are returned in axis order: that is, document order for a forwards /// axis, reverse document order for a reverse axis. /// </remarks> public IEnumerator EnumerateAxis(XdmAxis axis, QName nodeName) { int kind; switch (axis) { case XdmAxis.Attribute: kind = net.sf.saxon.type.Type.ATTRIBUTE; break; case XdmAxis.Namespace: kind = net.sf.saxon.type.Type.NAMESPACE; break; default: kind = net.sf.saxon.type.Type.ELEMENT; break; } NamePool pool = ((NodeInfo)value).getConfiguration().getNamePool(); int nameCode = pool.allocate("", nodeName.Uri, nodeName.LocalName); NameTest test = new NameTest(kind, nameCode, pool); return(new SequenceEnumerator(((NodeInfo)value).iterateAxis(GetAxisNumber(axis), test))); }
/// <summary> /// Register a QName with the <c>Processor</c>. This makes comparison faster /// when the QName is compared with others that are also registered with the <c>Processor</c>. /// </summary> /// <remarks> /// A given <c>QName</c> object can only be registered with one <c>Processor</c>. /// </remarks> /// <param name="processor">The Processor in which the name is to be registered.</param> public void Register(Processor processor) { if (pool != null && pool != processor.config.getNamePool()) { throw new InvalidOperationException("A QName cannot be registered with more than one Processor"); } pool = processor.config.getNamePool(); fingerprint = pool.allocate(prefix, uri, local) & 0xfffff; }
/// <summary> /// Register a QName with the <c>Processor</c>. This makes comparison faster /// when the QName is compared with others that are also registered with the <c>Processor</c>. /// </summary> /// <param name="processor">The Processor in which the name is to be registered.</param> public void Register(Processor processor) { pool = processor.config.getNamePool(); fingerprint = pool.allocate(prefix, uri, local) & 0xfffff; }