org.apache.commons.jelly.tags.xml

## Class ParseTag

- java.lang.Object
- - org.apache.commons.jelly.TagSupport
  - - org.apache.commons.jelly.tags.xml.ParseTagSupport
    - - org.apache.commons.jelly.tags.xml.ParseTag

All Implemented Interfaces:
  Tag

Direct Known Subclasses:
  TransformTag

    public class ParseTag
    extends ParseTagSupport

A tag which parses some XML and defines a variable with the parsed Document. The XML can either be specified as its body or can be passed in via the xml property which can be a Reader, InputStream, URL or String URI.

Version:
  $Revision: 155420 $
Author:
  James Strachan

### Field Summary

### Fields inherited from class org.apache.commons.jelly.TagSupport

`body, context, parent`

### Constructor Summary

Constructors
Constructor and Description
`ParseTag()`

### Method Summary

Methods
`protected org.dom4j.io.SAXReader` `createSAXReader()` Factory method to create a new SAXReader
`void` `doTag(XMLOutput output)` Evaluates this tag after all the tags properties have been initialized.
`boolean` `getValidate()`
`Object` `getXml()` Gets the source of the XML which is either a String URI, Reader or InputStream
`protected org.dom4j.Document` `getXmlDocument(XMLOutput output)`
`void` `setValidate(boolean validate)` Sets whether XML validation is enabled or disabled
`void` `setXml(Object xml)` Sets the source of the XML which is either a String URI, a File, Reader or InputStream

### Methods inherited from class org.apache.commons.jelly.tags.xml.ParseTagSupport

`getSAXReader, getText, getVar, parse, parseBody, parseText, setSAXReader, setText, setVar`

### Methods inherited from class org.apache.commons.jelly.TagSupport

`findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ParseTag

    public ParseTag()

### Method Detail

#### doTag

    public void doTag(XMLOutput output)
               throws MissingAttributeException,
                      JellyTagException

Description copied from interface: `Tag`
Evaluates this tag after all the tags properties have been initialized.

Throws:
  `MissingAttributeException`
  `JellyTagException`

#### getXml

    public Object getXml()

Gets the source of the XML which is either a String URI, Reader or InputStream

#### setXml

    public void setXml(Object xml)

Sets the source of the XML which is either a String URI, a File, Reader or InputStream

#### getValidate

    public boolean getValidate()

Returns:
  whether XML validation is enabled or disabled

#### setValidate

    public void setValidate(boolean validate)

Sets whether XML validation is enabled or disabled

#### createSAXReader

    protected org.dom4j.io.SAXReader createSAXReader()

Factory method to create a new SAXReader

Specified by:
  `createSAXReader` in class `ParseTagSupport`

#### getXmlDocument

    protected org.dom4j.Document getXmlDocument(XMLOutput output)
                                         throws JellyTagException

Throws:
  `JellyTagException`