libxml2_valid.h File Reference

Typedef xmlValidState

typedef struct _xmlValidStatexmlValidState

Typedef xmlValidStatePtr

typedef xmlValidState *xmlValidStatePtr

Typedef xmlValidityErrorFunc

typedef void(*xmlValidityErrorFunc

xmlValidityErrorFunc: Callback called when a validity error is found. This is a message oriented function similar to an *printf function.

Typedef xmlValidityWarningFunc

typedef void(*xmlValidityWarningFunc

xmlValidityWarningFunc: Callback called when a validity warning is found. This is a message oriented function similar to an *printf function.

Typedef xmlValidCtxt

typedef struct _xmlValidCtxtxmlValidCtxt

Typedef xmlValidCtxtPtr

typedef xmlValidCtxt *xmlValidCtxtPtr

Typedef xmlNotationTable

typedef struct _xmlHashTablexmlNotationTable

Typedef xmlNotationTablePtr

typedef xmlNotationTable *xmlNotationTablePtr

Typedef xmlElementTable

typedef struct _xmlHashTablexmlElementTable

Typedef xmlElementTablePtr

typedef xmlElementTable *xmlElementTablePtr

Typedef xmlAttributeTable

typedef struct _xmlHashTablexmlAttributeTable

Typedef xmlAttributeTablePtr

typedef xmlAttributeTable *xmlAttributeTablePtr

Typedef xmlIDTable

typedef struct _xmlHashTablexmlIDTable

Typedef xmlIDTablePtr

typedef xmlIDTable *xmlIDTablePtr

Typedef xmlRefTable

typedef struct _xmlHashTablexmlRefTable

Typedef xmlRefTablePtr

typedef xmlRefTable *xmlRefTablePtr

xmlNewValidCtxt ( void )

XMLPUBFUN xmlValidCtxtPtr XMLCALLxmlNewValidCtxt(void)

xmlFreeValidCtxt ( xmlValidCtxtPtr )

XMLPUBFUN void XMLCALLxmlFreeValidCtxt(xmlValidCtxtPtr)

xmlAddNotationDecl ( xmlValidCtxtPtr, xmlDtdPtr, const xmlChar *, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlNotationPtr XMLCALLxmlAddNotationDecl(xmlValidCtxtPtrctxt,
xmlDtdPtrdtd,
const xmlChar *name,
const xmlChar *PublicID,
const xmlChar *SystemID
)

xmlAddNotationDecl: Register a new notation declaration

Returns NULL if not, otherwise the entity

Parameters
ctxtthe validation context
dtdpointer to the DTD
namethe entity name
PublicIDthe public identifier or NULL
SystemIDthe system identifier or NULL

xmlCopyNotationTable ( xmlNotationTablePtr )

XMLPUBFUN xmlNotationTablePtr XMLCALLxmlCopyNotationTable(xmlNotationTablePtrtable)

xmlFreeNotationTable ( xmlNotationTablePtr )

XMLPUBFUN void XMLCALLxmlFreeNotationTable(xmlNotationTablePtrtable)

xmlFreeNotationTable: Deallocate the memory used by an entities hash table.

Parameters
tableAn notation table

xmlNewElementContent ( const xmlChar *, xmlElementContentType )

XMLPUBFUN xmlElementContentPtr XMLCALLxmlNewElementContent(const xmlChar *name,
xmlElementContentTypetype
)

xmlNewElementContent: Allocate an element content structure.

Returns NULL if not, otherwise the new element content structure

OOM: possible --> returns NULL for valid arguments

Parameters
namethe subelement name or NULL
typethe type of element content decl

xmlCopyElementContent ( xmlElementContentPtr )

XMLPUBFUN xmlElementContentPtr XMLCALLxmlCopyElementContent(xmlElementContentPtrcontent)

xmlCopyElementContent: Build a copy of an element content description.

Returns the new xmlElementContentPtr or NULL in case of error.

Parameters
contentAn element content pointer.

xmlFreeElementContent ( xmlElementContentPtr )

XMLPUBFUN void XMLCALLxmlFreeElementContent(xmlElementContentPtrcur)

xmlFreeElementContent: Free an element content structure. This is a recursive call !

Parameters
curthe element content tree to free

xmlSnprintfElementContent ( char *, int, xmlElementContentPtr, int )

XMLPUBFUN void XMLCALLxmlSnprintfElementContent(char *buf,
intsize,
xmlElementContentPtrcontent,
intglob
)

xmlSnprintfElementContent: This will dump the content of the element content definition Intended just for the debug routine

Parameters
bufan output buffer
sizethe buffer size
contentAn element table
glob1 if one must print the enclobing parenthesis, 0 otherwise

xmlSprintfElementContent ( char *, xmlElementContentPtr, int )

XMLPUBFUN void XMLCALLxmlSprintfElementContent(char *buf,
xmlElementContentPtrcontent,
intglob
)

xmlAddElementDecl ( xmlValidCtxtPtr, xmlDtdPtr, const xmlChar *, xmlElementTypeVal, xmlElementContentPtr )

XMLPUBFUN xmlElementPtr XMLCALLxmlAddElementDecl(xmlValidCtxtPtrctxt,
xmlDtdPtrdtd,
const xmlChar *name,
xmlElementTypeValtype,
xmlElementContentPtrcontent
)

xmlAddElementDecl: Register a new element declaration

Returns NULL if not, otherwise the entity

Parameters
ctxtthe validation context
dtdpointer to the DTD
namethe entity name
typethe element type
contentthe element content tree or NULL

xmlCopyElementTable ( xmlElementTablePtr )

XMLPUBFUN xmlElementTablePtr XMLCALLxmlCopyElementTable(xmlElementTablePtrtable)

xmlFreeElementTable ( xmlElementTablePtr )

XMLPUBFUN void XMLCALLxmlFreeElementTable(xmlElementTablePtrtable)

xmlFreeElementTable: Deallocate the memory used by an element hash table.

Parameters
tableAn element table

xmlCreateEnumeration ( const xmlChar * )

XMLPUBFUN xmlEnumerationPtr XMLCALLxmlCreateEnumeration(const xmlChar *name)

xmlCreateEnumeration: create and initialize an enumeration attribute node.

Returns the xmlEnumerationPtr just created or NULL in case of error.

Parameters
namethe enumeration name or NULL

xmlFreeEnumeration ( xmlEnumerationPtr )

XMLPUBFUN void XMLCALLxmlFreeEnumeration(xmlEnumerationPtrcur)

xmlFreeEnumeration: free an enumeration attribute node (recursive).

Parameters
curthe tree to free.

xmlCopyEnumeration ( xmlEnumerationPtr )

XMLPUBFUN xmlEnumerationPtr XMLCALLxmlCopyEnumeration(xmlEnumerationPtrcur)

xmlAddAttributeDecl ( xmlValidCtxtPtr, xmlDtdPtr, const xmlChar *, const xmlChar *, const xmlChar *, xmlAttributeType, xmlAttributeDefault, const xmlChar *, xmlEnumerationPtr )

XMLPUBFUN xmlAttributePtr XMLCALLxmlAddAttributeDecl(xmlValidCtxtPtrctxt,
xmlDtdPtrdtd,
const xmlChar *elem,
const xmlChar *name,
const xmlChar *ns,
xmlAttributeTypetype,
xmlAttributeDefaultdef,
const xmlChar *defaultValue,
xmlEnumerationPtrtree
)

xmlAddAttributeDecl: Register a new attribute declaration Note that tree becomes the ownership of the DTD

Returns NULL if not new, otherwise the attribute decl

Parameters
ctxtthe validation context
dtdpointer to the DTD
elemthe element name
namethe attribute name
nsthe attribute namespace prefix
typethe attribute type
defthe attribute default type
defaultValuethe attribute default value
treeif it's an enumeration, the associated list

xmlCopyAttributeTable ( xmlAttributeTablePtr )

XMLPUBFUN xmlAttributeTablePtr XMLCALLxmlCopyAttributeTable(xmlAttributeTablePtrtable)

xmlFreeAttributeTable ( xmlAttributeTablePtr )

XMLPUBFUN void XMLCALLxmlFreeAttributeTable(xmlAttributeTablePtrtable)

xmlFreeAttributeTable: Deallocate the memory used by an entities hash table.

Parameters
tableAn attribute table

xmlAddID ( xmlValidCtxtPtr, xmlDocPtr, const xmlChar *, xmlAttrPtr )

XMLPUBFUN xmlIDPtr XMLCALLxmlAddID(xmlValidCtxtPtrctxt,
xmlDocPtrdoc,
const xmlChar *value,
xmlAttrPtrattr
)

xmlAddID: Register a new id declaration

Returns NULL if not, otherwise the new xmlIDPtr

OOM: possible --> check OOM flag if returns NULL

Parameters
ctxtthe validation context
docpointer to the document
valuethe value name
attrthe attribute holding the ID

xmlFreeIDTable ( xmlIDTablePtr )

XMLPUBFUN void XMLCALLxmlFreeIDTable(xmlIDTablePtrtable)

xmlFreeIDTable: Deallocate the memory used by an ID hash table.

Parameters
tableAn id table

xmlGetID ( xmlDocPtr, const xmlChar * )

XMLPUBFUN xmlAttrPtr XMLCALLxmlGetID(xmlDocPtrdoc,
const xmlChar *ID
)

xmlGetID: Search the attribute declaring the given ID

Returns NULL if not found, otherwise the xmlAttrPtr defining the ID

Parameters
docpointer to the document
IDthe ID value

xmlIsID ( xmlDocPtr, xmlNodePtr, xmlAttrPtr )

XMLPUBFUN int XMLCALLxmlIsID(xmlDocPtrdoc,
xmlNodePtrelem,
xmlAttrPtrattr
)

xmlIsID: 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 the case of HTML documents parsed with the HTML parser, then ID detection is done systematically.

Returns 0 or 1 depending on the lookup result

OOM: possible --> set OOM flag when returns 0

Parameters
docthe document
elemthe element carrying the attribute
attrthe attribute

xmlRemoveID ( xmlDocPtr, xmlAttrPtr )

XMLPUBFUN int XMLCALLxmlRemoveID(xmlDocPtrdoc,
xmlAttrPtrattr
)

xmlRemoveID: Remove the given attribute from the ID table maintained internally.

Returns -1 if the lookup failed and 0 otherwise

Parameters
docthe document
attrthe attribute

xmlAddRef ( xmlValidCtxtPtr, xmlDocPtr, const xmlChar *, xmlAttrPtr )

XMLPUBFUN xmlRefPtr XMLCALLxmlAddRef(xmlValidCtxtPtrctxt,
xmlDocPtrdoc,
const xmlChar *value,
xmlAttrPtrattr
)

xmlAddRef: Register a new ref declaration

Returns NULL if not, otherwise the new xmlRefPtr

Parameters
ctxtthe validation context
docpointer to the document
valuethe value name
attrthe attribute holding the Ref

xmlFreeRefTable ( xmlRefTablePtr )

XMLPUBFUN void XMLCALLxmlFreeRefTable(xmlRefTablePtrtable)

xmlFreeRefTable: Deallocate the memory used by an Ref hash table.

Parameters
tableAn ref table

xmlIsRef ( xmlDocPtr, xmlNodePtr, xmlAttrPtr )

XMLPUBFUN int XMLCALLxmlIsRef(xmlDocPtrdoc,
xmlNodePtrelem,
xmlAttrPtrattr
)

xmlIsRef: 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).

Returns 0 or 1 depending on the lookup result

Parameters
docthe document
elemthe element carrying the attribute
attrthe attribute

xmlRemoveRef ( xmlDocPtr, xmlAttrPtr )

XMLPUBFUN int XMLCALLxmlRemoveRef(xmlDocPtrdoc,
xmlAttrPtrattr
)

xmlRemoveRef: Remove the given attribute from the Ref table maintained internally.

Returns -1 if the lookup failed and 0 otherwise

Parameters
docthe document
attrthe attribute

xmlGetRefs ( xmlDocPtr, const xmlChar * )

XMLPUBFUN xmlListPtr XMLCALLxmlGetRefs(xmlDocPtrdoc,
const xmlChar *ID
)

xmlGetRefs: Find the set of references for the supplied ID.

Returns NULL if not found, otherwise node set for the ID.

Parameters
docpointer to the document
IDthe ID value

xmlValidateRoot ( xmlValidCtxtPtr, xmlDocPtr )

XMLPUBFUN int XMLCALLxmlValidateRoot(xmlValidCtxtPtrctxt,
xmlDocPtrdoc
)

The public function calls related to validity checking.

xmlValidateElementDecl ( xmlValidCtxtPtr, xmlDocPtr, xmlElementPtr )

XMLPUBFUN int XMLCALLxmlValidateElementDecl(xmlValidCtxtPtrctxt,
xmlDocPtrdoc,
xmlElementPtrelem
)

xmlValidNormalizeAttributeValue ( xmlDocPtr, xmlNodePtr, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlChar *XMLCALLxmlValidNormalizeAttributeValue(xmlDocPtrdoc,
xmlNodePtrelem,
const xmlChar *name,
const xmlChar *value
)

xmlValidCtxtNormalizeAttributeValue ( xmlValidCtxtPtr, xmlDocPtr, xmlNodePtr, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlChar *XMLCALLxmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtrctxt,
xmlDocPtrdoc,
xmlNodePtrelem,
const xmlChar *name,
const xmlChar *value
)

xmlValidateAttributeDecl ( xmlValidCtxtPtr, xmlDocPtr, xmlAttributePtr )

XMLPUBFUN int XMLCALLxmlValidateAttributeDecl(xmlValidCtxtPtrctxt,
xmlDocPtrdoc,
xmlAttributePtrattr
)

xmlValidateAttributeValue ( xmlAttributeType, const xmlChar * )

XMLPUBFUN int XMLCALLxmlValidateAttributeValue(xmlAttributeTypetype,
const xmlChar *value
)

xmlValidateNotationDecl ( xmlValidCtxtPtr, xmlDocPtr, xmlNotationPtr )

XMLPUBFUN int XMLCALLxmlValidateNotationDecl(xmlValidCtxtPtrctxt,
xmlDocPtrdoc,
xmlNotationPtrnota
)

xmlValidateDtd ( xmlValidCtxtPtr, xmlDocPtr, xmlDtdPtr )

XMLPUBFUN int XMLCALLxmlValidateDtd(xmlValidCtxtPtrctxt,
xmlDocPtrdoc,
xmlDtdPtrdtd
)

xmlValidateDtdFinal ( xmlValidCtxtPtr, xmlDocPtr )

XMLPUBFUN int XMLCALLxmlValidateDtdFinal(xmlValidCtxtPtrctxt,
xmlDocPtrdoc
)

xmlValidateDocument ( xmlValidCtxtPtr, xmlDocPtr )

XMLPUBFUN int XMLCALLxmlValidateDocument(xmlValidCtxtPtrctxt,
xmlDocPtrdoc
)

xmlValidateElement ( xmlValidCtxtPtr, xmlDocPtr, xmlNodePtr )

XMLPUBFUN int XMLCALLxmlValidateElement(xmlValidCtxtPtrctxt,
xmlDocPtrdoc,
xmlNodePtrelem
)

xmlValidateOneElement ( xmlValidCtxtPtr, xmlDocPtr, xmlNodePtr )

XMLPUBFUN int XMLCALLxmlValidateOneElement(xmlValidCtxtPtrctxt,
xmlDocPtrdoc,
xmlNodePtrelem
)

xmlValidateOneAttribute ( xmlValidCtxtPtr, xmlDocPtr, xmlNodePtr, xmlAttrPtr, const xmlChar * )

XMLPUBFUN int XMLCALLxmlValidateOneAttribute(xmlValidCtxtPtrctxt,
xmlDocPtrdoc,
xmlNodePtrelem,
xmlAttrPtrattr,
const xmlChar *value
)

xmlValidateOneNamespace ( xmlValidCtxtPtr, xmlDocPtr, xmlNodePtr, const xmlChar *, xmlNsPtr, const xmlChar * )

XMLPUBFUN int XMLCALLxmlValidateOneNamespace(xmlValidCtxtPtrctxt,
xmlDocPtrdoc,
xmlNodePtrelem,
const xmlChar *prefix,
xmlNsPtrns,
const xmlChar *value
)

xmlValidateDocumentFinal ( xmlValidCtxtPtr, xmlDocPtr )

XMLPUBFUN int XMLCALLxmlValidateDocumentFinal(xmlValidCtxtPtrctxt,
xmlDocPtrdoc
)

xmlValidateNotationUse ( xmlValidCtxtPtr, xmlDocPtr, const xmlChar * )

XMLPUBFUN int XMLCALLxmlValidateNotationUse(xmlValidCtxtPtrctxt,
xmlDocPtrdoc,
const xmlChar *notationName
)

xmlIsMixedElement ( xmlDocPtr, const xmlChar * )

XMLPUBFUN int XMLCALLxmlIsMixedElement(xmlDocPtrdoc,
const xmlChar *name
)

xmlIsMixedElement: Search in the DtDs whether an element accept Mixed content (or ANY) basically if it is supposed to accept text childs

returns 0 if no, 1 if yes, and -1 if no element description is available

Parameters
docthe document
namethe element name

xmlGetDtdAttrDesc ( xmlDtdPtr, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlAttributePtr XMLCALLxmlGetDtdAttrDesc(xmlDtdPtrdtd,
const xmlChar *elem,
const xmlChar *name
)

xmlGetDtdAttrDesc: Search the DTD for the description of this attribute on this element.

returns the xmlAttributePtr if found or NULL

OOM: iif returns NULL and OOM flag is set

Parameters
dtda pointer to the DtD to search
elemthe element name
namethe attribute name

xmlGetDtdQAttrDesc ( xmlDtdPtr, const xmlChar *, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlAttributePtr XMLCALLxmlGetDtdQAttrDesc(xmlDtdPtrdtd,
const xmlChar *elem,
const xmlChar *name,
const xmlChar *prefix
)

xmlGetDtdQAttrDesc: Search the DTD for the description of this qualified attribute on this element.

returns the xmlAttributePtr if found or NULL

OOM: never

Parameters
dtda pointer to the DtD to search
elemthe element name
namethe attribute name
prefixthe attribute namespace prefix

xmlGetDtdNotationDesc ( xmlDtdPtr, const xmlChar * )

XMLPUBFUN xmlNotationPtr XMLCALLxmlGetDtdNotationDesc(xmlDtdPtrdtd,
const xmlChar *name
)

xmlGetDtdNotationDesc: Search the DTD for the description of this notation

returns the xmlNotationPtr if found or NULL

Parameters
dtda pointer to the DtD to search
namethe notation name

xmlGetDtdQElementDesc ( xmlDtdPtr, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlElementPtr XMLCALLxmlGetDtdQElementDesc(xmlDtdPtrdtd,
const xmlChar *name,
const xmlChar *prefix
)

xmlGetDtdQElementDesc: Search the DTD for the description of this element

returns the xmlElementPtr if found or NULL

OOM: never

Parameters
dtda pointer to the DtD to search
namethe element name
prefixthe element namespace prefix

xmlGetDtdElementDesc ( xmlDtdPtr, const xmlChar * )

XMLPUBFUN xmlElementPtr XMLCALLxmlGetDtdElementDesc(xmlDtdPtrdtd,
const xmlChar *name
)

xmlGetDtdElementDesc: Search the DTD for the description of this element

returns the xmlElementPtr if found or NULL

Parameters
dtda pointer to the DtD to search
namethe element name

xmlValidGetValidElements ( xmlNode *, xmlNode *, const xmlChar **, int )

XMLPUBFUN int XMLCALLxmlValidGetValidElements(xmlNode *prev,
xmlNode *next,
const xmlChar **names,
intmax
)

xmlValidGetPotentialChildren ( xmlElementContent *, const xmlChar **, int *, int )

XMLPUBFUN int XMLCALLxmlValidGetPotentialChildren(xmlElementContent *ctree,
const xmlChar **list,
int *len,
intmax
)

xmlValidateNameValue ( const xmlChar * )

XMLPUBFUN int XMLCALLxmlValidateNameValue(const xmlChar *value)

xmlValidateNamesValue ( const xmlChar * )

XMLPUBFUN int XMLCALLxmlValidateNamesValue(const xmlChar *value)

xmlValidateNmtokenValue ( const xmlChar * )

XMLPUBFUN int XMLCALLxmlValidateNmtokenValue(const xmlChar *value)

xmlValidateNmtokensValue ( const xmlChar * )

XMLPUBFUN int XMLCALLxmlValidateNmtokensValue(const xmlChar *value)