Interface IXMLValidator
- All Known Implementing Classes:
NonValidator, ValidatorPlugin
public interface IXMLValidator
IXMLValidator processes the DTD and handles entity references.
- Version:
- $Name: RELEASE_2_2_1 $, $Revision: 1.3 $
- Author:
- Marc De Scheemaecker
-
Method Summary
Modifier and TypeMethodDescriptionvoidattributeAdded(String key, String value, String systemId, int lineNr) Indicates that an attribute has been added to the current element.voidelementAttributesProcessed(String name, Properties extraAttributes, String systemId, int lineNr) This method is called when the attributes of an XML element have been processed.voidelementEnded(String name, String systemId, int lineNr) Indicates that the current element has ended.voidelementStarted(String name, String systemId, int lineNr) Indicates that an element has been started.Returns the parameter entity resolver.voidparseDTD(String publicID, IXMLReader reader, IXMLEntityResolver entityResolver, boolean external) Parses the DTD.voidPCDataAdded(String systemId, int lineNr) Indicates that a new #PCDATA element has been encountered.voidsetParameterEntityResolver(IXMLEntityResolver resolver) Sets the parameter entity resolver.
-
Method Details
-
setParameterEntityResolver
Sets the parameter entity resolver.- Parameters:
resolver- the entity resolver.
-
getParameterEntityResolver
IXMLEntityResolver getParameterEntityResolver()Returns the parameter entity resolver.- Returns:
- the entity resolver.
-
parseDTD
void parseDTD(String publicID, IXMLReader reader, IXMLEntityResolver entityResolver, boolean external) throws Exception Parses the DTD. The validator object is responsible for reading the full DTD.- Parameters:
publicID- the public ID, which may be null.reader- the reader to read the DTD from.entityResolver- the entity resolver.external- true if the DTD is external.- Throws:
Exception- If something went wrong.
-
elementStarted
Indicates that an element has been started.- Parameters:
name- the name of the element.systemId- the system ID of the XML data of the element.lineNr- the line number in the XML data of the element.- Throws:
Exception- If the element could not be validated.
-
elementEnded
Indicates that the current element has ended.- Parameters:
name- the name of the element.systemId- the system ID of the XML data of the element.lineNr- the line number in the XML data of the element.- Throws:
Exception- If the element could not be validated.
-
attributeAdded
Indicates that an attribute has been added to the current element.- Parameters:
key- the name of the attribute.value- the value of the attribute.systemId- the system ID of the XML data of the element.lineNr- the line number in the XML data of the element.- Throws:
Exception- If the attribute could not be validated.
-
elementAttributesProcessed
void elementAttributesProcessed(String name, Properties extraAttributes, String systemId, int lineNr) throws Exception This method is called when the attributes of an XML element have been processed. If there are attributes with a default value which have not been specified yet, they have to be put into extraAttributes.- Parameters:
name- the name of the element.extraAttributes- where to put extra attributes.systemId- the system ID of the XML data of the element.lineNr- the line number in the XML data of the element.- Throws:
Exception- if the element could not be validated.
-
PCDataAdded
Indicates that a new #PCDATA element has been encountered.- Parameters:
systemId- the system ID of the XML data of the element.lineNr- the line number in the XML data of the element.- Throws:
Exception- if the element could not be validated.
-