DTDValidator Class Reference

#include <DTDValidator.hpp>

Inheritance diagram for DTDValidator:

XMLValidator XMemory List of all members.

Public Member Functions

 DTDValidator (XMLErrorReporter *const errReporter=0)
virtual ~DTDValidator ()
virtual int checkContent (XMLElementDecl *const elemDecl, QName **const children, const unsigned int childCount)
virtual void faultInAttr (XMLAttr &toFill, const XMLAttDef &attDef) const
virtual void preContentValidation (bool reuseGrammar, bool validateDefAttr=false)
virtual void postParseValidation ()
virtual void reset ()
virtual bool requiresNamespaces () const
virtual void validateAttrValue (const XMLAttDef *attDef, const XMLCh *const attrValue, bool preValidation=false, const XMLElementDecl *elemDecl=0)
virtual void validateElement (const XMLElementDecl *elemDef)
virtual Grammar * getGrammar () const
virtual void setGrammar (Grammar *aGrammar)
virtual bool handlesDTD () const
virtual bool handlesSchema () const

Private Attributes

DTDGrammarfDTDGrammar

Detailed Description

Definition at line 158 of file DTDValidator.hpp.


Constructor & Destructor Documentation

DTDValidator::DTDValidator ( XMLErrorReporter *const   errReporter = 0  ) 

virtual DTDValidator::~DTDValidator (  )  [virtual]


Member Function Documentation

virtual int DTDValidator::checkContent ( XMLElementDecl *const   elemDecl,
QName **const   children,
const unsigned int  childCount 
) [virtual]

The derived class should look up its declaration of the passed element from its element pool. It should then use the content model description contained in that element declaration to validate that the passed list of child elements are valid for that content model. The count can be zero, indicating no child elements.

Note that whitespace and text content are not validated here. Those are handled by the scanner. So only element ids are provided here.

Parameters:
elemDecl The element whose content is to be checked.
children An array of element QName which represent the elements found within the parent element, i.e. the content to be validated.
childCount The number of elements in the childIds array. It can be zero if the element had none.

Implements XMLValidator.

virtual void DTDValidator::faultInAttr ( XMLAttr toFill,
const XMLAttDef attDef 
) const [virtual]

The derived class should fault in the passed XMLAttr value. It should use the passeed attribute definition (which is passed via the base type so it must often be downcast to the appropriate type for the derived validator class), to fill in the passed attribute. This is done as a performance enhancement since the derived class has more direct access to the information.

Implements XMLValidator.

Grammar * DTDValidator::getGrammar (  )  const [inline, virtual]

Retrieve the Grammar used

Implements XMLValidator.

Definition at line 231 of file DTDValidator.hpp.

References fDTDGrammar.

bool DTDValidator::handlesDTD (  )  const [inline, virtual]

This method allows the scanner to ask the validator if it handles DTDs or not.

Implements XMLValidator.

Definition at line 246 of file DTDValidator.hpp.

bool DTDValidator::handlesSchema (  )  const [inline, virtual]

This method allows the scanner to ask the validator if it handles Schema or not.

Implements XMLValidator.

Definition at line 255 of file DTDValidator.hpp.

virtual void DTDValidator::postParseValidation (  )  [virtual]

This method is called by the scanner after the parse has completed. It gives the validator a chance to check certain things that can only be checked after the whole document has been parsed, such as referential integrity of ID/IDREF pairs and so forth. The validator should just issue errors for any problems it finds.

Implements XMLValidator.

virtual void DTDValidator::preContentValidation ( bool  reuseGrammar,
bool  validateDefAttr = false 
) [virtual]

This method is called by the scanner after a Grammar is scanned.

Implements XMLValidator.

virtual bool DTDValidator::requiresNamespaces (  )  const [virtual]

The derived class should return a boolean that indicates whether it requires namespace processing or not. Some do and some allow it to be optional. This flag is used to control whether the client code's requests to disable namespace processing can be honored or not.

Implements XMLValidator.

virtual void DTDValidator::reset (  )  [virtual]

This method is called by the scanner before a new document is about to start. It gives the validator a change to reset itself in preperation for another validation pass.

Implements XMLValidator.

void DTDValidator::setGrammar ( Grammar *  aGrammar  )  [inline, virtual]

Set the Grammar

Implements XMLValidator.

Definition at line 235 of file DTDValidator.hpp.

References fDTDGrammar.

virtual void DTDValidator::validateAttrValue ( const XMLAttDef attDef,
const XMLCh *const   attrValue,
bool  preValidation = false,
const XMLElementDecl elemDecl = 0 
) [virtual]

The derived class should apply any rules to the passed attribute value that are above and beyond those defined by XML 1.0. The scanner itself will impose XML 1.0 rules, based on the type of the attribute. This will generally be used to check things such as range checks and other datatype related validation.

If the value breaks any rules as defined by the derived class, it should just issue errors as usual.

Implements XMLValidator.

void DTDValidator::validateElement ( const XMLElementDecl elemDef  )  [inline, virtual]

The derived class should apply any rules to the passed element decl that are above and beyond those defined by XML 1.0.

If the value breaks any rules as defined by the derived class, it should just issue errors as usual.

Implements XMLValidator.

Definition at line 239 of file DTDValidator.hpp.


Member Data Documentation

DTDGrammar* DTDValidator::fDTDGrammar [private]

Definition at line 225 of file DTDValidator.hpp.

Referenced by getGrammar(), and setGrammar().


The documentation for this class was generated from the following file:
Generated on Thu Dec 7 01:30:53 2006 for DT2005.panorama by  doxygen 1.4.7