org.apache.commons.jelly.tags.validate
Class ValidateTag

java.lang.Object
  |
  +--org.apache.commons.jelly.TagSupport
        |
        +--org.apache.commons.jelly.tags.validate.ValidateTag
All Implemented Interfaces:
Tag

public class ValidateTag
extends TagSupport

This tag validates its body using a schema Verifier which can validate against DTDs, XML Schema, RelaxNG, Relax or TREX. Any JARV compliant Verifier could be used. The error messages are output as XML events so that they can be styled by the parent tag.

Version:
$Revision: 1.1 $
Author:
James Strachan

Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
ValidateTag()
           
 
Method Summary
 void doTag(XMLOutput output)
          Evaluates this tag after all the tags properties have been initialized.
protected  void outputException(XMLOutput output, java.lang.String name, org.xml.sax.SAXParseException e)
          Outputs the given validation exception as XML to the output
 void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
          Sets the SAX ErrorHandler which is used to capture XML validation events.
 void setVar(java.lang.String var)
          Sets the name of the variable that will contain a boolean flag for whether or not the XML is valid.
 void setVerifier(org.iso_relax.verifier.Verifier verifier)
          Sets the schema Verifier that this tag will use to verify its body
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getContext, getParent, invokeBody, isTrim, setBody, setContext, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidateTag

public ValidateTag()
Method Detail

doTag

public void doTag(XMLOutput output)
           throws java.lang.Exception
Description copied from interface: Tag
Evaluates this tag after all the tags properties have been initialized.

setVerifier

public void setVerifier(org.iso_relax.verifier.Verifier verifier)
Sets the schema Verifier that this tag will use to verify its body

setErrorHandler

public void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
Sets the SAX ErrorHandler which is used to capture XML validation events. If an ErrorHandler is specified then this tag will output its body and redirect all error messages to the ErrorHandler. If no ErrorHandler is specified then this tag will just output the error messages as XML events

setVar

public void setVar(java.lang.String var)
Sets the name of the variable that will contain a boolean flag for whether or not the XML is valid.

outputException

protected void outputException(XMLOutput output,
                               java.lang.String name,
                               org.xml.sax.SAXParseException e)
                        throws org.xml.sax.SAXException
Outputs the given validation exception as XML to the output


Copyright © 2002-2002 Apache Software Foundation. All Rights Reserved.