Parses an XML document and transforms it into a DOM document.
Class Name |
|
---|---|
Component |
|
Required Input Parameters
None
Optional Input Parameters
input
The XML document to parse. This can be either the absolute or relative URL for an XML document. If omitted, the open parameter unset
executes.
validate
Determines whether the parser should validate this document against the DTD specified in the input
parameter. Options include:
true: Read the DTD, validate the document, and apply all information from the DTD.
false (default): Read the DTD, do not validate the document, but substitute default attributes, and apply other information from the DTD at the parser’s discretion (Apache Xerces supports this mode).
nodtd
: Do not read the DTD, validate the document, or apply any defaults or other information. Use this mode when you do not want the parser to try and resolve the DTD location, perhaps because the remote URL location is temporarily unreachable. The resulting document might be incomplete, might have incorrect attribute values, and does not have substitution of external entities. (Apache Xerces supports this mode, but it might not be available for every parser).
If the XML document lacks a DTD, you must omit this parameter.
Output Parameters
document
Set to a DOM document if the XML document is successfully retrieved and parsed.
errors
Set to an enumeration of Exceptions if failures occurred when parsing or retrieving the XML document.
Open Parameters
unset
Rendered if the input
parameter is not set.
output
Rendered if the XML document is retrieved and parsed.
failure
Rendered when the XML document cannot be parsed or retrieved.
Usage Notes
XMLToDOM parses an XML document that is specified by the input
parameter. The result of the parse is bound to the document
parameter, which can then be manipulated inside the output
open parameter.
XMLToDOM does not have any inherent way to output its results. You typically nest within its output
parameter a servlet bean or code that can handle the resulting Data Object Model (DOM) component.