org.xfp.filters.xml
Class DOMParser

java.lang.Object
  extended byorg.xfp.AttributeContainer
      extended byorg.xfp.Filter
          extended byorg.xfp.filters.xml.DOMParser

public class DOMParser
extends Filter

Parses XML data into a DOM using the JAXP API.

Version:
$Id: DOMParser.java,v 1.1 2004/03/19 15:56:45 flaviotordini Exp $
Author:
Flavio Tordini
JAR Dependency:
Any JAXP implementation (Apache Xerces)

Nested Class Summary
 
Nested classes inherited from class org.xfp.Filter
Filter.OnErrorEnum, Filter.OnLoopErrorEnum
 
Field Summary
 
Fields inherited from class org.xfp.AttributeContainer
name, parentContainer
 
Constructor Summary
DOMParser()
           
 
Method Summary
 org.w3c.dom.Document execute(java.io.File file)
          Executes this filter.
 org.w3c.dom.Document execute(org.xml.sax.InputSource in)
          Executes this filter.
 org.w3c.dom.Document execute(java.io.InputStream is)
          Executes this filter.
 org.w3c.dom.Document execute(java.io.Reader reader)
          Executes this filter.
 org.w3c.dom.Document execute(java.lang.String xml)
          Executes this filter.
 org.w3c.dom.Document execute(java.net.URI uri)
          Executes this filter.
 void reset()
          Resets filter status after execution.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Allows the user to set specific attributes on the underlying JAXP implementation.
 void setCoalescing(boolean coalescing)
          Specifies that the parser produced by this code will convert CDATA nodes to Text nodes and append it to the adjacent (if any) text node.
 void setExpandEntityReferences(boolean expandEntityReferences)
          Specifies that the parser produced by this code will expand entity reference nodes.
 void setIgnoringComments(boolean ignoringComments)
          Specifies that the parser produced by this code will ignore comments.
 void setIgnoringElementContentWhitespace(boolean ignoringElementContentWhitespace)
          Specifies that the parsers created by this factory must eliminate whitespace in element content (sometimes known loosely as 'ignorable whitespace') when parsing XML documents (see XML Rec 2.10).
 void setNamespaceAware(boolean namespaceAware)
          Specifies that the parser produced by this code will provide support for XML namespaces.
 void setValidating(boolean validating)
          Specifies that the parser produced by this code will validate documents as they are parsed.
 
Methods inherited from class org.xfp.Filter
getOnError, initialize, log, newInstance, perform, toString
 
Methods inherited from class org.xfp.AttributeContainer
configureAttributes, disposeAttributes, getAttributes, getFullName, getName, initializeAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DOMParser

public DOMParser()
Method Detail

execute

public org.w3c.dom.Document execute(java.io.File file)
                             throws java.lang.Exception
Executes this filter.

Throws:
java.lang.Exception

execute

public org.w3c.dom.Document execute(org.xml.sax.InputSource in)
                             throws java.lang.Exception
Executes this filter.

Throws:
java.lang.Exception

execute

public org.w3c.dom.Document execute(java.io.InputStream is)
                             throws java.lang.Exception
Executes this filter.

Throws:
java.lang.Exception

execute

public org.w3c.dom.Document execute(java.io.Reader reader)
                             throws java.lang.Exception
Executes this filter.

Throws:
java.lang.Exception

execute

public org.w3c.dom.Document execute(java.lang.String xml)
                             throws java.lang.Exception
Executes this filter.

Throws:
java.lang.Exception

execute

public org.w3c.dom.Document execute(java.net.URI uri)
                             throws java.lang.Exception
Executes this filter.

Throws:
java.lang.Exception

reset

public void reset()
Description copied from class: Filter
Resets filter status after execution. This method is called after execute(), even in case of exceptions. Since a Filter instance may be reused (and actually is), you must use this method to reset all your class members to their default value.

Specified by:
reset in class Filter
See Also:
Filter.reset()

setCoalescing

public void setCoalescing(boolean coalescing)
Specifies that the parser produced by this code will convert CDATA nodes to Text nodes and append it to the adjacent (if any) text node. By default the value of this is set to false.


setExpandEntityReferences

public void setExpandEntityReferences(boolean expandEntityReferences)
Specifies that the parser produced by this code will expand entity reference nodes. By default the value of this is set to true


setIgnoringComments

public void setIgnoringComments(boolean ignoringComments)
Specifies that the parser produced by this code will ignore comments. By default the value of this is set to false


setIgnoringElementContentWhitespace

public void setIgnoringElementContentWhitespace(boolean ignoringElementContentWhitespace)
Specifies that the parsers created by this factory must eliminate whitespace in element content (sometimes known loosely as 'ignorable whitespace') when parsing XML documents (see XML Rec 2.10). Note that only whitespace which is directly contained within element content that has an element only content model (see XML Rec 3.2.1) will be eliminated. Due to reliance on the content model this setting requires the parser to be in validating mode. By default the value of this is set to false.


setNamespaceAware

public void setNamespaceAware(boolean namespaceAware)
Specifies that the parser produced by this code will provide support for XML namespaces. By default the value of this is set to false


setValidating

public void setValidating(boolean validating)
Specifies that the parser produced by this code will validate documents as they are parsed. By default the value of this is set to false.


setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Allows the user to set specific attributes on the underlying JAXP implementation.



Copyright © 2003-2004 XFP Team. All Rights Reserved.