/** * Returns the local name of an attribute node. * * @param node * attribute node, must not be null * @return a string representing the unqualified local name if the node is an attribute, or <code>null</code> * otherwise */ @Override public String getAttributeName( Object node ) { String name = null; if ( isAttribute( node ) ) { AttributeNode<?> attr = (AttributeNode<?>) node; name = attr.getLocalName(); } return name; }
/** * Returns the namespace URI of an element node. * * @param node * the element node * @return the namespace if the argument is an element, or null otherwise */ @Override public String getElementNamespaceUri( Object node ) { String ns = null; if ( isElement( node ) ) { ElementNode<?> el = (ElementNode<?>) node; ns = el.getNamespaceUri(); } return ns; }
XMLElementNode<Property> n = new XMLElementNode<Property>( (PropertyNode) node, (GenericXMLElement) value ); return getAttributeAxisIterator( n );
/** * Create a new <code>GMLObjectXPath</code> from an XPath expression string. * * @param xpathExpr * the XPath expression, must not be <code>null</code> * @param root * root of the navigation hierarchy (document node), must not be <code>null</code> * @throws JaxenException * if there is a syntax error in the expression */ public GMLObjectXPath( String xpathExpr, GMLObject root ) throws JaxenException { super( xpathExpr, new GMLObjectNavigator( root ) ); SimpleFunctionContext fc = new XPathFunctionContext(); fc.registerFunction( WFS_200_NS, "valueOf", new ValueOf() ); fc.registerFunction( null, "valueOf", new ValueOf() ); SimpleNamespaceContext nc = new SimpleNamespaceContext(); nc.addNamespace( "wfs", WFS_200_NS ); setFunctionContext( fc ); setNamespaceContext( nc ); } }
/** * Returns the namespace URI of an attribute node. * * @param node * attribute node, must not be null * @return namespace if the argument is an attribute, or <code>null</code> otherwise */ @Override public String getAttributeNamespaceUri( Object node ) { String ns = null; if ( isAttribute( node ) ) { AttributeNode<?> attr = (AttributeNode<?>) node; ns = attr.getNamespaceUri(); } return ns; }
/** * Returns the local name of an element node. * * @param node * the element node * @return a string representing the unqualified local name if the node is an element, or null otherwise */ @Override public String getElementName( Object node ) { String name = null; if ( isElement( node ) ) { ElementNode<?> el = (ElementNode<?>) node; name = el.getLocalName(); } return name; }
/** * Returns the qualified (=prefixed) name of an attribute node. * * @param node * attribute node, must not be null * @return a string representing the qualified (i.e. possibly prefixed) name if the argument is an attribute, or * <code>null</code> otherwise */ @Override public String getAttributeQName( Object node ) { String name = null; if ( isAttribute( node ) ) { AttributeNode<?> attr = (AttributeNode<?>) node; name = attr.getPrefixedName(); } return name; }
/** * Returns the qualified (=prefixed) name of an element node. * * @param node * the element node * @return a string representing the qualified (i.e. possibly prefixed) name if the argument is an element, or null * otherwise */ @Override public String getElementQName( Object node ) { String name = null; if ( isElement( node ) ) { ElementNode<?> el = (ElementNode<?>) node; name = el.getPrefixedName(); } return name; }
/** * Returns the string value of an attribute node. * * @param node * attribute node, must not be null * @return the text of the attribute value if the node is an attribute, <code>null</code> otherwise */ @Override public String getAttributeStringValue( Object node ) { String value = null; if ( isAttribute( node ) ) { value = ( (AttributeNode<?>) node ).getValue().getAsText(); } return value; }