Apache JMeter

org.apache.jmeter.util
Class XPathUtil

java.lang.Object
  extended byorg.apache.jmeter.util.XPathUtil

public class XPathUtil
extends Object

This class provides a few utility methods for dealing with XML/XPath.


Method Summary
static Document makeDocument(InputStream stream, boolean validate, boolean whitespace, boolean namespace, boolean tolerant)
          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)
          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)
          Utility function to get new Document
static DocumentBuilder makeDocumentBuilder(boolean validate, boolean whitespace, boolean namespace)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

makeDocumentBuilder

public static DocumentBuilder makeDocumentBuilder(boolean validate,
                                                  boolean whitespace,
                                                  boolean namespace)
                                           throws ParserConfigurationException
Create a DocumentBuilder using the makeDocumentFactory func.

Parameters:
validate - should the parser validate documents?
whitespace - should the parser eliminate whitespace in element content?
namespace - should the parser be namespace aware?
Returns:
document builder
Throws:
ParserConfigurationException

makeDocument

public static Document makeDocument(InputStream stream,
                                    boolean validate,
                                    boolean whitespace,
                                    boolean namespace,
                                    boolean tolerant)
                             throws ParserConfigurationException,
                                    SAXException,
                                    IOException,
                                    TidyException
Utility function to get new Document

Parameters:
stream - Document Input stream
validate - Validate Document (not Tidy)
whitespace - Element Whitespace (not Tidy)
namespace - Is Namespace aware.
tolerant - Is tolerant - i.e. use the Tidy parser
Returns:
document
Throws:
ParserConfigurationException
IOException
SAXException
TidyException

makeDocument

public static Document makeDocument(InputStream stream,
                                    boolean validate,
                                    boolean whitespace,
                                    boolean namespace,
                                    boolean tolerant,
                                    boolean quiet,
                                    boolean showWarnings,
                                    boolean report_errors)
                             throws ParserConfigurationException,
                                    SAXException,
                                    IOException,
                                    TidyException
Utility function to get new Document

Parameters:
stream - - Document Input stream
validate - - Validate Document (not Tidy)
whitespace - - Element Whitespace (not Tidy)
namespace - - Is Namespace aware. (not Tidy)
tolerant - - Is tolerant - i.e. use the Tidy parser
quiet - - set Tidy quiet
showWarnings - - set Tidy warnings
report_errors - - throw TidyException if Tidy detects an error
Returns:
document
Throws:
ParserConfigurationException
SAXException
IOException
TidyException

makeDocument

public static Document makeDocument(InputStream stream,
                                    boolean validate,
                                    boolean whitespace,
                                    boolean namespace,
                                    boolean tolerant,
                                    boolean quiet,
                                    boolean showWarnings,
                                    boolean report_errors,
                                    boolean isXml)
                             throws ParserConfigurationException,
                                    SAXException,
                                    IOException,
                                    TidyException
Utility function to get new Document

Parameters:
stream - - Document Input stream
validate - - Validate Document (not Tidy)
whitespace - - Element Whitespace (not Tidy)
namespace - - Is Namespace aware. (not Tidy)
tolerant - - Is tolerant - i.e. use the Tidy parser
quiet - - set Tidy quiet
showWarnings - - set Tidy warnings
report_errors - - throw TidyException if Tidy detects an error
isXml - - is document already XML (Tidy only)
Returns:
document
Throws:
ParserConfigurationException
SAXException
IOException
TidyException

makeTidyParser

public static org.w3c.tidy.Tidy makeTidyParser(boolean quiet,
                                               boolean showWarnings,
                                               boolean isXml,
                                               StringWriter stringWriter)
Create a Tidy parser with the specified settings.

Parameters:
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
Returns:
the Tidy parser

Apache JMeter

Copyright © 1998-2009 Apache Software Foundation. All Rights Reserved.