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

Function xmlScanIDAttributeDecl

ThirdParty/libxml2/vtklibxml2/valid.c:1571–1589  ·  view source on GitHub ↗

* xmlScanIDAttributeDecl: * @ctxt: the validation context * @elem: the element name * @err: whether to raise errors here * * Verify that the element don't have too many ID attributes * declared. * * Returns the number of ID attributes found. */

Source from the content-addressed store, hash-verified

1569 * Returns the number of ID attributes found.
1570 */
1571static int
1572xmlScanIDAttributeDecl(xmlValidCtxtPtr ctxt, xmlElementPtr elem, int err) {
1573 xmlAttributePtr cur;
1574 int ret = 0;
1575
1576 if (elem == NULL) return(0);
1577 cur = elem->attributes;
1578 while (cur != NULL) {
1579 if (cur->atype == XML_ATTRIBUTE_ID) {
1580 ret ++;
1581 if ((ret > 1) && (err))
1582 xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_MULTIPLE_ID,
1583 "Element %s has too many ID attributes defined : %s\n",
1584 elem->name, cur->name, NULL);
1585 }
1586 cur = cur->nexth;
1587 }
1588 return(ret);
1589}
1590#endif /* LIBXML_VALID_ENABLED */
1591
1592/**

Callers 2

xmlAddAttributeDeclFunction · 0.85
xmlValidateAttributeDeclFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected