Home | History | Annotate | Download | only in libxml2

Lines Matching refs:attr

509 	    xmlGenericError(xmlGenericErrorContext, "?attr? ");
1837 * @attr: the attribute decl
1844 xmlScanAttributeDeclCallback(xmlAttributePtr attr, xmlAttributePtr *list,
1846 attr->nexth = *list;
1847 *list = attr;
1921 xmlFreeAttribute(xmlAttributePtr attr) {
1924 if (attr == NULL) return;
1925 if (attr->doc != NULL)
1926 dict = attr->doc->dict;
1929 xmlUnlinkNode((xmlNodePtr) attr);
1930 if (attr->tree != NULL)
1931 xmlFreeEnumeration(attr->tree);
1933 if ((attr->elem != NULL) && (!xmlDictOwns(dict, attr->elem)))
1934 xmlFree((xmlChar *) attr->elem);
1935 if ((attr->name != NULL) && (!xmlDictOwns(dict, attr->name)))
1936 xmlFree((xmlChar *) attr->name);
1937 if ((attr->prefix != NULL) && (!xmlDictOwns(dict, attr->prefix)))
1938 xmlFree((xmlChar *) attr->prefix);
1939 if ((attr->defaultValue != NULL) &&
1940 (!xmlDictOwns(dict, attr->defaultValue)))
1941 xmlFree((xmlChar *) attr->defaultValue);
1943 if (attr->elem != NULL)
1944 xmlFree((xmlChar *) attr->elem);
1945 if (attr->name != NULL)
1946 xmlFree((xmlChar *) attr->name);
1947 if (attr->defaultValue != NULL)
1948 xmlFree((xmlChar *) attr->defaultValue);
1949 if (attr->prefix != NULL)
1950 xmlFree((xmlChar *) attr->prefix);
1952 xmlFree(attr);
2202 * @attr: An attribute
2209 xmlCopyAttribute(xmlAttributePtr attr) {
2219 cur->atype = attr->atype;
2220 cur->def = attr->def;
2221 cur->tree = xmlCopyEnumeration(attr->tree);
2222 if (attr->elem != NULL)
2223 cur->elem = xmlStrdup(attr->elem);
2224 if (attr->name != NULL)
2225 cur->name = xmlStrdup(attr->name);
2226 if (attr->prefix != NULL)
2227 cur->prefix = xmlStrdup(attr->prefix);
2228 if (attr->defaultValue != NULL)
2229 cur->defaultValue = xmlStrdup(attr->defaultValue);
2252 * @attr: An attribute declaration
2258 xmlDumpAttributeDecl(xmlBufferPtr buf, xmlAttributePtr attr) {
2259 if ((buf == NULL) || (attr == NULL))
2262 xmlBufferWriteCHAR(buf, attr->elem);
2264 if (attr->prefix != NULL) {
2265 xmlBufferWriteCHAR(buf, attr->prefix);
2268 xmlBufferWriteCHAR(buf, attr->name);
2269 switch (attr->atype) {
2296 xmlDumpEnumeration(buf, attr->tree);
2300 xmlDumpEnumeration(buf, attr->tree);
2307 switch (attr->def) {
2324 if (attr->defaultValue != NULL) {
2326 xmlBufferWriteQuotedString(buf, attr->defaultValue);
2333 * @attr: An attribute declaration
2339 xmlDumpAttributeDeclScan(xmlAttributePtr attr, xmlBufferPtr buf) {
2340 xmlDumpAttributeDecl(buf, attr);
2619 * @attr: the attribute holding the ID
2627 xmlAttrPtr attr) {
2637 if (attr == NULL) {
2667 * Operating in streaming mode, attr is gonna disapear
2670 ret->name = xmlDictLookup(doc->dict, attr->name, -1);
2672 ret->name = xmlStrdup(attr->name);
2673 ret->attr = NULL;
2675 ret->attr = attr;
2678 ret->lineno = xmlGetLineNo(attr->parent);
2686 xmlErrValidNode(ctxt, attr->parent, XML_DTD_ID_REDEFINED,
2694 if (attr != NULL)
2695 attr->atype = XML_ATTRIBUTE_ID;
2714 * @attr: the attribute
2724 xmlIsID(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) {
2725 if ((attr == NULL) || (attr->name == NULL)) return(0);
2726 if ((attr->ns != NULL) && (attr->ns->prefix != NULL) &&
2727 (!strcmp((char *) attr->name, "id")) &&
2728 (!strcmp((char *) attr->ns->prefix, "xml")))
2734 if ((xmlStrEqual(BAD_CAST "id", attr->name)) ||
2735 ((xmlStrEqual(BAD_CAST "name", attr->name)) &&
2751 fullattrname = (attr->ns != NULL && attr->ns->prefix != NULL) ?
2752 xmlBuildQName(attr->name, attr->ns->prefix, fattr, 50) :
2753 (xmlChar *)attr->name;
2763 if ((fullattrname != fattr) && (fullattrname != attr->name))
2777 * @attr: the attribute
2784 xmlRemoveID(xmlDocPtr doc, xmlAttrPtr attr) {
2790 if (attr == NULL) return(-1);
2795 if (attr == NULL)
2797 ID = xmlNodeListGetString(doc, attr->children, 1);
2801 if (id == NULL || id->attr != attr) {
2807 attr->atype = 0;
2840 if (id->attr == NULL) {
2847 return(id->attr);
2910 xmlAttrPtr attr0 = ((xmlRefPtr)data)->attr;
2940 * @attr: the attribute holding the Ref
2948 xmlAttrPtr attr) {
2959 if (attr == NULL) {
2988 * Operating in streaming mode, attr is gonna disapear
2990 ret->name = xmlStrdup(attr->name);
2991 ret->attr = NULL;
2994 ret->attr = attr;
2996 ret->lineno = xmlGetLineNo(attr->parent);
3053 * @attr: the attribute
3062 xmlIsRef(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) {
3063 if (attr == NULL)
3066 doc = attr->doc;
3079 attrDecl = xmlGetDtdAttrDesc(doc->intSubset, elem->name, attr->name);
3082 elem->name, attr->name);
3095 * @attr: the attribute
3102 xmlRemoveRef(xmlDocPtr doc, xmlAttrPtr attr) {
3109 if (attr == NULL) return(-1);
3114 if (attr == NULL)
3116 ID = xmlNodeListGetString(doc, attr->children, 1);
3126 * have the same key as the supplied attr. Our list of references
3136 target.ap = attr;
3138 /* Remove the supplied attr from our list */
4142 xmlValidateAttributeIdCallback(xmlAttributePtr attr, int *count,
4144 if (attr->atype == XML_ATTRIBUTE_ID) (*count)++;
4151 * @attr: an attribute definition
4167 xmlAttributePtr attr) {
4171 if(attr == NULL) return(1);
4175 if (attr->defaultValue != NULL) {
4176 val = xmlValidateAttributeValueInternal(doc, attr->atype,
4177 attr->defaultValue);
4179 xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ATTRIBUTE_DEFAULT,
4181 attr->name, attr->elem, NULL);
4187 if ((attr->atype == XML_ATTRIBUTE_ID)&&
4188 (attr->def != XML_ATTRIBUTE_IMPLIED) &&
4189 (attr->def != XML_ATTRIBUTE_REQUIRED)) {
4190 xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ID_FIXED,
4192 attr->name, attr->elem, NULL);
4197 if (attr->atype == XML_ATTRIBUTE_ID) {
4202 attr->elem);
4215 xmlHashScan3(table, NULL, NULL, attr->elem, (xmlHashScanner)
4221 xmlErrValidNodeNr(ctxt, (xmlNodePtr) attr, XML_DTD_ID_SUBSET,
4223 attr->elem, nbId, attr->name);
4226 elem = xmlGetDtdElementDesc(doc->extSubset, attr->elem);
4231 xmlErrValidNodeNr(ctxt, (xmlNodePtr) attr, XML_DTD_ID_SUBSET,
4233 attr->elem, extId, attr->name);
4235 attr, XML_DTD_ID_SUBSET,
4237 attr->elem, attr->name, NULL);
4243 if ((attr->defaultValue != NULL) && (attr->tree != NULL)) {
4244 xmlEnumerationPtr tree = attr->tree;
4246 if (xmlStrEqual(tree->name, attr->defaultValue)) break;
4250 xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ATTRIBUTE_VALUE,
4252 attr->defaultValue, attr->name, attr->elem);
4378 * @attr: an attribute instance
4400 xmlNodePtr elem, xmlAttrPtr attr, const xmlChar *value)
4408 if ((attr == NULL) || (attr->name == NULL)) return(0);
4417 if (attr->ns != NULL) {
4419 attr->name, attr->ns->prefix);
4422 attr->name, attr->ns->prefix);
4424 attrDecl = xmlGetDtdAttrDesc(doc->intSubset, fullname, attr->name);
4427 fullname, attr->name);
4433 if (attr->ns != NULL) {
4435 attr->name, attr->ns->prefix);
4438 attr->name, attr->ns->prefix);
4441 elem->name, attr->name);
4444 elem->name, attr->name);
4453 attr->name, elem->name, NULL);
4456 attr->atype = attrDecl->atype;
4462 attr->name, elem->name, NULL);
4471 attr->name, elem->name, attrDecl->defaultValue);
4478 if (xmlAddID(ctxt, doc, value, attr) == NULL)
4484 if (xmlAddRef(ctxt, doc, value, attr) == NULL)
4501 value, attr->name, elem->name);
4513 value, attr->name, elem->name);
4528 value, attr->name, elem->name);
4538 attr->name, elem->name, attrDecl->defaultValue);
4543 ret &= xmlValidateAttributeValue2(ctxt, doc, attr->name,
5994 xmlAttributePtr attr;
6208 attr = elemDecl->attributes;
6209 while (attr != NULL) {
6210 if (attr->def == XML_ATTRIBUTE_REQUIRED) {
6213 if ((attr->prefix == NULL) &&
6214 (xmlStrEqual(attr->name, BAD_CAST "xmlns"))) {
6223 } else if (xmlStrEqual(attr->prefix, BAD_CAST "xmlns")) {
6228 if (xmlStrEqual(attr->name, ns->prefix))
6237 if (xmlStrEqual(attrib->name, attr->name)) {
6238 if (attr->prefix != NULL) {
6252 attr->prefix)) {
6271 if (attr->prefix == NULL) {
6274 elem->name, attr->name, NULL);
6279 elem->name, attr->prefix,attr->name);
6285 elem->name, attr->prefix, attr->name);
6289 elem->name, attr->prefix, attr->name);
6291 } else if (attr->def == XML_ATTRIBUTE_FIXED) {
6297 if ((attr->prefix == NULL) &&
6298 (xmlStrEqual(attr->name, BAD_CAST "xmlns"))) {
6304 if (!xmlStrEqual(attr->defaultValue, ns->href)) {
6315 } else if (xmlStrEqual(attr->prefix, BAD_CAST "xmlns")) {
6320 if (xmlStrEqual(attr->name, ns->prefix)) {
6321 if (!xmlStrEqual(attr->defaultValue, ns->href)) {
6334 attr = attr->nexth;
6420 xmlAttrPtr attr;
6446 attr = elem->properties;
6447 while (attr != NULL) {
6448 value = xmlNodeListGetString(doc, attr->children, 0);
6449 ret &= xmlValidateOneAttribute(ctxt, doc, elem, attr, value);
6452 attr= attr->next;
6485 xmlAttrPtr attr;
6489 if ((ref->attr == NULL) && (ref->name == NULL))
6491 attr = ref->attr;
6492 if (attr == NULL) {
6519 } else if (attr->atype == XML_ATTRIBUTE_IDREF) {
6522 xmlErrValidNode(ctxt, attr->parent, XML_DTD_UNKNOWN_ID,
6524 attr->name, name, NULL);
6527 } else if (attr->atype == XML_ATTRIBUTE_IDREFS) {
6544 xmlErrValidNode(ctxt, attr->parent, XML_DTD_UNKNOWN_ID,
6546 attr->name, str, NULL);