public DTMAxisIterator getAxisIterator(final int axis) { switch (axis) { case Axis.CHILD: case Axis.DESCENDANT: return new SimpleIterator(SimpleIterator.DIRECTION_DOWN); case Axis.PARENT: case Axis.ANCESTOR: return new SimpleIterator(SimpleIterator.DIRECTION_UP); case Axis.ANCESTORORSELF: return (new SimpleIterator(SimpleIterator.DIRECTION_UP)).includeSelf(); case Axis.DESCENDANTORSELF: return (new SimpleIterator(SimpleIterator.DIRECTION_DOWN)).includeSelf(); case Axis.SELF: return new SingletonIterator(); default: return EMPTY_ITERATOR; } }
public DTMAxisIterator getTypedAxisIterator(final int axis, final int type) { switch (axis) { case Axis.CHILD: case Axis.DESCENDANT: return new SimpleIterator(SimpleIterator.DIRECTION_DOWN, type); case Axis.PARENT: case Axis.ANCESTOR: return new SimpleIterator(SimpleIterator.DIRECTION_UP, type); case Axis.ANCESTORORSELF: return (new SimpleIterator(SimpleIterator.DIRECTION_UP, type)).includeSelf(); case Axis.DESCENDANTORSELF: return (new SimpleIterator(SimpleIterator.DIRECTION_DOWN, type)).includeSelf(); case Axis.SELF: return new SingletonIterator(type); default: return EMPTY_ITERATOR; } }
public DTMAxisIterator getAxisIterator(final int axis) { switch (axis) { case Axis.CHILD: case Axis.DESCENDANT: return new SimpleIterator(SimpleIterator.DIRECTION_DOWN); case Axis.PARENT: case Axis.ANCESTOR: return new SimpleIterator(SimpleIterator.DIRECTION_UP); case Axis.ANCESTORORSELF: return (new SimpleIterator(SimpleIterator.DIRECTION_UP)).includeSelf(); case Axis.DESCENDANTORSELF: return (new SimpleIterator(SimpleIterator.DIRECTION_DOWN)).includeSelf(); case Axis.SELF: return new SingletonIterator(); default: return EMPTY_ITERATOR; } }
public DTMAxisIterator getTypedAxisIterator(final int axis, final int type) { switch (axis) { case Axis.CHILD: case Axis.DESCENDANT: return new SimpleIterator(SimpleIterator.DIRECTION_DOWN, type); case Axis.PARENT: case Axis.ANCESTOR: return new SimpleIterator(SimpleIterator.DIRECTION_UP, type); case Axis.ANCESTORORSELF: return (new SimpleIterator(SimpleIterator.DIRECTION_UP, type)).includeSelf(); case Axis.DESCENDANTORSELF: return (new SimpleIterator(SimpleIterator.DIRECTION_DOWN, type)).includeSelf(); case Axis.SELF: return new SingletonIterator(type); default: return EMPTY_ITERATOR; } }
/** * Lookup a namespace URI from a prefix starting at node. This method * is used in the execution of xsl:element when the prefix is not known * at compile time. */ public String lookupNamespace(int node, String prefix) throws TransletException { int anode, nsnode; final AncestorIterator ancestors = new AncestorIterator(); if (isElement(node)) { ancestors.includeSelf(); } ancestors.setStartNode(node); while ((anode = ancestors.next()) != DTM.NULL) { final NamespaceIterator namespaces = new NamespaceIterator(); namespaces.setStartNode(anode); while ((nsnode = namespaces.next()) != DTM.NULL) { if (getLocalName(nsnode).equals(prefix)) { return getNodeValue(nsnode); } } } BasisLibrary.runTimeError(BasisLibrary.NAMESPACE_PREFIX_ERR, prefix); return null; }
/** * Lookup a namespace URI from a prefix starting at node. This method * is used in the execution of xsl:element when the prefix is not known * at compile time. */ public String lookupNamespace(int node, String prefix) throws TransletException { int anode, nsnode; final AncestorIterator ancestors = new AncestorIterator(); if (isElement(node)) { ancestors.includeSelf(); } ancestors.setStartNode(node); while ((anode = ancestors.next()) != DTM.NULL) { final NamespaceIterator namespaces = new NamespaceIterator(); namespaces.setStartNode(anode); while ((nsnode = namespaces.next()) != DTM.NULL) { if (getLocalName(nsnode).equals(prefix)) { return getNodeValue(nsnode); } } } BasisLibrary.runTimeError(BasisLibrary.NAMESPACE_PREFIX_ERR, prefix); return null; }
return new AncestorIterator(); case Axis.ANCESTORORSELF: return (new AncestorIterator()).includeSelf(); case Axis.ATTRIBUTE: return new AttributeIterator(); return new DescendantIterator(); case Axis.DESCENDANTORSELF: return (new DescendantIterator()).includeSelf(); case Axis.FOLLOWING: return new FollowingIterator();
return new AncestorIterator(); case Axis.ANCESTORORSELF: return (new AncestorIterator()).includeSelf(); case Axis.ATTRIBUTE: return new AttributeIterator(); return new DescendantIterator(); case Axis.DESCENDANTORSELF: return (new DescendantIterator()).includeSelf(); case Axis.FOLLOWING: return new FollowingIterator();
return (new AncestorIterator()); case Axis.ANCESTORORSELF : return ((new AncestorIterator()).includeSelf()); case Axis.ATTRIBUTE : return (new AttributeIterator()); break; case Axis.DESCENDANTORSELF : iterator = (new DescendantIterator()).includeSelf(); break; case Axis.FOLLOWING :
return new TypedAncestorIterator(type); case Axis.ANCESTORORSELF: return (new TypedAncestorIterator(type)).includeSelf(); case Axis.ATTRIBUTE: return new TypedAttributeIterator(type); return new TypedDescendantIterator(type); case Axis.DESCENDANTORSELF: return (new TypedDescendantIterator(type)).includeSelf(); case Axis.FOLLOWING: return new TypedFollowingIterator(type);
return new TypedAncestorIterator(type); case Axis.ANCESTORORSELF: return (new TypedAncestorIterator(type)).includeSelf(); case Axis.ATTRIBUTE: return new TypedAttributeIterator(type); return new TypedDescendantIterator(type); case Axis.DESCENDANTORSELF: return (new TypedDescendantIterator(type)).includeSelf(); case Axis.FOLLOWING: return new TypedFollowingIterator(type);
return (new AncestorIterator()); case Axis.ANCESTORORSELF : return ((new AncestorIterator()).includeSelf()); case Axis.ATTRIBUTE : return (new AttributeIterator()); break; case Axis.DESCENDANTORSELF : iterator = (new DescendantIterator()).includeSelf(); break; case Axis.FOLLOWING :
return (new TypedAncestorIterator(type)); case Axis.ANCESTORORSELF : return ((new TypedAncestorIterator(type)).includeSelf()); case Axis.ATTRIBUTE : return (new TypedAttributeIterator(type)); break; case Axis.DESCENDANTORSELF : iterator = (new TypedDescendantIterator(type)).includeSelf(); break; case Axis.FOLLOWING :
return (new TypedAncestorIterator(type)); case Axis.ANCESTORORSELF : return ((new TypedAncestorIterator(type)).includeSelf()); case Axis.ATTRIBUTE : return (new TypedAttributeIterator(type)); break; case Axis.DESCENDANTORSELF : iterator = (new TypedDescendantIterator(type)).includeSelf(); break; case Axis.FOLLOWING :