libxml2
|
DTD validator. More...
Data Structures | |
struct | _xmlValidCtxt |
An xmlValidCtxt is used for error reporting when validating. More... | |
Typedefs | |
typedef void(* | xmlValidityErrorFunc) (void *ctx, const char *msg,...) |
Report a validity error. | |
typedef void(* | xmlValidityWarningFunc) (void *ctx, const char *msg,...) |
Report a validity warning. | |
Functions | |
xmlNotation * | xmlAddNotationDecl (xmlValidCtxt *ctxt, xmlDtd *dtd, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId) |
Register a new notation declaration. | |
xmlNotationTable * | xmlCopyNotationTable (xmlNotationTable *table) |
Build a copy of a notation table. | |
void | xmlFreeNotationTable (xmlNotationTable *table) |
Deallocate the memory used by an entities hash table. | |
void | xmlDumpNotationDecl (xmlBuffer *buf, xmlNotation *nota) |
This will dump the content the notation declaration as an XML DTD definition. | |
void | xmlDumpNotationTable (xmlBuffer *buf, xmlNotationTable *table) |
This will dump the content of the notation table as an XML DTD definition. | |
xmlElementContent * | xmlNewElementContent (const xmlChar *name, xmlElementContentType type) |
Allocate an element content structure. | |
xmlElementContent * | xmlCopyElementContent (xmlElementContent *content) |
Build a copy of an element content description. | |
void | xmlFreeElementContent (xmlElementContent *cur) |
Free an element content structure. | |
xmlElementContent * | xmlNewDocElementContent (xmlDoc *doc, const xmlChar *name, xmlElementContentType type) |
Allocate an element content structure for the document. | |
xmlElementContent * | xmlCopyDocElementContent (xmlDoc *doc, xmlElementContent *content) |
Build a copy of an element content description. | |
void | xmlFreeDocElementContent (xmlDoc *doc, xmlElementContent *cur) |
Free an element content structure. | |
void | xmlSnprintfElementContent (char *buf, int size, xmlElementContent *content, int englob) |
This will dump the content of the element content definition Intended just for the debug routine. | |
void | xmlSprintfElementContent (char *buf, xmlElementContent *content, int englob) |
Deprecated, unsafe, use xmlSnprintfElementContent() | |
xmlElement * | xmlAddElementDecl (xmlValidCtxt *ctxt, xmlDtd *dtd, const xmlChar *name, xmlElementTypeVal type, xmlElementContent *content) |
Register a new element declaration. | |
xmlElementTable * | xmlCopyElementTable (xmlElementTable *table) |
Build a copy of an element table. | |
void | xmlFreeElementTable (xmlElementTable *table) |
Deallocate the memory used by an element hash table. | |
void | xmlDumpElementTable (xmlBuffer *buf, xmlElementTable *table) |
This will dump the content of the element table as an XML DTD definition. | |
void | xmlDumpElementDecl (xmlBuffer *buf, xmlElement *elem) |
This will dump the content of the element declaration as an XML DTD definition. | |
xmlEnumeration * | xmlCreateEnumeration (const xmlChar *name) |
Create and initialize an enumeration attribute node. | |
void | xmlFreeEnumeration (xmlEnumeration *cur) |
Free an enumeration attribute node (recursive). | |
xmlEnumeration * | xmlCopyEnumeration (xmlEnumeration *cur) |
Copy an enumeration attribute node (recursive). | |
xmlAttribute * | xmlAddAttributeDecl (xmlValidCtxt *ctxt, xmlDtd *dtd, const xmlChar *elem, const xmlChar *name, const xmlChar *ns, xmlAttributeType type, xmlAttributeDefault def, const xmlChar *defaultValue, xmlEnumeration *tree) |
Register a new attribute declaration. | |
xmlAttributeTable * | xmlCopyAttributeTable (xmlAttributeTable *table) |
Build a copy of an attribute table. | |
void | xmlFreeAttributeTable (xmlAttributeTable *table) |
Deallocate the memory used by an entities hash table. | |
void | xmlDumpAttributeTable (xmlBuffer *buf, xmlAttributeTable *table) |
This will dump the content of the attribute table as an XML DTD definition. | |
void | xmlDumpAttributeDecl (xmlBuffer *buf, xmlAttribute *attr) |
This will dump the content of the attribute declaration as an XML DTD definition. | |
int | xmlAddIDSafe (xmlAttr *attr, const xmlChar *value) |
Add an attribute to the docment's ID table. | |
xmlID * | xmlAddID (xmlValidCtxt *ctxt, xmlDoc *doc, const xmlChar *value, xmlAttr *attr) |
Add an attribute to the docment's ID table. | |
void | xmlFreeIDTable (xmlIDTable *table) |
Deallocate the memory used by an ID hash table. | |
xmlAttr * | xmlGetID (xmlDoc *doc, const xmlChar *ID) |
Search the document's ID table for the attribute with the given ID. | |
int | xmlIsID (xmlDoc *doc, xmlNode *elem, xmlAttr *attr) |
Determine whether an attribute is of type ID. | |
int | xmlRemoveID (xmlDoc *doc, xmlAttr *attr) |
Remove the given attribute from the document's ID table. | |
xmlRef * | xmlAddRef (xmlValidCtxt *ctxt, xmlDoc *doc, const xmlChar *value, xmlAttr *attr) |
Register a new ref declaration. | |
void | xmlFreeRefTable (xmlRefTable *table) |
Deallocate the memory used by an Ref hash table. | |
int | xmlIsRef (xmlDoc *doc, xmlNode *elem, xmlAttr *attr) |
Determine whether an attribute is of type Ref. | |
int | xmlRemoveRef (xmlDoc *doc, xmlAttr *attr) |
Remove the given attribute from the Ref table maintained internally. | |
xmlList * | xmlGetRefs (xmlDoc *doc, const xmlChar *ID) |
Find the set of references for the supplied ID. | |
xmlValidCtxt * | xmlNewValidCtxt (void) |
The public function calls related to validity checking. | |
void | xmlFreeValidCtxt (xmlValidCtxt *) |
Free a validation context structure. | |
int | xmlValidateRoot (xmlValidCtxt *ctxt, xmlDoc *doc) |
Try to validate the root element. | |
int | xmlValidateElementDecl (xmlValidCtxt *ctxt, xmlDoc *doc, xmlElement *elem) |
Try to validate a single element definition. | |
xmlChar * | xmlValidNormalizeAttributeValue (xmlDoc *doc, xmlNode *elem, const xmlChar *name, const xmlChar *value) |
Performs the validation-related extra step of the normalization of attribute values: | |
xmlChar * | xmlValidCtxtNormalizeAttributeValue (xmlValidCtxt *ctxt, xmlDoc *doc, xmlNode *elem, const xmlChar *name, const xmlChar *value) |
Performs the validation-related extra step of the normalization of attribute values: | |
int | xmlValidateAttributeDecl (xmlValidCtxt *ctxt, xmlDoc *doc, xmlAttribute *attr) |
Try to validate a single attribute definition. | |
int | xmlValidateAttributeValue (xmlAttributeType type, const xmlChar *value) |
Validate that the given attribute value matches the proper production. | |
int | xmlValidateNotationDecl (xmlValidCtxt *ctxt, xmlDoc *doc, xmlNotation *nota) |
Try to validate a single notation definition. | |
int | xmlValidateDtd (xmlValidCtxt *ctxt, xmlDoc *doc, xmlDtd *dtd) |
Try to validate the document against the DTD instance. | |
int | xmlValidateDtdFinal (xmlValidCtxt *ctxt, xmlDoc *doc) |
Performs the final validation steps of DTD content once all the subsets have been parsed. | |
int | xmlValidateDocument (xmlValidCtxt *ctxt, xmlDoc *doc) |
Try to validate the document instance. | |
int | xmlValidateElement (xmlValidCtxt *ctxt, xmlDoc *doc, xmlNode *elem) |
Try to validate the subtree under an element. | |
int | xmlValidateOneElement (xmlValidCtxt *ctxt, xmlDoc *doc, xmlNode *elem) |
Try to validate a single element and its attributes. | |
int | xmlValidateOneAttribute (xmlValidCtxt *ctxt, xmlDoc *doc, xmlNode *elem, xmlAttr *attr, const xmlChar *value) |
Try to validate a single attribute for an element. | |
int | xmlValidateOneNamespace (xmlValidCtxt *ctxt, xmlDoc *doc, xmlNode *elem, const xmlChar *prefix, xmlNs *ns, const xmlChar *value) |
Try to validate a single namespace declaration for an element. | |
int | xmlValidateDocumentFinal (xmlValidCtxt *ctxt, xmlDoc *doc) |
Performs the final step of document validation once all the incremental validation steps have been completed. | |
int | xmlValidateNotationUse (xmlValidCtxt *ctxt, xmlDoc *doc, const xmlChar *notationName) |
Validate that the given name match a notation declaration. | |
int | xmlIsMixedElement (xmlDoc *doc, const xmlChar *name) |
Search in the DTDs whether an element accepts mixed content or ANY (basically if it is supposed to accept text children). | |
xmlAttribute * | xmlGetDtdAttrDesc (xmlDtd *dtd, const xmlChar *elem, const xmlChar *name) |
Search the DTD for the description of this attribute on this element. | |
xmlAttribute * | xmlGetDtdQAttrDesc (xmlDtd *dtd, const xmlChar *elem, const xmlChar *name, const xmlChar *prefix) |
Search the DTD for the description of this qualified attribute on this element. | |
xmlNotation * | xmlGetDtdNotationDesc (xmlDtd *dtd, const xmlChar *name) |
Search the DTD for the description of this notation. | |
xmlElement * | xmlGetDtdQElementDesc (xmlDtd *dtd, const xmlChar *name, const xmlChar *prefix) |
Search the DTD for the description of this element. | |
xmlElement * | xmlGetDtdElementDesc (xmlDtd *dtd, const xmlChar *name) |
Search the DTD for the description of this element. | |
int | xmlValidGetPotentialChildren (xmlElementContent *ctree, const xmlChar **names, int *len, int max) |
Build/extend a list of potential children allowed by the content tree. | |
int | xmlValidGetValidElements (xmlNode *prev, xmlNode *next, const xmlChar **names, int max) |
This function returns the list of authorized children to insert within an existing tree while respecting the validity constraints forced by the Dtd. | |
int | xmlValidateNameValue (const xmlChar *value) |
Validate that the given value matches the Name production. | |
int | xmlValidateNamesValue (const xmlChar *value) |
Validate that the given value matches the Names production. | |
int | xmlValidateNmtokenValue (const xmlChar *value) |
Validate that the given value matches the Nmtoken production. | |
int | xmlValidateNmtokensValue (const xmlChar *value) |
Validate that the given value matches the Nmtokens production. | |
int | xmlValidBuildContentModel (xmlValidCtxt *ctxt, xmlElement *elem) |
(Re)Build the automata associated to the content model of this element | |
int | xmlValidatePushElement (xmlValidCtxt *ctxt, xmlDoc *doc, xmlNode *elem, const xmlChar *qname) |
Push a new element start on the validation stack. | |
int | xmlValidatePushCData (xmlValidCtxt *ctxt, const xmlChar *data, int len) |
Check the CData parsed for validation in the current stack. | |
int | xmlValidatePopElement (xmlValidCtxt *ctxt, xmlDoc *doc, xmlNode *elem, const xmlChar *qname) |
Pop the element end from the validation stack. | |
DTD validator.
API to handle XML Document Type Definitions and validate documents.
typedef void(* xmlValidityErrorFunc) (void *ctx, const char *msg,...) |
Report a validity error.
ctx | user data (usually an xmlValidCtxt) |
msg | printf-like format string |
... | arguments to format |
typedef void(* xmlValidityWarningFunc) (void *ctx, const char *msg,...) |
Report a validity warning.
ctx | user data (usually an xmlValidCtxt) |
msg | printf-like format string |
... | arguments to format |
xmlAttribute * xmlAddAttributeDecl | ( | xmlValidCtxt * | ctxt, |
xmlDtd * | dtd, | ||
const xmlChar * | elem, | ||
const xmlChar * | name, | ||
const xmlChar * | ns, | ||
xmlAttributeType | type, | ||
xmlAttributeDefault | def, | ||
const xmlChar * | defaultValue, | ||
xmlEnumeration * | tree | ||
) |
Register a new attribute declaration.
ctxt | the validation context |
dtd | pointer to the DTD |
elem | the element name |
name | the attribute name |
ns | the attribute namespace prefix |
type | the attribute type |
def | the attribute default type |
defaultValue | the attribute default value |
tree | if it's an enumeration, the associated list |
xmlElement * xmlAddElementDecl | ( | xmlValidCtxt * | ctxt, |
xmlDtd * | dtd, | ||
const xmlChar * | name, | ||
xmlElementTypeVal | type, | ||
xmlElementContent * | content | ||
) |
Register a new element declaration.
ctxt | the validation context |
dtd | pointer to the DTD |
name | the entity name |
type | the element type |
content | the element content tree or NULL |
xmlID * xmlAddID | ( | xmlValidCtxt * | ctxt, |
xmlDoc * | doc, | ||
const xmlChar * | value, | ||
xmlAttr * | attr | ||
) |
Add an attribute to the docment's ID table.
ctxt | the validation context (optional) |
doc | pointer to the document, must equal attr->doc |
value | the attribute (ID) value |
attr | the attribute holding the ID |
Add an attribute to the docment's ID table.
attr | the attribute holding the ID |
value | the attribute (ID) value |
xmlNotation * xmlAddNotationDecl | ( | xmlValidCtxt * | ctxt, |
xmlDtd * | dtd, | ||
const xmlChar * | name, | ||
const xmlChar * | publicId, | ||
const xmlChar * | systemId | ||
) |
Register a new notation declaration.
dtd | pointer to the DTD |
ctxt | the validation context |
name | the entity name |
publicId | the public identifier or NULL |
systemId | the system identifier or NULL |
xmlRef * xmlAddRef | ( | xmlValidCtxt * | ctxt, |
xmlDoc * | doc, | ||
const xmlChar * | value, | ||
xmlAttr * | attr | ||
) |
Register a new ref declaration.
ctxt | the validation context |
doc | pointer to the document |
value | the value name |
attr | the attribute holding the Ref |
xmlAttributeTable * xmlCopyAttributeTable | ( | xmlAttributeTable * | table | ) |
Build a copy of an attribute table.
table | An attribute table |
xmlElementContent * xmlCopyDocElementContent | ( | xmlDoc * | doc, |
xmlElementContent * | cur | ||
) |
Build a copy of an element content description.
doc | the document owning the element declaration |
cur | An element content pointer. |
xmlElementContent * xmlCopyElementContent | ( | xmlElementContent * | cur | ) |
Build a copy of an element content description.
Deprecated, use xmlCopyDocElementContent() instead
cur | An element content pointer. |
xmlElementTable * xmlCopyElementTable | ( | xmlElementTable * | table | ) |
Build a copy of an element table.
table | An element table |
xmlEnumeration * xmlCopyEnumeration | ( | xmlEnumeration * | cur | ) |
Copy an enumeration attribute node (recursive).
cur | the tree to copy. |
xmlNotationTable * xmlCopyNotationTable | ( | xmlNotationTable * | table | ) |
Build a copy of a notation table.
table | A notation table |
xmlEnumeration * xmlCreateEnumeration | ( | const xmlChar * | name | ) |
Create and initialize an enumeration attribute node.
name | the enumeration name or NULL |
void xmlDumpAttributeDecl | ( | xmlBuffer * | buf, |
xmlAttribute * | attr | ||
) |
This will dump the content of the attribute declaration as an XML DTD definition.
buf | the XML buffer output |
attr | An attribute declaration |
void xmlDumpAttributeTable | ( | xmlBuffer * | buf, |
xmlAttributeTable * | table | ||
) |
This will dump the content of the attribute table as an XML DTD definition.
buf | the XML buffer output |
table | an attribute table |
void xmlDumpElementDecl | ( | xmlBuffer * | buf, |
xmlElement * | elem | ||
) |
This will dump the content of the element declaration as an XML DTD definition.
buf | the XML buffer output |
elem | An element table |
void xmlDumpElementTable | ( | xmlBuffer * | buf, |
xmlElementTable * | table | ||
) |
This will dump the content of the element table as an XML DTD definition.
buf | the XML buffer output |
table | An element table |
void xmlDumpNotationDecl | ( | xmlBuffer * | buf, |
xmlNotation * | nota | ||
) |
This will dump the content the notation declaration as an XML DTD definition.
buf | the XML buffer output |
nota | A notation declaration |
void xmlDumpNotationTable | ( | xmlBuffer * | buf, |
xmlNotationTable * | table | ||
) |
This will dump the content of the notation table as an XML DTD definition.
buf | the XML buffer output |
table | A notation table |
void xmlFreeAttributeTable | ( | xmlAttributeTable * | table | ) |
Deallocate the memory used by an entities hash table.
table | An attribute table |
void xmlFreeDocElementContent | ( | xmlDoc * | doc, |
xmlElementContent * | cur | ||
) |
Free an element content structure.
The whole subtree is removed.
doc | the document owning the element declaration |
cur | the element content tree to free |
void xmlFreeElementContent | ( | xmlElementContent * | cur | ) |
Free an element content structure.
The whole subtree is removed. Deprecated, use xmlFreeDocElementContent() instead
cur | the element content tree to free |
void xmlFreeElementTable | ( | xmlElementTable * | table | ) |
Deallocate the memory used by an element hash table.
table | An element table |
void xmlFreeEnumeration | ( | xmlEnumeration * | cur | ) |
Free an enumeration attribute node (recursive).
cur | the tree to free. |
void xmlFreeIDTable | ( | xmlIDTable * | table | ) |
Deallocate the memory used by an ID hash table.
table | An id table |
void xmlFreeNotationTable | ( | xmlNotationTable * | table | ) |
Deallocate the memory used by an entities hash table.
table | An notation table |
void xmlFreeRefTable | ( | xmlRefTable * | table | ) |
Deallocate the memory used by an Ref hash table.
table | a ref table |
void xmlFreeValidCtxt | ( | xmlValidCtxt * | cur | ) |
Free a validation context structure.
cur | the validation context to free |
xmlAttribute * xmlGetDtdAttrDesc | ( | xmlDtd * | dtd, |
const xmlChar * | elem, | ||
const xmlChar * | name | ||
) |
Search the DTD for the description of this attribute on this element.
dtd | a pointer to the DtD to search |
elem | the element name |
name | the attribute name |
xmlElement * xmlGetDtdElementDesc | ( | xmlDtd * | dtd, |
const xmlChar * | name | ||
) |
Search the DTD for the description of this element.
NOTE: A NULL return value can also mean that a memory allocation failed.
dtd | a pointer to the DtD to search |
name | the element name |
xmlNotation * xmlGetDtdNotationDesc | ( | xmlDtd * | dtd, |
const xmlChar * | name | ||
) |
Search the DTD for the description of this notation.
dtd | a pointer to the DtD to search |
name | the notation name |
xmlAttribute * xmlGetDtdQAttrDesc | ( | xmlDtd * | dtd, |
const xmlChar * | elem, | ||
const xmlChar * | name, | ||
const xmlChar * | prefix | ||
) |
Search the DTD for the description of this qualified attribute on this element.
dtd | a pointer to the DtD to search |
elem | the element name |
name | the attribute name |
prefix | the attribute namespace prefix |
xmlElement * xmlGetDtdQElementDesc | ( | xmlDtd * | dtd, |
const xmlChar * | name, | ||
const xmlChar * | prefix | ||
) |
Search the DTD for the description of this element.
dtd | a pointer to the DtD to search |
name | the element name |
prefix | the element namespace prefix |
Search the document's ID table for the attribute with the given ID.
doc | pointer to the document |
ID | the ID value |
Find the set of references for the supplied ID.
doc | pointer to the document |
ID | the ID value |
Determine whether an attribute is of type ID.
In case we have DTD(s) then this is done if DTD loading has been requested. In case of HTML documents parsed with the HTML parser, ID detection is done systematically.
doc | the document |
elem | the element carrying the attribute |
attr | the attribute |
Search in the DTDs whether an element accepts mixed content or ANY (basically if it is supposed to accept text children).
doc | the document |
name | the element name |
Determine whether an attribute is of type Ref.
In case we have DTD(s) then this is simple, otherwise we use an heuristic: name Ref (upper or lowercase).
doc | the document |
elem | the element carrying the attribute |
attr | the attribute |
xmlElementContent * xmlNewDocElementContent | ( | xmlDoc * | doc, |
const xmlChar * | name, | ||
xmlElementContentType | type | ||
) |
Allocate an element content structure for the document.
doc | the document |
name | the subelement name or NULL |
type | the type of element content decl |
xmlElementContent * xmlNewElementContent | ( | const xmlChar * | name, |
xmlElementContentType | type | ||
) |
Allocate an element content structure.
Deprecated in favor of xmlNewDocElementContent()
name | the subelement name or NULL |
type | the type of element content decl |
xmlValidCtxt * xmlNewValidCtxt | ( | void | ) |
The public function calls related to validity checking.
The public function calls related to validity checking.
Remove the given attribute from the document's ID table.
doc | the document |
attr | the attribute |
Remove the given attribute from the Ref table maintained internally.
doc | the document |
attr | the attribute |
void xmlSnprintfElementContent | ( | char * | buf, |
int | size, | ||
xmlElementContent * | content, | ||
int | englob | ||
) |
This will dump the content of the element content definition Intended just for the debug routine.
buf | an output buffer |
size | the buffer size |
content | An element table |
englob | 1 if one must print the englobing parenthesis, 0 otherwise |
void xmlSprintfElementContent | ( | char * | buf, |
xmlElementContent * | content, | ||
int | englob | ||
) |
Deprecated, unsafe, use xmlSnprintfElementContent()
buf | an output buffer |
content | An element table |
englob | 1 if one must print the englobing parenthesis, 0 otherwise |
int xmlValidateAttributeDecl | ( | xmlValidCtxt * | ctxt, |
xmlDoc * | doc, | ||
xmlAttribute * | attr | ||
) |
Try to validate a single attribute definition.
Performs the following checks as described by the XML-1.0 recommendation:
The ID/IDREF uniqueness and matching are done separately.
ctxt | the validation context |
doc | a document instance |
attr | an attribute definition |
int xmlValidateAttributeValue | ( | xmlAttributeType | type, |
const xmlChar * | value | ||
) |
Validate that the given attribute value matches the proper production.
[ VC: ID ] Values of type ID must match the Name production....
[ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names ...
[ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names ...
[ VC: Name Token ] Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens.
type | an attribute type |
value | an attribute value |
int xmlValidateDocument | ( | xmlValidCtxt * | vctxt, |
xmlDoc * | doc | ||
) |
Try to validate the document instance.
Performs the all the checks described by the XML Rec, i.e. validates the internal and external subset (if present) and validates the document tree.
vctxt | the validation context |
doc | a document instance |
int xmlValidateDocumentFinal | ( | xmlValidCtxt * | ctxt, |
xmlDoc * | doc | ||
) |
Performs the final step of document validation once all the incremental validation steps have been completed.
Performs the following checks described by the XML Rec:
ctxt | the validation context |
doc | a document instance |
int xmlValidateDtd | ( | xmlValidCtxt * | ctxt, |
xmlDoc * | doc, | ||
xmlDtd * | dtd | ||
) |
Try to validate the document against the DTD instance.
Note that the internal subset (if present) is de-coupled (i.e. not used), which could cause problems if ID or IDREF attributes are present.
ctxt | the validation context |
doc | a document instance |
dtd | a DTD instance |
int xmlValidateDtdFinal | ( | xmlValidCtxt * | ctxt, |
xmlDoc * | doc | ||
) |
Performs the final validation steps of DTD content once all the subsets have been parsed.
Performs the following checks described by the XML Rec:
ctxt | the validation context |
doc | a document instance |
int xmlValidateElement | ( | xmlValidCtxt * | ctxt, |
xmlDoc * | doc, | ||
xmlNode * | root | ||
) |
Try to validate the subtree under an element.
ctxt | the validation context |
doc | a document instance |
root | an element instance |
int xmlValidateElementDecl | ( | xmlValidCtxt * | ctxt, |
xmlDoc * | doc, | ||
xmlElement * | elem | ||
) |
Try to validate a single element definition.
Performs the following checks as described by the XML-1.0 recommendation:
ctxt | the validation context |
doc | a document instance |
elem | an element definition |
int xmlValidateNamesValue | ( | const xmlChar * | value | ) |
Validate that the given value matches the Names production.
value | an Names value |
int xmlValidateNameValue | ( | const xmlChar * | value | ) |
Validate that the given value matches the Name production.
value | an Name value |
int xmlValidateNmtokensValue | ( | const xmlChar * | value | ) |
Validate that the given value matches the Nmtokens production.
[ VC: Name Token ]
value | an Nmtokens value |
int xmlValidateNmtokenValue | ( | const xmlChar * | value | ) |
Validate that the given value matches the Nmtoken production.
[ VC: Name Token ]
value | an Nmtoken value |
int xmlValidateNotationDecl | ( | xmlValidCtxt * | ctxt, |
xmlDoc * | doc, | ||
xmlNotation * | nota | ||
) |
Try to validate a single notation definition.
It seems that no validity constraint exists on notation declarations. But this function gets called anyway ...
ctxt | the validation context |
doc | a document instance |
nota | a notation definition |
int xmlValidateNotationUse | ( | xmlValidCtxt * | ctxt, |
xmlDoc * | doc, | ||
const xmlChar * | notationName | ||
) |
Validate that the given name match a notation declaration.
[ VC: Notation Declared ]
ctxt | the validation context |
doc | the document |
notationName | the notation name to check |
int xmlValidateOneAttribute | ( | xmlValidCtxt * | ctxt, |
xmlDoc * | doc, | ||
xmlNode * | elem, | ||
xmlAttr * | attr, | ||
const xmlChar * | value | ||
) |
Try to validate a single attribute for an element.
Performs the following checks as described by the XML-1.0 recommendation:
ID/IDREF uniqueness and matching are handled separately.
ctxt | the validation context |
doc | a document instance |
elem | an element instance |
attr | an attribute instance |
value | the attribute value (without entities processing) |
int xmlValidateOneElement | ( | xmlValidCtxt * | ctxt, |
xmlDoc * | doc, | ||
xmlNode * | elem | ||
) |
Try to validate a single element and its attributes.
Performs the following checks as described by the XML-1.0 recommendation:
Then calls xmlValidateOneAttribute() for each attribute present.
ID/IDREF checks are handled separately.
ctxt | the validation context |
doc | a document instance |
elem | an element instance |
int xmlValidateOneNamespace | ( | xmlValidCtxt * | ctxt, |
xmlDoc * | doc, | ||
xmlNode * | elem, | ||
const xmlChar * | prefix, | ||
xmlNs * | ns, | ||
const xmlChar * | value | ||
) |
Try to validate a single namespace declaration for an element.
Performs the following checks as described by the XML-1.0 recommendation:
ID/IDREF uniqueness and matching are handled separately.
ctxt | the validation context |
doc | a document instance |
elem | an element instance |
prefix | the namespace prefix |
ns | an namespace declaration instance |
value | the attribute value (without entities processing) |
int xmlValidatePopElement | ( | xmlValidCtxt * | ctxt, |
xmlDoc * | doc, | ||
xmlNode * | elem, | ||
const xmlChar * | qname | ||
) |
Pop the element end from the validation stack.
ctxt | the validation context |
doc | a document instance |
elem | an element instance |
qname | the qualified name as appearing in the serialization |
int xmlValidatePushCData | ( | xmlValidCtxt * | ctxt, |
const xmlChar * | data, | ||
int | len | ||
) |
Check the CData parsed for validation in the current stack.
ctxt | the validation context |
data | some character data read |
len | the length of the data |
int xmlValidatePushElement | ( | xmlValidCtxt * | ctxt, |
xmlDoc * | doc, | ||
xmlNode * | elem, | ||
const xmlChar * | qname | ||
) |
Push a new element start on the validation stack.
ctxt | the validation context |
doc | a document instance |
elem | an element instance |
qname | the qualified name as appearing in the serialization |
int xmlValidateRoot | ( | xmlValidCtxt * | ctxt, |
xmlDoc * | doc | ||
) |
Try to validate the root element.
Performs the following check as described by the XML-1.0 recommendation:
It doesn't try to recurse or apply other checks to the element.
ctxt | the validation context |
doc | a document instance |
int xmlValidBuildContentModel | ( | xmlValidCtxt * | ctxt, |
xmlElement * | elem | ||
) |
(Re)Build the automata associated to the content model of this element
ctxt | a validation context |
elem | an element declaration node |
xmlChar * xmlValidCtxtNormalizeAttributeValue | ( | xmlValidCtxt * | ctxt, |
xmlDoc * | doc, | ||
xmlNode * | elem, | ||
const xmlChar * | name, | ||
const xmlChar * | value | ||
) |
Performs the validation-related extra step of the normalization of attribute values:
If the declared value is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by single space (#x20) character.
Also check VC: Standalone Document Declaration in P32, and update ctxt->valid
accordingly
ctxt | the validation context |
doc | the document |
elem | the parent |
name | the attribute name |
value | the attribute value |
int xmlValidGetPotentialChildren | ( | xmlElementContent * | ctree, |
const xmlChar ** | names, | ||
int * | len, | ||
int | max | ||
) |
Build/extend a list of potential children allowed by the content tree.
ctree | an element content tree |
names | an array to store the list of child names |
len | a pointer to the number of element in the list |
max | the size of the array |
This function returns the list of authorized children to insert within an existing tree while respecting the validity constraints forced by the Dtd.
The insertion point is defined using prev
and next
in the following ways: to insert before 'node': xmlValidGetValidElements(node->prev, node, ... to insert next 'node': xmlValidGetValidElements(node, node->next, ... to replace 'node': xmlValidGetValidElements(node->prev, node->next, ... to prepend a child to 'node': xmlValidGetValidElements(NULL, node->childs, to append a child to 'node': xmlValidGetValidElements(node->last, NULL, ...
pointers to the element names are inserted at the beginning of the array and do not need to be freed.
prev | an element to insert after |
next | an element to insert next |
names | an array to store the list of child names |
max | the size of the array |
max
the caller is invited to grow the receiving array and retry. xmlChar * xmlValidNormalizeAttributeValue | ( | xmlDoc * | doc, |
xmlNode * | elem, | ||
const xmlChar * | name, | ||
const xmlChar * | value | ||
) |
Performs the validation-related extra step of the normalization of attribute values:
If the declared value is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by single space (#x20) character.
doc | the document |
elem | the parent |
name | the attribute name |
value | the attribute value |