org.newdawn.slick.util.xml
Class XMLParser

java.lang.Object
  extended by org.newdawn.slick.util.xml.XMLParser

public class XMLParser
extends java.lang.Object

A simple utility wrapper around the Java DOM implementation to hopefully make XML parsing that bit easier without requiring YAL.

Author:
kevin

Constructor Summary
XMLParser()
          Create a new parser
 
Method Summary
 XMLElement parse(java.lang.String ref)
          Parse the XML document located by the slick resource loader using the reference given.
 XMLElement parse(java.lang.String name, java.io.InputStream in)
          Parse the XML document that can be read from the given input stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLParser

public XMLParser()
Create a new parser

Method Detail

parse

public XMLElement parse(java.lang.String ref)
                 throws SlickException
Parse the XML document located by the slick resource loader using the reference given.

Parameters:
ref - The reference to the XML document
Returns:
The root element of the newly parse document
Throws:
SlickException - Indicates a failure to parse the XML, most likely the XML is malformed in some way.

parse

public XMLElement parse(java.lang.String name,
                        java.io.InputStream in)
                 throws SlickXMLException
Parse the XML document that can be read from the given input stream

Parameters:
name - The name of the document
in - The input stream from which the document can be read
Returns:
The root element of the newly parse document
Throws:
SlickXMLException - Indicates a failure to parse the XML, most likely the XML is malformed in some way.


Copyright © 2006 New Dawn Software. All Rights Reserved.