private boolean isNonChild(Object o) { return navigator.isAttribute(o) || navigator.isNamespace(o); }
/** @return true if the pattern matches the given node */ public boolean matches( Object node, Context context ) { Navigator navigator = context.getNavigator(); if ( nodeType == Pattern.ELEMENT_NODE ) { return navigator.isElement( node ) && name.equals( navigator.getElementName( node ) ); } else if ( nodeType == Pattern.ATTRIBUTE_NODE ) { return navigator.isAttribute( node ) && name.equals( navigator.getAttributeName( node ) ); } else { if ( navigator.isElement( node ) ) { return name.equals( navigator.getElementName( node ) ); } else if ( navigator.isAttribute( node ) ) { return name.equals( navigator.getAttributeName( node ) ); } } return false; }
/** @return true if the pattern matches the given node */ public boolean matches( Object node, Context context ) { Navigator navigator = context.getNavigator(); String uri = getURI( node, context ); if ( nodeType == Pattern.ELEMENT_NODE ) { return navigator.isElement( node ) && uri.equals( navigator.getElementNamespaceUri( node ) ); } else if ( nodeType == Pattern.ATTRIBUTE_NODE ) { return navigator.isAttribute( node ) && uri.equals( navigator.getAttributeNamespaceUri( node ) ); } return false; }
else if ( nav.isElement( obj ) || nav.isAttribute( obj ) || nav.isText( obj ) || nav.isComment( obj ) || nav.isProcessingInstruction( obj ) || nav.isDocument( obj ) || nav.isNamespace( obj ))
if (navigator.isNamespace(o1) && navigator.isAttribute(o2)) { return -1; else if (navigator.isNamespace(o2) && navigator.isAttribute(o1)) { return 1; return prefix1.compareTo(prefix2); else if (navigator.isAttribute(o1)) { String name1 = navigator.getAttributeQName(o1); String name2 = navigator.getAttributeQName(o2);
else if ( nav.isAttribute( first ) )
else if ( nav.isAttribute( first ) )
else if ( nav.isAttribute( first ) )
else if (nav.isAttribute(obj))
return false; else if (nav.isAttribute(node)) { if (getAxis() != Axis.ATTRIBUTE) { return false;
else if (nav.isAttribute(nodes.get(0)))
public Object evaluate(List nodes, Object pattern, Navigator nav) { if (nodes.size() != 1) { return false; } QName qname = null; NodeRef nodeRef = null; if (nav.isElement(nodes.get(0))) { qname = null; // should use all attributes and full text index nodeRef = ((ChildAssociationRef) nodes.get(0)).getChildRef(); } else if (nav.isAttribute(nodes.get(0))) { qname = QName.createQName( nav.getAttributeNamespaceUri(nodes.get(0)), ISO9075.decode(nav.getAttributeName(nodes.get(0)))); nodeRef = ((DocumentNavigator.Property) nodes.get(0)).parent; } String patternValue = StringFunction.evaluate(pattern, nav); DocumentNavigator dNav = (DocumentNavigator) nav; return dNav.contains(nodeRef, qname, patternValue, SearchParameters.OR); } }
else if (nav.isAttribute(nodes.get(0)))
else if (nav.isAttribute(nodes.get(0)))
public Object evaluate(List nodes, Object pattern, Navigator nav) { if (nodes.size() != 1) { return false; } QName qname = null; NodeRef nodeRef = null; if (nav.isElement(nodes.get(0))) { qname = null; // should use all attributes and full text index nodeRef = ((ChildAssociationRef) nodes.get(0)).getChildRef(); } else if (nav.isAttribute(nodes.get(0))) { qname = QName.createQName( nav.getAttributeNamespaceUri(nodes.get(0)), ISO9075.decode(nav.getAttributeName(nodes.get(0)))); nodeRef = ((DocumentNavigator.Property) nodes.get(0)).parent; } String patternValue = StringFunction.evaluate(pattern, nav); DocumentNavigator dNav = (DocumentNavigator) nav; return dNav.contains(nodeRef, qname, patternValue, SearchParameters.OR); } }
else if (nav.isAttribute(nodes.get(0)))
if ((attribute == null) || !nav.isAttribute(attribute))
if ((attribute == null) || !nav.isAttribute(attribute))