net.sf.xmlmatcher.matcher
Class AttributesMatcher
java.lang.Object
net.sf.xmlmatcher.matcher.MatcherImpl
net.sf.xmlmatcher.matcher.AttributesMatcher
- All Implemented Interfaces:
- Matcher
public class AttributesMatcher
- extends MatcherImpl
Simple matcher that verifies that names and values of all attributes
in template element match with actual element.
If actual element contains extra attributes, they will not be matched.
Exceptions: attributes defined thr following namespaces are skipped:
Method Summary |
void |
matchElements(org.w3c.dom.Element template,
org.w3c.dom.Element actual)
Compare two XML trees specified by given elements. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XMLNS_ATTR
public static final java.lang.String XMLNS_ATTR
- See Also:
- Constant Field Values
AttributesMatcher
public AttributesMatcher()
matchElements
public void matchElements(org.w3c.dom.Element template,
org.w3c.dom.Element actual)
throws XMLMismatchException,
InvalidTemplateException
- Description copied from class:
MatcherImpl
- Compare two XML trees specified by given elements.
Verifies that template and actual elements have the same tag name and namespace, then
invokes most appropriate comparator based on template element.
- Specified by:
matchElements
in class MatcherImpl
- Parameters:
template
- Template Elementactual
- Actual Element (instance)
- Throws:
XMLMismatchException
InvalidTemplateException
Copyright © 2007. All Rights Reserved.