* 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. */
| 1642 | * Returns the data on success, NULL if no namespace was found. |
| 1643 | */ |
| 1644 | int |
| 1645 | xmlParserNsUpdateSax(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: |
no test coverage detected