|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jmeter.util.XPathUtil
public class XPathUtil
This class provides a few utility methods for dealing with XML/XPath.
Method Summary | |
---|---|
static void |
computeAssertionResult(AssertionResult result,
Document doc,
String xPathExpression,
boolean isNegated)
Fills result |
static Document |
makeDocument(InputStream stream,
boolean validate,
boolean whitespace,
boolean namespace,
boolean tolerant,
boolean quiet,
boolean showWarnings,
boolean report_errors,
boolean isXml,
boolean downloadDTDs)
Utility function to get new Document |
static Document |
makeDocument(InputStream stream,
boolean validate,
boolean whitespace,
boolean namespace,
boolean tolerant,
boolean quiet,
boolean showWarnings,
boolean report_errors,
boolean isXml,
boolean downloadDTDs,
OutputStream tidyOut)
Utility function to get new Document |
static DocumentBuilder |
makeDocumentBuilder(boolean validate,
boolean whitespace,
boolean namespace,
boolean downloadDTDs)
Create a DocumentBuilder using the makeDocumentFactory func. |
static org.w3c.tidy.Tidy |
makeTidyParser(boolean quiet,
boolean showWarnings,
boolean isXml,
StringWriter stringWriter)
Create a Tidy parser with the specified settings. |
static void |
putValuesForXPathInList(Document document,
String xPathQuery,
List<String> matchStrings,
boolean fragment)
Put in matchStrings results of evaluation |
static NodeList |
selectNodeList(Document document,
String xPathExpression)
Extract NodeList using expression |
static void |
validateXPath(Document document,
String xpathString)
Validate xpathString is a valid XPath expression |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static DocumentBuilder makeDocumentBuilder(boolean validate, boolean whitespace, boolean namespace, boolean downloadDTDs) throws ParserConfigurationException
validate
- should the parser validate documents?whitespace
- should the parser eliminate whitespace in element content?namespace
- should the parser be namespace aware?downloadDTDs
- if true, parser should attempt to resolve external entities
ParserConfigurationException
public static Document makeDocument(InputStream stream, boolean validate, boolean whitespace, boolean namespace, boolean tolerant, boolean quiet, boolean showWarnings, boolean report_errors, boolean isXml, boolean downloadDTDs) throws ParserConfigurationException, SAXException, IOException, TidyException
stream
- - Document Input streamvalidate
- - Validate Document (not Tidy)whitespace
- - Element Whitespace (not Tidy)namespace
- - Is Namespace aware. (not Tidy)tolerant
- - Is tolerant - i.e. use the Tidy parserquiet
- - set Tidy quietshowWarnings
- - set Tidy warningsreport_errors
- - throw TidyException if Tidy detects an errorisXml
- - is document already XML (Tidy only)downloadDTDs
- - if true, try to download external DTDs
ParserConfigurationException
SAXException
IOException
TidyException
public static Document makeDocument(InputStream stream, boolean validate, boolean whitespace, boolean namespace, boolean tolerant, boolean quiet, boolean showWarnings, boolean report_errors, boolean isXml, boolean downloadDTDs, OutputStream tidyOut) throws ParserConfigurationException, SAXException, IOException, TidyException
stream
- - Document Input streamvalidate
- - Validate Document (not Tidy)whitespace
- - Element Whitespace (not Tidy)namespace
- - Is Namespace aware. (not Tidy)tolerant
- - Is tolerant - i.e. use the Tidy parserquiet
- - set Tidy quietshowWarnings
- - set Tidy warningsreport_errors
- - throw TidyException if Tidy detects an errorisXml
- - is document already XML (Tidy only)downloadDTDs
- - if true, try to download external DTDstidyOut
- OutputStream for Tidy pretty-printing
ParserConfigurationException
SAXException
IOException
TidyException
public static org.w3c.tidy.Tidy makeTidyParser(boolean quiet, boolean showWarnings, boolean isXml, StringWriter stringWriter)
quiet
- - set the Tidy quiet flag?showWarnings
- - show Tidy warnings?isXml
- - treat the content as XML?stringWriter
- - if non-null, use this for Tidy errorOutput
public static NodeList selectNodeList(Document document, String xPathExpression) throws TransformerException
document
- Document
xPathExpression
- XPath expression
NodeList
TransformerException
public static void putValuesForXPathInList(Document document, String xPathQuery, List<String> matchStrings, boolean fragment) throws TransformerException
document
- XML documentxPathQuery
- XPath QuerymatchStrings
- Listfragment
- return fragment
TransformerException
public static void validateXPath(Document document, String xpathString) throws TransformerException
document
- XML DocumentxpathString
- XPATH String
TransformerException
- if expression fails to evaluatepublic static void computeAssertionResult(AssertionResult result, Document doc, String xPathExpression, boolean isNegated)
result
- AssertionResult
doc
- XML DocumentxPathExpression
- XPath expressionisNegated
-
|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |