org.codehaus.groovy.sandbox.util
Class XmlSlurper

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.codehaus.groovy.sandbox.util.XmlSlurper
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class XmlSlurper
extends DefaultHandler


Constructor Summary
XmlSlurper()
           
XmlSlurper(boolean validating, boolean namespaceAware)
           
XmlSlurper(SAXParser parser)
           
XmlSlurper(XMLReader reader)
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endDocument()
           
 void endElement(String namespaceURI, String localName, String qName)
           
 org.codehaus.groovy.sandbox.util.XmlList parse(File file)
          Parses the content of the given file as XML turning it into a List
 org.codehaus.groovy.sandbox.util.XmlList parse(InputSource input)
          Parse the content of the specified input source into a List
 org.codehaus.groovy.sandbox.util.XmlList parse(InputStream input)
          Parse the content of the specified input stream into a List.
 org.codehaus.groovy.sandbox.util.XmlList parse(Reader in)
          Parse the content of the specified reader into a List.
 org.codehaus.groovy.sandbox.util.XmlList parse(String uri)
          Parse the content of the specified URI into a List
 org.codehaus.groovy.sandbox.util.XmlList parseText(String text)
          A helper method to parse the given text as XML
 void startDocument()
           
 void startElement(String namespaceURI, String localName, String qName, Attributes atts)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlSlurper

public XmlSlurper()
           throws ParserConfigurationException,
                  SAXException

XmlSlurper

public XmlSlurper(boolean validating,
                  boolean namespaceAware)
           throws ParserConfigurationException,
                  SAXException

XmlSlurper

public XmlSlurper(XMLReader reader)

XmlSlurper

public XmlSlurper(SAXParser parser)
           throws SAXException
Method Detail

parse

public org.codehaus.groovy.sandbox.util.XmlList parse(InputSource input)
                                               throws IOException,
                                                      SAXException
Parse the content of the specified input source into a List

Throws:
IOException
SAXException

parse

public org.codehaus.groovy.sandbox.util.XmlList parse(File file)
                                               throws IOException,
                                                      SAXException
Parses the content of the given file as XML turning it into a List

Throws:
IOException
SAXException

parse

public org.codehaus.groovy.sandbox.util.XmlList parse(InputStream input)
                                               throws IOException,
                                                      SAXException
Parse the content of the specified input stream into a List. Note that using this method will not provide the parser with any URI for which to find DTDs etc

Throws:
IOException
SAXException

parse

public org.codehaus.groovy.sandbox.util.XmlList parse(Reader in)
                                               throws IOException,
                                                      SAXException
Parse the content of the specified reader into a List. Note that using this method will not provide the parser with any URI for which to find DTDs etc

Throws:
IOException
SAXException

parse

public org.codehaus.groovy.sandbox.util.XmlList parse(String uri)
                                               throws IOException,
                                                      SAXException
Parse the content of the specified URI into a List

Throws:
IOException
SAXException

parseText

public org.codehaus.groovy.sandbox.util.XmlList parseText(String text)
                                                   throws IOException,
                                                          SAXException
A helper method to parse the given text as XML

Parameters:
text -
Returns:
Throws:
IOException
SAXException

startDocument

public void startDocument()
                   throws SAXException
Throws:
SAXException

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts)
                  throws SAXException
Throws:
SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Throws:
SAXException

endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)
                throws SAXException
Throws:
SAXException

endDocument

public void endDocument()
                 throws SAXException
Throws:
SAXException


Copyright © 2003-2004 The Codehaus. All Rights Reserved.