| 23900 | } |
| 23901 | |
| 23902 | static int |
| 23903 | xmlSchemaValidatorPushAttribute(xmlSchemaValidCtxtPtr vctxt, |
| 23904 | xmlNodePtr attrNode, |
| 23905 | int nodeLine, |
| 23906 | const xmlChar *localName, |
| 23907 | const xmlChar *nsName, |
| 23908 | int ownedNames, |
| 23909 | xmlChar *value, |
| 23910 | int ownedValue) |
| 23911 | { |
| 23912 | xmlSchemaAttrInfoPtr attr; |
| 23913 | |
| 23914 | attr = xmlSchemaGetFreshAttrInfo(vctxt); |
| 23915 | if (attr == NULL) { |
| 23916 | VERROR_INT("xmlSchemaPushAttribute", |
| 23917 | "calling xmlSchemaGetFreshAttrInfo()"); |
| 23918 | return (-1); |
| 23919 | } |
| 23920 | attr->node = attrNode; |
| 23921 | attr->nodeLine = nodeLine; |
| 23922 | attr->state = XML_SCHEMAS_ATTR_UNKNOWN; |
| 23923 | attr->localName = localName; |
| 23924 | attr->nsName = nsName; |
| 23925 | if (ownedNames) |
| 23926 | attr->flags |= XML_SCHEMA_NODE_INFO_FLAG_OWNED_NAMES; |
| 23927 | /* |
| 23928 | * Evaluate if it's an XSI attribute. |
| 23929 | */ |
| 23930 | if (nsName != NULL) { |
| 23931 | if (xmlStrEqual(localName, BAD_CAST "nil")) { |
| 23932 | if (xmlStrEqual(attr->nsName, xmlSchemaInstanceNs)) { |
| 23933 | attr->metaType = XML_SCHEMA_ATTR_INFO_META_XSI_NIL; |
| 23934 | } |
| 23935 | } else if (xmlStrEqual(localName, BAD_CAST "type")) { |
| 23936 | if (xmlStrEqual(attr->nsName, xmlSchemaInstanceNs)) { |
| 23937 | attr->metaType = XML_SCHEMA_ATTR_INFO_META_XSI_TYPE; |
| 23938 | } |
| 23939 | } else if (xmlStrEqual(localName, BAD_CAST "schemaLocation")) { |
| 23940 | if (xmlStrEqual(attr->nsName, xmlSchemaInstanceNs)) { |
| 23941 | attr->metaType = XML_SCHEMA_ATTR_INFO_META_XSI_SCHEMA_LOC; |
| 23942 | } |
| 23943 | } else if (xmlStrEqual(localName, BAD_CAST "noNamespaceSchemaLocation")) { |
| 23944 | if (xmlStrEqual(attr->nsName, xmlSchemaInstanceNs)) { |
| 23945 | attr->metaType = XML_SCHEMA_ATTR_INFO_META_XSI_NO_NS_SCHEMA_LOC; |
| 23946 | } |
| 23947 | } else if (xmlStrEqual(attr->nsName, xmlNamespaceNs)) { |
| 23948 | attr->metaType = XML_SCHEMA_ATTR_INFO_META_XMLNS; |
| 23949 | } |
| 23950 | } |
| 23951 | attr->value = value; |
| 23952 | if (ownedValue) |
| 23953 | attr->flags |= XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES; |
| 23954 | if (attr->metaType != 0) |
| 23955 | attr->state = XML_SCHEMAS_ATTR_META; |
| 23956 | return (0); |
| 23957 | } |
| 23958 | |
| 23959 | /** |
no test coverage detected