microsoft.exchange.webservices.data
Class SafeXmlDocument

java.lang.Object
  extended by javax.xml.parsers.DocumentBuilder
      extended by microsoft.exchange.webservices.data.SafeXmlDocument

public class SafeXmlDocument
extends javax.xml.parsers.DocumentBuilder

XmlDocument that does not allow DTD parsing.


Field Summary
 javax.xml.stream.XMLInputFactory inputFactory
          Initializes a new instance of the SafeXmlDocument class.
 
Constructor Summary
SafeXmlDocument()
           
SafeXmlDocument(javax.xml.parsers.DocumentBuilder imp)
          Initializes a new instance of the SafeXmlDocument class with the specified XSImplementation.
SafeXmlDocument(XmlNameTable nt)
          Initializes a new instance of the SafeXmlDocument class with the specified XmlNameTable.
 
Method Summary
 org.w3c.dom.DOMImplementation getDOMImplementation()
           
 boolean isNamespaceAware()
           
 boolean isValidating()
           
 void load(java.io.InputStream inStream)
          Loads the XML document from the specified stream.
 void load(java.io.Reader txtReader)
          Loads the XML document from the specified TextReader.
 void load(java.lang.String filename)
          Loads the XML document from the specified URL.
 void load(javax.xml.stream.XMLStreamReader reader)
          Loads the XML document from the specified XMLReader.
 void loadXml(java.lang.String xml)
          Loads the XML document from the specified string.
 org.w3c.dom.Document newDocument()
           
 org.w3c.dom.Document parse(org.xml.sax.InputSource is)
           
 void setEntityResolver(org.xml.sax.EntityResolver er)
           
 void setErrorHandler(org.xml.sax.ErrorHandler eh)
           
 
Methods inherited from class javax.xml.parsers.DocumentBuilder
getSchema, isXIncludeAware, parse, parse, parse, parse, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inputFactory

public javax.xml.stream.XMLInputFactory inputFactory
Initializes a new instance of the SafeXmlDocument class.

Constructor Detail

SafeXmlDocument

public SafeXmlDocument()

SafeXmlDocument

public SafeXmlDocument(javax.xml.parsers.DocumentBuilder imp)
                throws NotSupportedException
Initializes a new instance of the SafeXmlDocument class with the specified XSImplementation.

Parameters:
imp - The XmlImplementation to use.
Throws:
NotSupportedException

SafeXmlDocument

public SafeXmlDocument(XmlNameTable nt)
Initializes a new instance of the SafeXmlDocument class with the specified XmlNameTable.

Parameters:
nt - The XmlNameTable to use.
Method Detail

load

public void load(java.io.InputStream inStream)
          throws javax.xml.stream.XMLStreamException
Loads the XML document from the specified stream.

Parameters:
inStream - The stream containing the XML document to load.
Throws:
javax.xml.stream.XMLStreamException

load

public void load(java.lang.String filename)
Loads the XML document from the specified URL.

Parameters:
filename - URL for the file containing the XML document to load. The URL can be either a local file or an HTTP URL (a Web address).

load

public void load(java.io.Reader txtReader)
Loads the XML document from the specified TextReader.

Parameters:
txtReader - The TextReader used to feed the XML data into the document.

load

public void load(javax.xml.stream.XMLStreamReader reader)
          throws org.xml.sax.SAXException,
                 java.io.IOException
Loads the XML document from the specified XMLReader.

Parameters:
reader - The XMLReader used to feed the XML data into the document.
Throws:
java.io.IOException
org.xml.sax.SAXException

loadXml

public void loadXml(java.lang.String xml)
Loads the XML document from the specified string.

Parameters:
xml - String containing the XML document to load.

getDOMImplementation

public org.w3c.dom.DOMImplementation getDOMImplementation()
Specified by:
getDOMImplementation in class javax.xml.parsers.DocumentBuilder

isNamespaceAware

public boolean isNamespaceAware()
Specified by:
isNamespaceAware in class javax.xml.parsers.DocumentBuilder

isValidating

public boolean isValidating()
Specified by:
isValidating in class javax.xml.parsers.DocumentBuilder

newDocument

public org.w3c.dom.Document newDocument()
Specified by:
newDocument in class javax.xml.parsers.DocumentBuilder

parse

public org.w3c.dom.Document parse(org.xml.sax.InputSource is)
                           throws org.xml.sax.SAXException,
                                  java.io.IOException
Specified by:
parse in class javax.xml.parsers.DocumentBuilder
Throws:
org.xml.sax.SAXException
java.io.IOException

setEntityResolver

public void setEntityResolver(org.xml.sax.EntityResolver er)
Specified by:
setEntityResolver in class javax.xml.parsers.DocumentBuilder

setErrorHandler

public void setErrorHandler(org.xml.sax.ErrorHandler eh)
Specified by:
setErrorHandler in class javax.xml.parsers.DocumentBuilder