org.newsml.toolkit.dom
Interface DOMFactory

All Known Implementing Classes:
XercesDOMFactory

public interface DOMFactory

Shared interface for creating DOM nodes.

This interface allows different DOM libraries to be used with the NewsMLExplorer; an application should implement this interface to create a DOM tree from a URL string using the techniques of a specific DOM library.

Version:
2.0
Author:
Reuters PLC

Method Summary
 org.w3c.dom.Document createDOM()
          Construct a new, empty DOM document.
 org.w3c.dom.Document createDOM(Reader input, String baseURL)
          Construct a DOM package from the URL provided.
 org.w3c.dom.Document createDOM(String url)
          Construct a DOM package from the URL provided.
 boolean getValidation()
          Get the current validation state.
 void setValidation(boolean validation)
          Require or forbid DTD validation.
 

Method Detail

setValidation

public void setValidation(boolean validation)
                   throws IOException
Require or forbid DTD validation.
Parameters:
validation - true to require DTD validation, false to forbid it.
Throws:
IOException - if the implementation does not support the requested state.
See Also:
NewsMLFactory.setValidation(boolean)

getValidation

public boolean getValidation()
Get the current validation state.
Returns:
true if the DOM factory will perform DTD validation, false if it will not.

createDOM

public org.w3c.dom.Document createDOM()
Construct a new, empty DOM document.
Returns:
an empty DOM document node.

createDOM

public org.w3c.dom.Document createDOM(String url)
                               throws IOException
Construct a DOM package from the URL provided.
Parameters:
url - A string containing an absolute URL pointing to an XML document.
Returns:
a DOM document from the URL (not null).
Throws:
IOException - If there is an error reading the document.

createDOM

public org.w3c.dom.Document createDOM(Reader input,
                                      String baseURL)
                               throws IOException
Construct a DOM package from the URL provided.
Parameters:
input - A character stream containing an XML document.
baseUrl - A string containing an absolute URL, to use for resolving external entity references.
Returns:
a DOM document from the character stream (not null).
Throws:
IOException - If there is an error reading the document.