* xmlSchemaResolveAttrUseReferences: * @item: an attribute use * @ctxt: a parser context * * Resolves the referenced attribute declaration. */
| 20098 | * Resolves the referenced attribute declaration. |
| 20099 | */ |
| 20100 | static int |
| 20101 | xmlSchemaResolveAttrUseReferences(xmlSchemaAttributeUsePtr ause, |
| 20102 | xmlSchemaParserCtxtPtr ctxt) |
| 20103 | { |
| 20104 | if ((ctxt == NULL) || (ause == NULL)) |
| 20105 | return(-1); |
| 20106 | if ((ause->attrDecl == NULL) || |
| 20107 | (ause->attrDecl->type != XML_SCHEMA_EXTRA_QNAMEREF)) |
| 20108 | return(0); |
| 20109 | |
| 20110 | { |
| 20111 | xmlSchemaQNameRefPtr ref = WXS_QNAME_CAST ause->attrDecl; |
| 20112 | |
| 20113 | /* |
| 20114 | * TODO: Evaluate, what errors could occur if the declaration is not |
| 20115 | * found. |
| 20116 | */ |
| 20117 | ause->attrDecl = xmlSchemaGetAttributeDecl(ctxt->schema, |
| 20118 | ref->name, ref->targetNamespace); |
| 20119 | if (ause->attrDecl == NULL) { |
| 20120 | xmlSchemaPResCompAttrErr(ctxt, |
| 20121 | XML_SCHEMAP_SRC_RESOLVE, |
| 20122 | WXS_BASIC_CAST ause, ause->node, |
| 20123 | "ref", ref->name, ref->targetNamespace, |
| 20124 | XML_SCHEMA_TYPE_ATTRIBUTE, NULL); |
| 20125 | return(ctxt->err);; |
| 20126 | } |
| 20127 | } |
| 20128 | return(0); |
| 20129 | } |
| 20130 | |
| 20131 | /** |
| 20132 | * xmlSchemaCheckAttrUsePropsCorrect: |
no test coverage detected