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

Function xmlSchemaResolveAttrUseReferences

ThirdParty/libxml2/vtklibxml2/xmlschemas.c:20100–20129  ·  view source on GitHub ↗

* xmlSchemaResolveAttrUseReferences: * @item: an attribute use * @ctxt: a parser context * * Resolves the referenced attribute declaration. */

Source from the content-addressed store, hash-verified

20098 * Resolves the referenced attribute declaration.
20099 */
20100static int
20101xmlSchemaResolveAttrUseReferences(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:

Callers 1

xmlSchemaFixupComponentsFunction · 0.85

Calls 2

xmlSchemaPResCompAttrErrFunction · 0.85

Tested by

no test coverage detected