* * *

|  [ **Overview** ](../../../overview-summary.html) |  [ **Package** ](package-summary.html) |  **Class** |  [ **Use** ](class-use/HasXPath.html) |  [ **Tree** ](package-tree.html) |  [ **Deprecated** ](../../../deprecated-list.html) |  [ **Index** ](../../../index-all.html) |  [ **Help** ](../../../help-doc.html)  
---|---|---|---|---|---|---|---  
__  
PREV CLASS NEXT CLASS  |  [ **FRAMES** ](../../../index.html?org/hamcrest/xml/HasXPath.html) [ **NO FRAMES** ](HasXPath.html) [ **All Classes** ](../../../allclasses-noframe.html)  
SUMMARY: NESTED |  FIELD  |  CONSTR  |  METHOD  |  DETAIL:  FIELD  |  CONSTR  |  METHOD   
  
* * *

##  org.hamcrest.xml  
Class HasXPath

    
    
    java.lang.Object
      ![extended by ](../../../resources/inherit.gif)[org.hamcrest.BaseMatcher](../../../org/hamcrest/BaseMatcher.html "class in org.hamcrest")<T>
          ![extended by ](../../../resources/inherit.gif)[org.hamcrest.TypeSafeDiagnosingMatcher](../../../org/hamcrest/TypeSafeDiagnosingMatcher.html "class in org.hamcrest")<org.w3c.dom.Node>
              ![extended by ](../../../resources/inherit.gif)**org.hamcrest.xml.HasXPath**
    

**All Implemented Interfaces:**      [ Matcher
](../../../org/hamcrest/Matcher.html "interface in org.hamcrest")
<org.w3c.dom.Node>, [ SelfDescribing
](../../../org/hamcrest/SelfDescribing.html "interface in org.hamcrest")

* * *
    
    
    public class **HasXPath** extends [TypeSafeDiagnosingMatcher](../../../org/hamcrest/TypeSafeDiagnosingMatcher.html "class in org.hamcrest")<org.w3c.dom.Node>

Applies a Matcher to a given XML Node in an existing XML Node tree, specified
by an XPath expression.

**Author:**

     Joe Walnes, Steve Freeman 

* * *

**Field Summary**  
---  
` static javax.xml.namespace.NamespaceContext ` |  ` **[ NO_NAMESPACE_CONTEXT ](../../../org/hamcrest/xml/HasXPath.html#NO_NAMESPACE_CONTEXT) ** `   
  
**Constructor Summary**  
---  
` **[ HasXPath
](../../../org/hamcrest/xml/HasXPath.html#HasXPath\(java.lang.String,
org.hamcrest.Matcher\)) ** (java.lang.String xPathExpression, [ Matcher
](../../../org/hamcrest/Matcher.html "interface in org.hamcrest")
<java.lang.String> valueMatcher) `  
  
` **[ HasXPath
](../../../org/hamcrest/xml/HasXPath.html#HasXPath\(java.lang.String,
javax.xml.namespace.NamespaceContext, org.hamcrest.Matcher\)) **
(java.lang.String xPathExpression, javax.xml.namespace.NamespaceContext
namespaceContext, [ Matcher ](../../../org/hamcrest/Matcher.html "interface in
org.hamcrest") <java.lang.String> valueMatcher) `  
  
**Method Summary**  
---  
` void ` |  ` **[ describeTo ](../../../org/hamcrest/xml/HasXPath.html#describeTo\(org.hamcrest.Description\)) ** ( [ Description ](../../../org/hamcrest/Description.html "interface in org.hamcrest") description) `   
Generates a description of the object.  
` static [ Matcher ](../../../org/hamcrest/Matcher.html "interface in org.hamcrest") <org.w3c.dom.Node> ` |  ` **[ hasXPath ](../../../org/hamcrest/xml/HasXPath.html#hasXPath\(java.lang.String\)) ** (java.lang.String xPath) `   
Creates a matcher of ` Node ` s that matches when the examined node contains a
node at the specified ` xPath ` , with any content.  
` static [ Matcher ](../../../org/hamcrest/Matcher.html "interface in org.hamcrest") <org.w3c.dom.Node> ` |  ` **[ hasXPath ](../../../org/hamcrest/xml/HasXPath.html#hasXPath\(java.lang.String, org.hamcrest.Matcher\)) ** (java.lang.String xPath, [ Matcher ](../../../org/hamcrest/Matcher.html "interface in org.hamcrest") <java.lang.String> valueMatcher) `   
Creates a matcher of ` Node ` s that matches when the examined node has a
value at the specified ` xPath ` that satisfies the specified ` valueMatcher `
.  
` static [ Matcher ](../../../org/hamcrest/Matcher.html "interface in org.hamcrest") <org.w3c.dom.Node> ` |  ` **[ hasXPath ](../../../org/hamcrest/xml/HasXPath.html#hasXPath\(java.lang.String, javax.xml.namespace.NamespaceContext\)) ** (java.lang.String xPath, javax.xml.namespace.Namespace