• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src/router/libxml2/

Lines Matching defs:elem

632 /* TODO: use hash table for accesses to elem and attribute definitions */
805 * @elem: an element declaration node
813 xmlValidBuildContentModel(xmlValidCtxtPtr ctxt, xmlElementPtr elem) {
815 if ((ctxt == NULL) || (elem == NULL))
817 if (elem->type != XML_ELEMENT_DECL)
819 if (elem->etype != XML_ELEMENT_TYPE_ELEMENT)
822 if (elem->contModel != NULL) {
823 if (!xmlRegexpIsDeterminist(elem->contModel)) {
832 xmlErrValidNode(ctxt, (xmlNodePtr) elem,
835 elem->name, NULL, NULL);
839 xmlValidBuildAContentModel(elem->content, ctxt, elem->name);
841 elem->contModel = xmlAutomataCompile(ctxt->am);
842 if (xmlRegexpIsDeterminist(elem->contModel) != 1) {
845 xmlSnprintfElementContent(expr, 5000, elem->content, 1);
846 xmlErrValidNode(ctxt, (xmlNodePtr) elem,
849 elem->name, BAD_CAST expr, NULL);
851 xmlRegexpPrint(stderr, elem->contModel);
1347 * @elem: An element
1352 xmlFreeElement(xmlElementPtr elem) {
1353 if (elem == NULL) return;
1354 xmlUnlinkNode((xmlNodePtr) elem);
1355 xmlFreeDocElementContent(elem->doc, elem->content);
1356 if (elem->name != NULL)
1357 xmlFree((xmlChar *) elem->name);
1358 if (elem->prefix != NULL)
1359 xmlFree((xmlChar *) elem->prefix);
1361 if (elem->contModel != NULL)
1362 xmlRegFreeRegexp(elem->contModel);
1364 xmlFree(elem);
1608 * @elem: An element
1615 xmlCopyElement(xmlElementPtr elem) {
1625 cur->etype = elem->etype;
1626 if (elem->name != NULL)
1627 cur->name = xmlStrdup(elem->name);
1630 if (elem->prefix != NULL)
1631 cur->prefix = xmlStrdup(elem->prefix);
1634 cur->content = xmlCopyElementContent(elem->content);
1659 * @elem: An element table
1665 xmlDumpElementDecl(xmlBufferPtr buf, xmlElementPtr elem) {
1666 if ((buf == NULL) || (elem == NULL))
1668 switch (elem->etype) {
1671 if (elem->prefix != NULL) {
1672 xmlBufferWriteCHAR(buf, elem->prefix);
1675 xmlBufferWriteCHAR(buf, elem->name);
1680 if (elem->prefix != NULL) {
1681 xmlBufferWriteCHAR(buf, elem->prefix);
1684 xmlBufferWriteCHAR(buf, elem->name);
1689 if (elem->prefix != NULL) {
1690 xmlBufferWriteCHAR(buf, elem->prefix);
1693 xmlBufferWriteCHAR(buf, elem->name);
1695 xmlDumpElementContent(buf, elem->content, 1);
1700 if (elem->prefix != NULL) {
1701 xmlBufferWriteCHAR(buf, elem->prefix);
1704 xmlBufferWriteCHAR(buf, elem->name);
1706 xmlDumpElementContent(buf, elem->content, 1);
1718 * @elem: An element table
1725 xmlDumpElementDeclScan(xmlElementPtr elem, xmlBufferPtr buf) {
1726 xmlDumpElementDecl(buf, elem);
1836 * @elem: the element name
1845 xmlScanIDAttributeDecl(xmlValidCtxtPtr ctxt, xmlElementPtr elem, int err) {
1849 if (elem == NULL) return(0);
1850 cur = elem->attributes;
1855 xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_MULTIPLE_ID,
1857 elem->name, cur->name, NULL);
1867 * @elem: An attribute
1884 if ((attr->elem != NULL) && (!xmlDictOwns(dict, attr->elem)))
1885 xmlFree((xmlChar *) attr->elem);
1894 if (attr->elem != NULL)
1895 xmlFree((xmlChar *) attr->elem);
1911 * @elem: the element name
1926 xmlDtdPtr dtd, const xmlChar *elem,
1943 if (elem == NULL) {
1986 elem, name, defaultValue);
2000 ret = xmlHashLookup3(dtd->doc->intSubset->attributes, name, ns, elem);
2045 ret->elem = xmlDictLookup(dict, elem, -1);
2049 ret->elem = xmlStrdup(elem);
2064 if (xmlHashAddEntry3(table, ret->name, ret->prefix, ret->elem, ret) < 0) {
2071 name, elem, NULL);
2081 elemDef = xmlGetDtdElementDesc2(dtd, elem, 1);
2089 elem, name, NULL);
2173 if (attr->elem != NULL)
2174 cur->elem = xmlStrdup(attr->elem);
2213 xmlBufferWriteCHAR(buf, attr->elem);
2664 * @elem: the element carrying the attribute
2675 xmlIsID(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) {
2688 ((elem == NULL) || (xmlStrEqual(elem->name, BAD_CAST "a")))))
2691 } else if (elem == NULL) {
2699 fullelemname = (elem->ns != NULL && elem->ns->prefix != NULL) ?
2700 xmlBuildQName(elem->name, elem->ns->prefix, felem, 50) :
2701 (xmlChar *)elem->name;
2717 if ((fullelemname != felem) && (fullelemname != elem->name))
3004 * @elem: the element carrying the attribute
3014 xmlIsRef(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) {
3030 if (elem == NULL) return(0);
3031 attrDecl = xmlGetDtdAttrDesc(doc->intSubset, elem->name, attr->name);
3034 elem->name, attr->name);
3258 * @elem: the element name
3268 xmlGetDtdAttrDesc(xmlDtdPtr dtd, const xmlChar *elem, const xmlChar *name) {
3283 cur = xmlHashLookup3(table, uqname, prefix, elem);
3287 cur = xmlHashLookup3(table, name, NULL, elem);
3294 * @elem: the element name
3305 xmlGetDtdQAttrDesc(xmlDtdPtr dtd, const xmlChar *elem, const xmlChar *name,
3313 return(xmlHashLookup3(table, name, prefix, elem));
3935 * @elem: the parent
3957 xmlNodePtr elem, const xmlChar *name, const xmlChar *value) {
3964 if (elem == NULL) return(NULL);
3968 if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) {
3972 fullname = xmlBuildQName(elem->name, elem->ns->prefix, fn, 50);
3981 if ((fullname != fn) && (fullname != elem->name))
3985 attrDecl = xmlGetDtdAttrDesc(doc->intSubset, elem->name, name);
3987 attrDecl = xmlGetDtdAttrDesc(doc->extSubset, elem->name, name);
4014 xmlErrValidNode(ctxt, elem, XML_DTD_NOT_STANDALONE,
4016 name, elem->name, NULL);
4025 * @elem: the parent
4042 xmlValidNormalizeAttributeValue(xmlDocPtr doc, xmlNodePtr elem,
4049 if (elem == NULL) return(NULL);
4053 if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) {
4057 fullname = xmlBuildQName(elem->name, elem->ns->prefix, fn, 50);
4060 if ((fullname != fn) && (fullname != elem->name))
4063 attrDecl = xmlGetDtdAttrDesc(doc->intSubset, elem->name, name);
4065 attrDecl = xmlGetDtdAttrDesc(doc->extSubset, elem->name, name);
4131 attr->name, attr->elem, NULL);
4142 attr->name, attr->elem, NULL);
4151 xmlElementPtr elem = xmlGetDtdElementDesc(doc->intSubset,
4152 attr->elem);
4153 if (elem != NULL) {
4154 nbId = xmlScanIDAttributeDecl(NULL, elem, 0);
4165 xmlHashScan3(table, NULL, NULL, attr->elem, (xmlHashScanner)
4173 attr->elem, nbId, attr->name);
4176 elem = xmlGetDtdElementDesc(doc->extSubset, attr->elem);
4177 if (elem != NULL) {
4178 extId = xmlScanIDAttributeDecl(NULL, elem, 0);
4183 attr->elem, extId, attr->name);
4187 attr->elem, attr->name, NULL);
4202 attr->defaultValue, attr->name, attr->elem);
4214 * @elem: an element definition
4228 xmlElementPtr elem) {
4234 if (elem == NULL) return(1);
4239 ret = xmlValidBuildContentModel(ctxt, elem);
4244 if (elem->etype == XML_ELEMENT_TYPE_MIXED) {
4248 cur = elem->content;
4260 xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_CONTENT_ERROR,
4262 elem->name, name, NULL);
4264 xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_CONTENT_ERROR,
4266 elem->name, cur->c1->prefix, name);
4277 xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_CONTENT_ERROR,
4279 elem->name, name, NULL);
4281 xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_CONTENT_ERROR,
4283 elem->name, cur->c1->prefix, name);
4295 tst = xmlGetDtdElementDesc(doc->intSubset, elem->name);
4296 if ((tst != NULL ) && (tst != elem) &&
4297 ((tst->prefix == elem->prefix) ||
4298 (xmlStrEqual(tst->prefix, elem->prefix))) &&
4300 xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_ELEM_REDEFINED,
4302 elem->name, NULL, NULL);
4305 tst = xmlGetDtdElementDesc(doc->extSubset, elem->name);
4306 if ((tst != NULL ) && (tst != elem) &&
4307 ((tst->prefix == elem->prefix) ||
4308 (xmlStrEqual(tst->prefix, elem->prefix))) &&
4310 xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_ELEM_REDEFINED,
4312 elem->name, NULL, NULL);
4317 if (xmlScanIDAttributeDecl(ctxt, elem) > 1) {
4327 * @elem: an element instance
4350 xmlNodePtr elem, xmlAttrPtr attr, const xmlChar *value)
4357 if ((elem == NULL) || (elem->name == NULL)) return(0);
4360 if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) {
4364 fullname = xmlBuildQName(elem->name, elem->ns->prefix, fn, 50);
4379 if ((fullname != fn) && (fullname != elem->name))
4384 attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elem->name,
4387 attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elem->name,
4391 elem->name, attr->name);
4394 elem->name, attr->name);
4401 xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_ATTRIBUTE,
4403 attr->name, elem->name, NULL);
4410 xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
4412 attr->name, elem->name, NULL);
4419 xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_DEFAULT,
4421 attr->name, elem->name, attrDecl->defaultValue);
4449 xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_NOTATION,
4451 value, attr->name, elem->name);
4461 xmlErrValidNode(ctxt, elem, XML_DTD_NOTATION_VALUE,
4463 value, attr->name, elem->name);
4476 xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
4478 value, attr->name, elem->name);
4486 xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
4488 attr->name, elem->name, attrDecl->defaultValue);
4503 * @elem: an element instance
4527 xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value) {
4534 if ((elem == NULL) || (elem->name == NULL)) return(0);
4541 fullname = xmlBuildQName(elem->name, prefix, fn, 50);
4559 if ((fullname != fn) && (fullname != elem->name))
4564 attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elem->name,
4567 attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elem->name,
4571 elem->name, BAD_CAST "xmlns");
4574 elem->name, BAD_CAST "xmlns");
4582 xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_ATTRIBUTE,
4584 ns->prefix, elem->name, NULL);
4586 xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_ATTRIBUTE,
4588 elem->name, NULL, NULL);
4596 xmlErrValidNode(ctxt, elem, XML_DTD_INVALID_DEFAULT,
4598 ns->prefix, elem->name, NULL);
4600 xmlErrValidNode(ctxt, elem, XML_DTD_INVALID_DEFAULT,
4602 elem->name, NULL, NULL);
4611 xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_DEFAULT,
4613 ns->prefix, elem->name, attrDecl->defaultValue);
4615 xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_DEFAULT,
4617 elem->name, attrDecl->defaultValue, NULL);
4647 xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_NOTATION,
4649 value, ns->prefix, elem->name);
4651 xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_NOTATION,
4653 value, elem->name, NULL);
4665 xmlErrValidNode(ctxt, elem, XML_DTD_NOTATION_VALUE,
4667 value, ns->prefix, elem->name);
4669 xmlErrValidNode(ctxt, elem, XML_DTD_NOTATION_VALUE,
4671 value, elem->name, NULL);
4686 xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
4688 value, ns->prefix, elem->name);
4690 xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
4692 value, elem->name, NULL);
4702 xmlErrValidNode(ctxt, elem, XML_DTD_ELEM_NAMESPACE,
4704 ns->prefix, elem->name, attrDecl->defaultValue);
4706 xmlErrValidNode(ctxt, elem, XML_DTD_ELEM_NAMESPACE,
4708 elem->name, attrDecl->defaultValue, NULL);
5508 * @elem: an element instance
5516 xmlNodePtr elem) {
5520 if ((ctxt == NULL) || (doc == NULL) || (elem == NULL))
5523 child = elem->children;
5640 * @elem: an element instance
5650 xmlNodePtr elem, int *extsubset) {
5655 (elem == NULL) || (elem->name == NULL))
5663 if ((elem->ns != NULL) && (elem->ns->prefix != NULL))
5664 prefix = elem->ns->prefix;
5668 elem->name, prefix);
5671 elem->name, prefix);
5683 elemDecl = xmlGetDtdElementDesc(doc->intSubset, elem->name);
5685 elemDecl = xmlGetDtdElementDesc(doc->extSubset, elem->name);
5691 xmlErrValidNode(ctxt, elem,
5694 elem->name, NULL, NULL);
5704 * @elem: an element instance
5713 xmlNodePtr elem, const xmlChar *qname) {
5726 * Check the new element agaisnt the content model of the new elem.
5789 eDecl = xmlValidGetElemDecl(ctxt, doc, elem, &extsubset);
5790 vstateVPush(ctxt, eDecl, elem);
5818 * Check the new element agaisnt the content model of the new elem.
5871 * @elem: an element instance
5880 xmlNodePtr elem ATTRIBUTE_UNUSED,
5892 * Check the new element agaisnt the content model of the new elem.
5925 * @elem: an element instance
5941 xmlNodePtr elem) {
5952 if (elem == NULL) return(0);
5953 switch (elem->type) {
5955 xmlErrValidNode(ctxt, elem, XML_ERR_INTERNAL_ERROR,
5959 if (elem->children != NULL) {
5960 xmlErrValidNode(ctxt, elem, XML_ERR_INTERNAL_ERROR,
5965 if (elem->ns != NULL) {
5966 xmlErrValidNode(ctxt, elem, XML_ERR_INTERNAL_ERROR,
5971 if (elem->content == NULL) {
5972 xmlErrValidNode(ctxt, elem, XML_ERR_INTERNAL_ERROR,
5987 xmlErrValidNode(ctxt, elem, XML_ERR_INTERNAL_ERROR,
5991 xmlErrValidNode(ctxt, elem, XML_ERR_INTERNAL_ERROR,
5997 xmlErrValidNode(ctxt, elem, XML_ERR_INTERNAL_ERROR,
6001 xmlErrValidNode(ctxt, elem, XML_ERR_INTERNAL_ERROR,
6007 xmlErrValidNode(ctxt, elem, XML_ERR_INTERNAL_ERROR,
6015 elemDecl = xmlValidGetElemDecl(ctxt, doc, elem, &extsubset);
6027 xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_ELEM,
6029 elem->name, NULL, NULL);
6032 if (elem->children != NULL) {
6033 xmlErrValidNode(ctxt, elem, XML_DTD_NOT_EMPTY,
6035 elem->name, NULL, NULL);
6047 ret = xmlValidateOneCdataElement(ctxt, doc, elem);
6049 xmlErrValidNode(ctxt, elem, XML_DTD_NOT_PCDATA,
6051 elem->name, NULL, NULL);
6055 child = elem->children;
6112 xmlErrValidNode(ctxt, elem, XML_DTD_INVALID_CHILD,
6114 name, elem->name, NULL);
6129 child = elem->children;
6137 xmlErrValidNode(ctxt, elem,
6140 elem->name, NULL, NULL);
6148 child = elem->children;
6150 tmp = xmlValidateElementContent(ctxt, child, elemDecl, 1, elem);
6167 ns = elem->nsDef;
6176 ns = elem->nsDef;
6185 attrib = elem->properties;
6192 nameSpace = elem->ns;
6222 xmlErrValidNode(ctxt, elem, XML_DTD_MISSING_ATTRIBUTE,
6224 elem->name, attr->name, NULL);
6227 xmlErrValidNode(ctxt, elem, XML_DTD_MISSING_ATTRIBUTE,
6229 elem->name, attr->prefix,attr->name);
6233 xmlErrValidWarning(ctxt, elem, XML_DTD_NO_PREFIX,
6235 elem->name, attr->prefix, attr->name);
6237 xmlErrValidWarning(ctxt, elem, XML_DTD_DIFFERENT_PREFIX,
6239 elem->name, attr->prefix, attr->name);
6251 ns = elem->nsDef;
6255 xmlErrValidNode(ctxt, elem,
6258 elem->name, NULL, NULL);
6268 ns = elem->nsDef;
6272 xmlErrValidNode(ctxt, elem, XML_DTD_ELEM_NAMESPACE,
6274 elem->name, ns->prefix, NULL);
6360 * @elem: an element instance
6368 xmlValidateElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem) {
6375 if (elem == NULL) return(0);
6381 if ((elem->type == XML_XINCLUDE_START) ||
6382 (elem->type == XML_XINCLUDE_END))
6390 if (elem->type == XML_ENTITY_REF_NODE) {
6394 ret &= xmlValidateOneElement(ctxt, doc, elem);
6395 if (elem->type == XML_ELEMENT_NODE) {
6396 attr = elem->properties;
6399 ret &= xmlValidateOneAttribute(ctxt, doc, elem, attr, value);
6404 ns = elem->nsDef;
6406 if (elem->ns == NULL)
6407 ret &= xmlValidateOneNamespace(ctxt, doc, elem, NULL,
6410 ret &= xmlValidateOneNamespace(ctxt, doc, elem,
6411 elem->ns->prefix, ns, ns->href);
6415 child = elem->children;
6661 xmlElementPtr elem = NULL;
6697 if (cur->elem == NULL) {
6705 elem = xmlGetDtdElementDesc(doc->intSubset, cur->elem);
6706 if ((elem == NULL) && (doc != NULL))
6707 elem = xmlGetDtdElementDesc(doc->extSubset, cur->elem);
6708 if ((elem == NULL) && (cur->parent != NULL) &&
6710 elem = xmlGetDtdElementDesc((xmlDtdPtr) cur->parent, cur->elem);
6711 if (elem == NULL) {
6714 cur->name, cur->elem, NULL);
6717 if (elem->etype == XML_ELEMENT_TYPE_EMPTY) {
6720 cur->name, cur->elem, NULL);