MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlValidatePopElement

Function xmlValidatePopElement

ThirdParty/libxml2/vtklibxml2/valid.c:5750–5794  ·  view source on GitHub ↗

* xmlValidatePopElement: * @ctxt: the validation context * @doc: a document instance * @elem: an element instance * @qname: the qualified name as appearing in the serialization * * DEPRECATED: Internal function, don't use. * * Pop the element end from the validation stack. * * returns 1 if no validation problem was found or 0 otherwise */

Source from the content-addressed store, hash-verified

5748 * returns 1 if no validation problem was found or 0 otherwise
5749 */
5750int
5751xmlValidatePopElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc ATTRIBUTE_UNUSED,
5752 xmlNodePtr elem ATTRIBUTE_UNUSED,
5753 const xmlChar *qname ATTRIBUTE_UNUSED) {
5754 int ret = 1;
5755
5756 if (ctxt == NULL)
5757 return(0);
5758/* printf("PopElem %s\n", qname); */
5759 if ((ctxt->vstateNr > 0) && (ctxt->vstate != NULL)) {
5760 xmlValidStatePtr state = ctxt->vstate;
5761 xmlElementPtr elemDecl;
5762
5763 /*
5764 * Check the new element against the content model of the new elem.
5765 */
5766 if (state->elemDecl != NULL) {
5767 elemDecl = state->elemDecl;
5768
5769 if (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT) {
5770 if (state->exec != NULL) {
5771 ret = xmlRegExecPushString(state->exec, NULL, NULL);
5772 if (ret <= 0) {
5773 if (ret == XML_REGEXP_OUT_OF_MEMORY)
5774 xmlVErrMemory(ctxt);
5775 else
5776 xmlErrValidNode(ctxt, state->node,
5777 XML_DTD_CONTENT_MODEL,
5778 "Element %s content does not follow the DTD, Expecting more children\n",
5779 state->node->name, NULL,NULL);
5780 ret = 0;
5781 } else {
5782 /*
5783 * previous validation errors should not generate
5784 * a new one here
5785 */
5786 ret = 1;
5787 }
5788 }
5789 }
5790 }
5791 vstateVPop(ctxt);
5792 }
5793 return(ret);
5794}
5795#endif /* LIBXML_REGEXP_ENABLED */
5796
5797/**

Callers 2

xmlTextReaderValidatePopFunction · 0.85
xmlTextReaderCloseFunction · 0.85

Calls 3

xmlRegExecPushStringFunction · 0.85
xmlVErrMemoryFunction · 0.85
vstateVPopFunction · 0.85

Tested by

no test coverage detected