InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
XMLDTDValidationError Class Reference

#include <XMLDTDValidationError.h>

Public Member Functions

 XMLDTDValidationError (ErrorCode errCode, const XMLReference &xmlReference, const PMString &attName=PMString())
 
 XMLDTDValidationError (const XMLDTDValidationError &src)
 
virtual ~XMLDTDValidationError ()
 
bool operator== (const XMLDTDValidationError &) const
 
XMLDTDValidationErroroperator= (const XMLDTDValidationError &src)
 
ErrorCode GetErrorCode (void) const
 
const XMLReferenceGetXMLReference (void) const
 
const PMStringGetAttributeName (void) const
 
const K2Vector
< XMLDTDValidateSuggest * > & 
GetSuggestions (void) const
 
void AddSuggestion (XMLDTDValidateSuggest *suggestion)
 

Detailed Description

Class for a single error during XML DTD validation. Each error consists of an error code, a XMLReference of where the error occurred (or base XMLReference), and a list of correction suggestions.

See Also
XMLDTDValidateSuggest

Constructor & Destructor Documentation

XMLDTDValidationError::XMLDTDValidationError (ErrorCode errCode,
const XMLReferencexmlReference,
const PMStringattName = PMString() 
)

XML DTD validation error codes. internal errors:

kXMLInvalidDTDXMLReferenceErr invalid DTD XMLReference. Unable to obtain the element that contains the DTD

kXMLNILDTDErr NIL DTD

general errors:

kXMLInvalidNMTokenErr REC-xml-20001006, [7]: invalid Nmtoken

kXMLInvalidNameTokenErr REC-xml-20001006, [5]: invalid name token

element errors:

kXMLBadRootElementTypeErr REC-xml-20001006, 2.8: root element tag must match DOCTYPE declaration's element type

kXMLEMPTYElementWithContentErr REC-xml-20001006, 3: EMPTY element cannot have content

kXMLUnexpectedElementErr REC-xml-20001006, 3: element that is not part of a content model was found

kXMLMissingElementErr REC-xml-20001006, 3: element required by the content model was not found

kXMLUndeclaredElementErr REC-xml-20001006, 3: undeclared element found

attribute errors:

kXMLMissingRequiredAttributeErr REC-xml-20001006, 3.3.2: missing required attribute. An attribute declared as #REQUIRED default value is not found

kXMLExtraAttributeErr REC-xml-20001006, 3.1: extra attribute. Element contains an attribute that is not declared as part of the element in the DTD

kXMLNotUnparsedEntityInAttValueErr REC-xml-20001006, 3.3.1: REC-xml-20001006, 3.3.1: value in an attribute declared as ENTITY type must match an unparsed entity in the DTD. The attribute value does not refer to an unparsed entity

kXMLUndeclaredEntityInAttValueErr REC-xml-20001006, 3.3.1: REC-xml-20001006, 3.3.1: value in an attribute declared as ENTITY type must match an unparsed entity in the DTD. An undeclared entity was found

kXMLUndeclaredNotationInAttValueErr REC-xml-20001006, 3.3.1: the value of NOTATION attribute must match a declared notation. An undeclared notation was found in an attribute value

kXMLAttValueNotInEnumErr REC-xml-20001006, 3.3.1: values of enumerated type must match one of the nmtokens in the declaration. The attribute value does not match one of the values in the enumeration list

kXMLDuplicateIDAttValueErr REC-xml-20001006, 3.3.1: an ID name must not appear more than once in a XML document as a value of ID type. Another element was found to have ID attribute type with the same value

kXMLFixedAttributeDefaultErr REC-xml-20001006, 3.3.2: if attribute default value declaration is #FIXED, the attribute value must be the same as declared default value. The attribute value is not the same as declared default value

kXMLIDNotFoundErr REC-xml-20001006, 3.3.1: value of IDREF must match some ID attribute. The ID referred to by the attribute value was not found

kXMLNoContentModelErr no content model found in the DTD. Possibly empty DTDconstructor

Parameters
errCodeerror code XMLReference of the element the error occurred at attribute name the error occurred at, if applicable
XMLDTDValidationError::XMLDTDValidationError (const XMLDTDValidationErrorsrc)

copy constructor

virtual XMLDTDValidationError::~XMLDTDValidationError ()
virtual

destructor

Member Function Documentation

void XMLDTDValidationError::AddSuggestion (XMLDTDValidateSuggestsuggestion)

add a suggestion to this error

Parameters
suggestionsuggestion to add. This owns the object
See Also
XMLDTDValidateSuggest
const PMString& XMLDTDValidationError::GetAttributeName (void ) const

if applicable, this method returns the name of the attribute for element, returned in GetXMLReference, which the error occurred at. If empty, then the error is not at an attribute

Returns
PMString attribute name the error occurred at
ErrorCode XMLDTDValidationError::GetErrorCode (void ) const

get the error code

Returns
ErrorCode XML DTD validation error code
const K2Vector<XMLDTDValidateSuggest*>& XMLDTDValidationError::GetSuggestions (void ) const

get the list of suggestions

Returns
K2Vector<XMLDTDValidateSuggest*> list of suggestions
See Also
XMLDTDValidateSuggest
const XMLReference& XMLDTDValidationError::GetXMLReference (void ) const

get the XMLReference of the error element

Returns
XMLReference the element where the error occurred
See Also
XMLReference
XMLDTDValidationError& XMLDTDValidationError::operator= (const XMLDTDValidationErrorsrc)

operator= required for vector of this class to work properly in erase()