edu.mssm.crover.webapps.dimlib.util
Class XMLValidator

java.lang.Object
  |
  +--edu.mssm.crover.webapps.dimlib.util.XMLValidator

public class XMLValidator
extends java.lang.Object

XML Document Validator. Takes an XML Document and validates it against its DTD or W3C Schema. Provides easy access to the validation error message, and location of the error. Also provides automatic conversion between XML and HTML (for easily displaying XML documents within a web browser.) If a validation error occurs, the hasValidationError() method returns true. The getHTMLData() method returns an HTML version of the document, with the error location (if any) highlighted.

Current implementation uses JDOM.


Constructor Summary
XMLValidator(java.lang.String xmlData)
          Constructor
 
Method Summary
 int getColumnNumber()
          Gets the column number of the Validation Error
 java.lang.String getErrorMsg()
          Gets the Validation Error Message
 java.lang.String getHTMLData()
          Gets the original XML Data, transformed into safe HTML.
 int getLineNumber()
          Gets the line number of the Validation Error
 boolean hasValidationError()
          Indicates whether the document has one (or more) validation errors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLValidator

public XMLValidator(java.lang.String xmlData)
Constructor

Parameters:
xmlData - String of XML Data
Method Detail

hasValidationError

public boolean hasValidationError()
Indicates whether the document has one (or more) validation errors.

Returns:
true or false

getErrorMsg

public java.lang.String getErrorMsg()
Gets the Validation Error Message

Returns:
Validation Error Message

getLineNumber

public int getLineNumber()
Gets the line number of the Validation Error

Returns:
line number of validation error

getColumnNumber

public int getColumnNumber()
Gets the column number of the Validation Error

Returns:
column number of validation error

getHTMLData

public java.lang.String getHTMLData()
Gets the original XML Data, transformed into safe HTML. If an error exists, the location of the error is highlighted.

Returns:
HTML Data


Copyright @ 2003 Mount Sinai School of Medicine. All Rights Reserved.