InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IXMLValidator Class Referenceabstract

#include <IXMLValidator.h>

Inheritance diagram for IXMLValidator:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IXMLVALIDATOR }
 

Public Member Functions

virtual void Validate (const XMLReference &startXMLRef, int32 maxErrors=250, bool16 treatAsRoot=kFalse, bool16 checkHasDTD=kFalse)=0
 
virtual void ClearErrors ()=0
 
virtual int32 GetErrorCount () const =0
 
virtual const
XMLDTDValidationError
GetErrorAt (int32 pos) const =0
 
virtual bool16 Validated () const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Interface for a performing validation and storing any resulting validation errors.

See Also
XMLDTDValidationError
XMLDTDValidateSuggest

Member Function Documentation

virtual void IXMLValidator::ClearErrors ()
pure virtual

Clear the most recent set of errors generated by a validate operation.

virtual const XMLDTDValidationError& IXMLValidator::GetErrorAt (int32 pos) const
pure virtual

Accessor for the validation error at the given index position

Parameters
poszero-based index, 0 <= pos < GetErrorCount()
Returns
XMLDTDValidationError
virtual int32 IXMLValidator::GetErrorCount () const
pure virtual

Accessor for the number of errors generated by the last validation. The number may be limited by the maximum number of errors allowed during the validation.

Returns
count of the validation errors
virtual void IXMLValidator::Validate (const XMLReferencestartXMLRef,
int32 maxErrors = 250,
bool16 treatAsRoot = kFalse,
bool16 checkHasDTD = kFalse 
)
pure virtual

Validate the XML against a DTD. Note: Client must clear the errors before calling Validate if they want to generate a completely new list. This method will append new errors to the existing list.

Parameters
startXMLRefXMLReference of the element to start the validation at. Use XML document element to validate the entire XML
See Also
XMLDTDValidationError
Parameters
maxErrorsmaximum number of errors to retrieve. Use -1 to get all the errors
treatAsRootif startXMLRef is not the document element or the root element, whether to check startXMLRef against DOCTYPE root element type. This is used when validating from something other than the root, but still wants to treat the starting element as root
checkHasDTDif startXMLRef has no DTD reference, whether it should be flagged as an error. Set this flag to kFalse, and XML without DTD will also "pass" the validation
virtual bool16 IXMLValidator::Validated () const
pure virtual

Accessor for whether Validate() has been called since the last call to ClearErrors()

Returns
bool16 whether Validate() has been called since the last call to ClearErrors()