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

Function xmlSAX2ElementDecl

ThirdParty/libxml2/vtklibxml2/SAX2.c:691–724  ·  view source on GitHub ↗

* xmlSAX2ElementDecl: * @ctx: the user data (XML parser context) * @name: the element name * @type: the element type * @content: the element value tree * * An element definition has been parsed */

Source from the content-addressed store, hash-verified

689 * An element definition has been parsed
690 */
691void
692xmlSAX2ElementDecl(void *ctx, const xmlChar * name, int type,
693 xmlElementContentPtr content)
694{
695 xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
696 xmlElementPtr elem = NULL;
697
698 /* Avoid unused variable warning if features are disabled. */
699 (void) elem;
700
701 if ((ctxt == NULL) || (ctxt->myDoc == NULL))
702 return;
703
704 if (ctxt->inSubset == 1)
705 elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->intSubset,
706 name, (xmlElementTypeVal) type, content);
707 else if (ctxt->inSubset == 2)
708 elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->extSubset,
709 name, (xmlElementTypeVal) type, content);
710 else {
711 xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
712 "SAX.xmlSAX2ElementDecl(%s) called while not in subset\n",
713 name, NULL);
714 return;
715 }
716#ifdef LIBXML_VALID_ENABLED
717 if (elem == NULL)
718 ctxt->valid = 0;
719 if (ctxt->validate && ctxt->wellFormed &&
720 ctxt->myDoc && ctxt->myDoc->intSubset)
721 ctxt->valid &=
722 xmlValidateElementDecl(&ctxt->vctxt, ctxt->myDoc, elem);
723#endif /* LIBXML_VALID_ENABLED */
724}
725
726/**
727 * xmlSAX2NotationDecl:

Callers 1

elementDeclFunction · 0.85

Calls 2

xmlAddElementDeclFunction · 0.85
xmlValidateElementDeclFunction · 0.85

Tested by

no test coverage detected