pl.psnc.dl.ege.validator.xml
Class DTDValidator
java.lang.Object
pl.psnc.dl.ege.validator.xml.DTDValidator
- All Implemented Interfaces:
- XmlValidator
public class DTDValidator
- extends java.lang.Object
- implements XmlValidator
Validates XML data against referenced external DTD.
If streamed XML data has no !DOCTYPE declaration, validator adds it by default
with specified external reference to DTD and root element.
- Author:
- mariuszs
Constructor Summary |
DTDValidator(java.lang.String systemId,
java.lang.String root)
Default constructor. |
Method Summary |
void |
validateXml(java.io.InputStream inputData,
org.xml.sax.ErrorHandler errorHandler)
Performs XML stream validation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DTDValidator
public DTDValidator(java.lang.String systemId,
java.lang.String root)
- Default constructor.
- Parameters:
systemId
- - "systemId" of !DOCTYPE declarationroot
- - root-element of !DOCTYPE declaration
validateXml
public void validateXml(java.io.InputStream inputData,
org.xml.sax.ErrorHandler errorHandler)
throws org.xml.sax.SAXException,
java.io.FileNotFoundException,
java.io.IOException,
java.lang.Exception
- Performs XML stream validation.
Validation results can be stored within ErrorHandler
implementation
(StandardErrorHandler
by default).
- Specified by:
validateXml
in interface XmlValidator
- Parameters:
inputData
- - streamed XML data.
- Throws:
org.xml.sax.SAXException
java.io.IOException
java.io.FileNotFoundException
java.lang.Exception
Copyright © 2010. All Rights Reserved.