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

Function xmlParserNsUpdateSax

ThirdParty/libxml2/vtklibxml2/parser.c:1644–1664  ·  view source on GitHub ↗

* xmlParserNsUpdateSax: * @ctxt: parser context * @prefix: namespace prefix * @saxData: extra data for SAX handler * * Sets or updates extra data for the given prefix. This value will be * returned by xmlParserNsLookupSax as long as the namespace with the * given prefix is in scope. * * Returns the data on success, NULL if no namespace was found. */

Source from the content-addressed store, hash-verified

1642 * Returns the data on success, NULL if no namespace was found.
1643 */
1644int
1645xmlParserNsUpdateSax(xmlParserCtxtPtr ctxt, const xmlChar *prefix,
1646 void *saxData) {
1647 xmlHashedString hprefix;
1648 int nsIndex;
1649
1650 if (prefix == ctxt->str_xml)
1651 return(-1);
1652
1653 hprefix.name = prefix;
1654 if (prefix != NULL)
1655 hprefix.hashValue = xmlDictComputeHash(ctxt->dict, prefix);
1656 else
1657 hprefix.hashValue = 0;
1658 nsIndex = xmlParserNsLookup(ctxt, &hprefix, NULL);
1659 if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
1660 return(-1);
1661
1662 ctxt->nsdb->extra[nsIndex].saxData = saxData;
1663 return(0);
1664}
1665
1666/**
1667 * xmlParserNsGrow:

Callers 1

xmlSAX2StartElementNsFunction · 0.85

Calls 2

xmlDictComputeHashFunction · 0.85
xmlParserNsLookupFunction · 0.85

Tested by

no test coverage detected