| Index: third_party/libxml/xmlschemas.c
|
| diff --git a/third_party/libxml/xmlschemas.c b/third_party/libxml/xmlschemas.c
|
| index d57ba9f189c3d6c395d89aca75afa402acd5e105..9c86c756e843a085623728963a8653040a0960f8 100644
|
| --- a/third_party/libxml/xmlschemas.c
|
| +++ b/third_party/libxml/xmlschemas.c
|
| @@ -90,7 +90,7 @@
|
| #ifndef DEBUG_IDC_NODE_TABLE
|
| #define DEBUG_IDC_NODE_TABLE
|
| #endif
|
| -#endif
|
| +#endif
|
|
|
| /* #define ENABLE_PARTICLE_RESTRICTION 1 */
|
|
|
| @@ -374,7 +374,7 @@ typedef xmlSchemaBucket *xmlSchemaBucketPtr;
|
| #define XML_SCHEMA_SCHEMA_REDEFINE 3
|
|
|
| /**
|
| - * xmlSchemaSchemaRelation:
|
| + * xmlSchemaSchemaRelation:
|
| *
|
| * Used to create a graph of schema relationships.
|
| */
|
| @@ -402,12 +402,12 @@ struct _xmlSchemaBucket {
|
| int parsed;
|
| int imported;
|
| int preserveDoc;
|
| - xmlSchemaItemListPtr globals; /* Global components. */
|
| + xmlSchemaItemListPtr globals; /* Global components. */
|
| xmlSchemaItemListPtr locals; /* Local components. */
|
| };
|
|
|
| /**
|
| - * xmlSchemaImport:
|
| + * xmlSchemaImport:
|
| * (extends xmlSchemaBucket)
|
| *
|
| * Reflects a schema. Holds some information
|
| @@ -422,9 +422,9 @@ struct _xmlSchemaImport {
|
| const xmlChar *schemaLocation; /* The URI of the schema document. */
|
| /* For chameleon includes, @origTargetNamespace will be NULL */
|
| const xmlChar *origTargetNamespace;
|
| - /*
|
| + /*
|
| * For chameleon includes, @targetNamespace will be the
|
| - * targetNamespace of the including schema.
|
| + * targetNamespace of the including schema.
|
| */
|
| const xmlChar *targetNamespace;
|
| xmlDocPtr doc; /* The schema node-tree. */
|
| @@ -457,7 +457,7 @@ struct _xmlSchemaInclude {
|
| int parsed;
|
| int imported;
|
| int preserveDoc;
|
| - xmlSchemaItemListPtr globals; /* Global components. */
|
| + xmlSchemaItemListPtr globals; /* Global components. */
|
| xmlSchemaItemListPtr locals; /* Local components. */
|
|
|
| /* The owning main or import schema bucket. */
|
| @@ -517,7 +517,7 @@ struct _xmlSchemaAttributeUse {
|
| xmlSchemaTypeType type;
|
| xmlSchemaAnnotPtr annot;
|
| xmlSchemaAttributeUsePtr next; /* The next attr. use. */
|
| - /*
|
| + /*
|
| * The attr. decl. OR a QName-ref. to an attr. decl. OR
|
| * a QName-ref. to an attribute group definition.
|
| */
|
| @@ -573,7 +573,7 @@ struct _xmlSchemaConstructionCtxt {
|
| xmlDictPtr dict;
|
| xmlSchemaItemListPtr buckets; /* List of schema buckets. */
|
| /* xmlSchemaItemListPtr relations; */ /* List of schema relations. */
|
| - xmlSchemaBucketPtr bucket; /* The current schema bucket */
|
| + xmlSchemaBucketPtr bucket; /* The current schema bucket */
|
| xmlSchemaItemListPtr pending; /* All Components of all schemas that
|
| need to be fixed. */
|
| xmlHashTablePtr substGroups;
|
| @@ -629,7 +629,7 @@ struct _xmlSchemaParserCtxt {
|
| xmlSchemaBucketPtr redefined; /* The schema to be redefined. */
|
|
|
| xmlSchemaRedefPtr redef; /* Used for redefinitions. */
|
| - int redefCounter; /* Used for redefinitions. */
|
| + int redefCounter; /* Used for redefinitions. */
|
| xmlSchemaItemListPtr attrProhibs;
|
| };
|
|
|
| @@ -783,7 +783,7 @@ struct _xmlSchemaPSVIIDCNode {
|
| xmlNodePtr node;
|
| xmlSchemaPSVIIDCKeyPtr *keys;
|
| int nodeLine;
|
| - int nodeQNameID;
|
| + int nodeQNameID;
|
|
|
| };
|
|
|
| @@ -879,7 +879,7 @@ struct _xmlSchemaIDCMatcher {
|
| struct _xmlSchemaNodeInfo {
|
| int nodeType;
|
| xmlNodePtr node;
|
| - int nodeLine;
|
| + int nodeLine;
|
| const xmlChar *localName;
|
| const xmlChar *nsName;
|
| const xmlChar *value;
|
| @@ -901,7 +901,7 @@ struct _xmlSchemaNodeInfo {
|
|
|
| const xmlChar **nsBindings; /* Namespace bindings on this element */
|
| int nbNsBindings;
|
| - int sizeNsBindings;
|
| + int sizeNsBindings;
|
|
|
| int hasKeyrefs;
|
| int appliedXPath; /* Indicates that an XPath has been applied. */
|
| @@ -938,7 +938,7 @@ typedef xmlSchemaAttrInfo *xmlSchemaAttrInfoPtr;
|
| struct _xmlSchemaAttrInfo {
|
| int nodeType;
|
| xmlNodePtr node;
|
| - int nodeLine;
|
| + int nodeLine;
|
| const xmlChar *localName;
|
| const xmlChar *nsName;
|
| const xmlChar *value;
|
| @@ -1172,7 +1172,7 @@ xmlSchemaGetComponentTypeStr(xmlSchemaBasicItemPtr item)
|
| if (WXS_IS_COMPLEX(WXS_TYPE_CAST item))
|
| return(BAD_CAST "complex type definition");
|
| else
|
| - return(BAD_CAST "simple type definition");
|
| + return(BAD_CAST "simple type definition");
|
| default:
|
| return(xmlSchemaItemTypeToStr(item->type));
|
| }
|
| @@ -1300,11 +1300,11 @@ xmlSchemaFormatQName(xmlChar **buf,
|
| *buf = xmlStrcat(*buf, localName);
|
| } else {
|
| *buf = xmlStrcat(*buf, BAD_CAST "(NULL)");
|
| - }
|
| + }
|
| return ((const xmlChar *) *buf);
|
| }
|
|
|
| -static const xmlChar*
|
| +static const xmlChar*
|
| xmlSchemaFormatQNameNs(xmlChar **buf, xmlNsPtr ns, const xmlChar *localName)
|
| {
|
| if (ns != NULL)
|
| @@ -1480,16 +1480,16 @@ xmlSchemaGetCanonValueWhtspExt(xmlSchemaValPtr val,
|
| int list;
|
| xmlSchemaValType valType;
|
| const xmlChar *value, *value2 = NULL;
|
| -
|
| +
|
|
|
| if ((retValue == NULL) || (val == NULL))
|
| return (-1);
|
| list = xmlSchemaValueGetNext(val) ? 1 : 0;
|
| *retValue = NULL;
|
| do {
|
| - value = NULL;
|
| - valType = xmlSchemaGetValType(val);
|
| - switch (valType) {
|
| + value = NULL;
|
| + valType = xmlSchemaGetValType(val);
|
| + switch (valType) {
|
| case XML_SCHEMAS_STRING:
|
| case XML_SCHEMAS_NORMSTRING:
|
| case XML_SCHEMAS_ANYSIMPLETYPE:
|
| @@ -1502,7 +1502,7 @@ xmlSchemaGetCanonValueWhtspExt(xmlSchemaValPtr val,
|
| if (value2 != NULL)
|
| value = value2;
|
| }
|
| - break;
|
| + break;
|
| default:
|
| if (xmlSchemaGetCanonValue(val, &value2) == -1) {
|
| if (value2 != NULL)
|
| @@ -1540,29 +1540,29 @@ internal_error:
|
| * @buf: the string buffer
|
| * @itemDes: the designation of the item
|
| * @itemName: the name of the item
|
| - * @item: the item as an object
|
| + * @item: the item as an object
|
| * @itemNode: the node of the item
|
| * @local: the local name
|
| * @parsing: if the function is used during the parse
|
| *
|
| * Returns a representation of the given item used
|
| - * for error reports.
|
| + * for error reports.
|
| *
|
| - * The following order is used to build the resulting
|
| + * The following order is used to build the resulting
|
| * designation if the arguments are not NULL:
|
| * 1a. If itemDes not NULL -> itemDes
|
| * 1b. If (itemDes not NULL) and (itemName not NULL)
|
| * -> itemDes + itemName
|
| * 2. If the preceding was NULL and (item not NULL) -> item
|
| * 3. If the preceding was NULL and (itemNode not NULL) -> itemNode
|
| - *
|
| + *
|
| * If the itemNode is an attribute node, the name of the attribute
|
| * will be appended to the result.
|
| *
|
| * Returns the formatted string and sets @buf to the resulting value.
|
| - */
|
| -static xmlChar*
|
| -xmlSchemaFormatItemForReport(xmlChar **buf,
|
| + */
|
| +static xmlChar*
|
| +xmlSchemaFormatItemForReport(xmlChar **buf,
|
| const xmlChar *itemDes,
|
| xmlSchemaBasicItemPtr item,
|
| xmlNodePtr itemNode)
|
| @@ -1574,9 +1574,9 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
|
| xmlFree(*buf);
|
| *buf = NULL;
|
| }
|
| -
|
| +
|
| if (itemDes != NULL) {
|
| - *buf = xmlStrdup(itemDes);
|
| + *buf = xmlStrdup(itemDes);
|
| } else if (item != NULL) {
|
| switch (item->type) {
|
| case XML_SCHEMA_TYPE_BASIC: {
|
| @@ -1634,7 +1634,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
|
| break;
|
| case XML_SCHEMA_TYPE_ATTRIBUTE_USE: {
|
| xmlSchemaAttributeUsePtr ause;
|
| -
|
| +
|
| ause = WXS_ATTR_USE_CAST item;
|
| *buf = xmlStrdup(BAD_CAST "attribute use ");
|
| if (WXS_ATTRUSE_DECL(ause) != NULL) {
|
| @@ -1650,7 +1650,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
|
| break;
|
| case XML_SCHEMA_TYPE_ATTRIBUTE: {
|
| xmlSchemaAttributePtr attr;
|
| -
|
| +
|
| attr = (xmlSchemaAttributePtr) item;
|
| *buf = xmlStrdup(BAD_CAST "attribute decl.");
|
| *buf = xmlStrcat(*buf, BAD_CAST " '");
|
| @@ -1666,7 +1666,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
|
| case XML_SCHEMA_TYPE_ELEMENT: {
|
| xmlSchemaElementPtr elem;
|
|
|
| - elem = (xmlSchemaElementPtr) item;
|
| + elem = (xmlSchemaElementPtr) item;
|
| *buf = xmlStrdup(BAD_CAST "element decl.");
|
| *buf = xmlStrcat(*buf, BAD_CAST " '");
|
| *buf = xmlStrcat(*buf, xmlSchemaFormatQName(&str,
|
| @@ -1676,7 +1676,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
|
| break;
|
| case XML_SCHEMA_TYPE_IDC_UNIQUE:
|
| case XML_SCHEMA_TYPE_IDC_KEY:
|
| - case XML_SCHEMA_TYPE_IDC_KEYREF:
|
| + case XML_SCHEMA_TYPE_IDC_KEYREF:
|
| if (item->type == XML_SCHEMA_TYPE_IDC_UNIQUE)
|
| *buf = xmlStrdup(BAD_CAST "unique '");
|
| else if (item->type == XML_SCHEMA_TYPE_IDC_KEY)
|
| @@ -1732,7 +1732,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
|
| default:
|
| named = 0;
|
| }
|
| - } else
|
| + } else
|
| named = 0;
|
|
|
| if ((named == 0) && (itemNode != NULL)) {
|
| @@ -1740,7 +1740,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
|
|
|
| if (itemNode->type == XML_ATTRIBUTE_NODE)
|
| elem = itemNode->parent;
|
| - else
|
| + else
|
| elem = itemNode;
|
| *buf = xmlStrdup(BAD_CAST "Element '");
|
| if (elem->ns != NULL) {
|
| @@ -1750,7 +1750,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
|
| } else
|
| *buf = xmlStrcat(*buf, elem->name);
|
| *buf = xmlStrcat(*buf, BAD_CAST "'");
|
| -
|
| +
|
| }
|
| if ((itemNode != NULL) && (itemNode->type == XML_ATTRIBUTE_NODE)) {
|
| *buf = xmlStrcat(*buf, BAD_CAST ", attribute '");
|
| @@ -1763,7 +1763,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
|
| *buf = xmlStrcat(*buf, BAD_CAST "'");
|
| }
|
| FREE_AND_NULL(str)
|
| -
|
| +
|
| return (*buf);
|
| }
|
|
|
| @@ -1786,13 +1786,13 @@ xmlSchemaFormatFacetEnumSet(xmlSchemaAbstractCtxtPtr actxt,
|
| int res, found = 0;
|
|
|
| if (*buf != NULL)
|
| - xmlFree(*buf);
|
| + xmlFree(*buf);
|
| *buf = NULL;
|
|
|
| do {
|
| /*
|
| * Use the whitespace type of the base type.
|
| - */
|
| + */
|
| ws = xmlSchemaGetWhiteSpaceFacetValue(type->baseType);
|
| for (facet = type->facets; facet != NULL; facet = facet->next) {
|
| if (facet->type != XML_SCHEMA_FACET_ENUMERATION)
|
| @@ -1881,7 +1881,7 @@ xmlSchemaPErrMemory(xmlSchemaParserCtxtPtr ctxt,
|
| * @msg: the error message
|
| * @str1: extra data
|
| * @str2: extra data
|
| - *
|
| + *
|
| * Handle a parser error
|
| */
|
| static void
|
| @@ -1914,7 +1914,7 @@ xmlSchemaPErr(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error,
|
| * @msg: the error message
|
| * @str1: extra data
|
| * @str2: extra data
|
| - *
|
| + *
|
| * Handle a parser error
|
| */
|
| static void
|
| @@ -1933,7 +1933,7 @@ xmlSchemaPErr2(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
|
| * xmlSchemaPErrExt:
|
| * @ctxt: the parsing context
|
| * @node: the context node
|
| - * @error: the error code
|
| + * @error: the error code
|
| * @strData1: extra data
|
| * @strData2: extra data
|
| * @strData3: extra data
|
| @@ -1943,13 +1943,13 @@ xmlSchemaPErr2(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
|
| * @str3: extra parameter for the message display
|
| * @str4: extra parameter for the message display
|
| * @str5: extra parameter for the message display
|
| - *
|
| + *
|
| * Handle a parser error
|
| */
|
| static void
|
| xmlSchemaPErrExt(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error,
|
| - const xmlChar * strData1, const xmlChar * strData2,
|
| - const xmlChar * strData3, const char *msg, const xmlChar * str1,
|
| + const xmlChar * strData1, const xmlChar * strData2,
|
| + const xmlChar * strData3, const char *msg, const xmlChar * str1,
|
| const xmlChar * str2, const xmlChar * str3, const xmlChar * str4,
|
| const xmlChar * str5)
|
| {
|
| @@ -1967,8 +1967,8 @@ xmlSchemaPErrExt(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error,
|
| }
|
| __xmlRaiseError(schannel, channel, data, ctxt, node, XML_FROM_SCHEMASP,
|
| error, XML_ERR_ERROR, NULL, 0,
|
| - (const char *) strData1, (const char *) strData2,
|
| - (const char *) strData3, 0, 0, msg, str1, str2,
|
| + (const char *) strData1, (const char *) strData2,
|
| + (const char *) strData3, 0, 0, msg, str1, str2,
|
| str3, str4, str5);
|
| }
|
|
|
| @@ -2016,7 +2016,7 @@ xmlSchemaPSimpleInternalErr(xmlNodePtr node,
|
| * @str1: extra data
|
| * @str2: extra data
|
| * @str3: extra data
|
| - *
|
| + *
|
| * Handle a validation error
|
| */
|
| static void
|
| @@ -2028,8 +2028,8 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt,
|
| {
|
| xmlStructuredErrorFunc schannel = NULL;
|
| xmlGenericErrorFunc channel = NULL;
|
| - void *data = NULL;
|
| -
|
| + void *data = NULL;
|
| +
|
| if (ctxt != NULL) {
|
| if (ctxt->type == XML_SCHEMA_CTXT_VALIDATOR) {
|
| xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctxt;
|
| @@ -2037,7 +2037,7 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt,
|
| if (errorLevel != XML_ERR_WARNING) {
|
| vctxt->nberrors++;
|
| vctxt->err = error;
|
| - channel = vctxt->error;
|
| + channel = vctxt->error;
|
| } else {
|
| channel = vctxt->warning;
|
| }
|
| @@ -2077,7 +2077,7 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt,
|
| else if ((vctxt->parserCtxt != NULL) &&
|
| (vctxt->parserCtxt->input != NULL))
|
| file = vctxt->parserCtxt->input->filename;
|
| - }
|
| + }
|
| __xmlRaiseError(schannel, channel, data, ctxt,
|
| node, XML_FROM_SCHEMASV,
|
| error, errorLevel, file, line,
|
| @@ -2089,7 +2089,7 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt,
|
| if (errorLevel != XML_ERR_WARNING) {
|
| pctxt->nberrors++;
|
| pctxt->err = error;
|
| - channel = pctxt->error;
|
| + channel = pctxt->error;
|
| } else {
|
| channel = pctxt->warning;
|
| }
|
| @@ -2115,11 +2115,11 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt,
|
| * @str1: extra data
|
| * @str2: extra data
|
| * @str3: extra data
|
| - *
|
| + *
|
| * Handle a validation error
|
| */
|
| static void
|
| -xmlSchemaErr3(xmlSchemaAbstractCtxtPtr actxt,
|
| +xmlSchemaErr3(xmlSchemaAbstractCtxtPtr actxt,
|
| int error, xmlNodePtr node, const char *msg,
|
| const xmlChar *str1, const xmlChar *str2, const xmlChar *str3)
|
| {
|
| @@ -2128,7 +2128,7 @@ xmlSchemaErr3(xmlSchemaAbstractCtxtPtr actxt,
|
| }
|
|
|
| static void
|
| -xmlSchemaErr4(xmlSchemaAbstractCtxtPtr actxt,
|
| +xmlSchemaErr4(xmlSchemaAbstractCtxtPtr actxt,
|
| int error, xmlNodePtr node, const char *msg,
|
| const xmlChar *str1, const xmlChar *str2,
|
| const xmlChar *str3, const xmlChar *str4)
|
| @@ -2157,7 +2157,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg,
|
| (node->type != XML_ELEMENT_NODE) &&
|
| (node->type != XML_ATTRIBUTE_NODE))
|
| {
|
| - /*
|
| + /*
|
| * Don't try to format other nodes than element and
|
| * attribute nodes.
|
| * Play save and return an empty string.
|
| @@ -2171,7 +2171,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg,
|
| */
|
| if (node->type == XML_ATTRIBUTE_NODE) {
|
| xmlNodePtr elem = node->parent;
|
| -
|
| +
|
| *msg = xmlStrdup(BAD_CAST "Element '");
|
| if (elem->ns != NULL)
|
| *msg = xmlStrcat(*msg, xmlSchemaFormatQName(&str,
|
| @@ -2181,7 +2181,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg,
|
| NULL, elem->name));
|
| FREE_AND_NULL(str);
|
| *msg = xmlStrcat(*msg, BAD_CAST "', ");
|
| - *msg = xmlStrcat(*msg, BAD_CAST "attribute '");
|
| + *msg = xmlStrcat(*msg, BAD_CAST "attribute '");
|
| } else {
|
| *msg = xmlStrdup(BAD_CAST "Element '");
|
| }
|
| @@ -2197,7 +2197,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg,
|
| xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) actxt;
|
| /*
|
| * Work on node infos.
|
| - */
|
| + */
|
| if (vctxt->inode->nodeType == XML_ATTRIBUTE_NODE) {
|
| xmlSchemaNodeInfoPtr ielem =
|
| vctxt->elemInfos[vctxt->depth];
|
| @@ -2207,7 +2207,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg,
|
| ielem->nsName, ielem->localName));
|
| FREE_AND_NULL(str);
|
| *msg = xmlStrcat(*msg, BAD_CAST "', ");
|
| - *msg = xmlStrcat(*msg, BAD_CAST "attribute '");
|
| + *msg = xmlStrcat(*msg, BAD_CAST "attribute '");
|
| } else {
|
| *msg = xmlStrdup(BAD_CAST "Element '");
|
| }
|
| @@ -2216,7 +2216,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg,
|
| FREE_AND_NULL(str);
|
| *msg = xmlStrcat(*msg, BAD_CAST "': ");
|
| } else if (actxt->type == XML_SCHEMA_CTXT_PARSER) {
|
| - /*
|
| + /*
|
| * Hmm, no node while parsing?
|
| * Return an empty string, in case NULL will break something.
|
| */
|
| @@ -2254,7 +2254,7 @@ xmlSchemaInternalErr2(xmlSchemaAbstractCtxtPtr actxt,
|
| return;
|
| msg = xmlStrdup(BAD_CAST "Internal error: ");
|
| msg = xmlStrcat(msg, BAD_CAST funcName);
|
| - msg = xmlStrcat(msg, BAD_CAST ", ");
|
| + msg = xmlStrcat(msg, BAD_CAST ", ");
|
| msg = xmlStrcat(msg, BAD_CAST message);
|
| msg = xmlStrcat(msg, BAD_CAST ".\n");
|
|
|
| @@ -2262,7 +2262,7 @@ xmlSchemaInternalErr2(xmlSchemaAbstractCtxtPtr actxt,
|
| xmlSchemaErr(actxt, XML_SCHEMAV_INTERNAL, NULL,
|
| (const char *) msg, str1, str2);
|
|
|
| - else if (actxt->type == XML_SCHEMA_CTXT_PARSER)
|
| + else if (actxt->type == XML_SCHEMA_CTXT_PARSER)
|
| xmlSchemaErr(actxt, XML_SCHEMAP_INTERNAL, NULL,
|
| (const char *) msg, str1, str2);
|
|
|
| @@ -2309,7 +2309,7 @@ xmlSchemaCustomErr4(xmlSchemaAbstractCtxtPtr actxt,
|
| } else
|
| xmlSchemaFormatNodeForError(&msg, actxt, node);
|
| msg = xmlStrcat(msg, (const xmlChar *) message);
|
| - msg = xmlStrcat(msg, BAD_CAST ".\n");
|
| + msg = xmlStrcat(msg, BAD_CAST ".\n");
|
| xmlSchemaErr4(actxt, error, node,
|
| (const char *) msg, str1, str2, str3, str4);
|
| FREE_AND_NULL(msg)
|
| @@ -2325,7 +2325,7 @@ xmlSchemaCustomErr(xmlSchemaAbstractCtxtPtr actxt,
|
| const xmlChar *str2)
|
| {
|
| xmlSchemaCustomErr4(actxt, error, node, item,
|
| - message, str1, str2, NULL, NULL);
|
| + message, str1, str2, NULL, NULL);
|
| }
|
|
|
|
|
| @@ -2344,8 +2344,8 @@ xmlSchemaCustomWarning(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
| xmlSchemaFormatNodeForError(&msg, actxt, node);
|
| msg = xmlStrcat(msg, (const xmlChar *) message);
|
| - msg = xmlStrcat(msg, BAD_CAST ".\n");
|
| -
|
| + msg = xmlStrcat(msg, BAD_CAST ".\n");
|
| +
|
| /* URGENT TODO: Set the error code to something sane. */
|
| xmlSchemaErr4Line(actxt, XML_ERR_WARNING, error, node, 0,
|
| (const char *) msg, str1, str2, str3, NULL);
|
| @@ -2365,15 +2365,15 @@ xmlSchemaKeyrefErr(xmlSchemaValidCtxtPtr vctxt,
|
| const xmlChar *str2)
|
| {
|
| xmlChar *msg = NULL, *qname = NULL;
|
| -
|
| - msg = xmlStrdup(BAD_CAST "Element '%s': ");
|
| +
|
| + msg = xmlStrdup(BAD_CAST "Element '%s': ");
|
| msg = xmlStrcat(msg, (const xmlChar *) message);
|
| msg = xmlStrcat(msg, BAD_CAST ".\n");
|
| xmlSchemaErr4Line(ACTXT_CAST vctxt, XML_ERR_ERROR,
|
| error, NULL, idcNode->nodeLine, (const char *) msg,
|
| xmlSchemaFormatQName(&qname,
|
| vctxt->nodeQNames->items[idcNode->nodeQNameID +1],
|
| - vctxt->nodeQNames->items[idcNode->nodeQNameID]),
|
| + vctxt->nodeQNames->items[idcNode->nodeQNameID]),
|
| str1, str2, NULL);
|
| FREE_AND_NULL(qname);
|
| FREE_AND_NULL(msg);
|
| @@ -2456,7 +2456,7 @@ xmlSchemaSimpleTypeErr(xmlSchemaAbstractCtxtPtr actxt,
|
| if (type->builtInType != 0) {
|
| msg = xmlStrcat(msg, BAD_CAST "xs:");
|
| msg = xmlStrcat(msg, type->name);
|
| - } else
|
| + } else
|
| msg = xmlStrcat(msg,
|
| xmlSchemaFormatQName(&str,
|
| type->targetNamespace, type->name));
|
| @@ -2494,12 +2494,12 @@ xmlSchemaIllegalAttrErr(xmlSchemaAbstractCtxtPtr actxt,
|
| xmlNodePtr node)
|
| {
|
| xmlChar *msg = NULL, *str = NULL;
|
| -
|
| +
|
| xmlSchemaFormatNodeForError(&msg, actxt, node);
|
| msg = xmlStrcat(msg, BAD_CAST "The attribute '%s' is not allowed.\n");
|
| xmlSchemaErr(actxt, error, node, (const char *) msg,
|
| xmlSchemaFormatErrorNodeQName(&str, (xmlSchemaNodeInfoPtr) ni, node),
|
| - NULL);
|
| + NULL);
|
| FREE_AND_NULL(str)
|
| FREE_AND_NULL(msg)
|
| }
|
| @@ -2518,7 +2518,7 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
|
| xmlChar *localName, *nsName;
|
| const xmlChar *cur, *end;
|
| int i;
|
| -
|
| +
|
| xmlSchemaFormatNodeForError(&msg, actxt, node);
|
| msg = xmlStrcat(msg, (const xmlChar *) message);
|
| msg = xmlStrcat(msg, BAD_CAST ".");
|
| @@ -2533,7 +2533,7 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
|
| } else
|
| str = xmlStrdup(BAD_CAST " Expected is ( ");
|
| nsName = NULL;
|
| -
|
| +
|
| for (i = 0; i < nbval + nbneg; i++) {
|
| cur = values[i];
|
| if (cur == NULL)
|
| @@ -2547,7 +2547,7 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
|
| * Get the local name.
|
| */
|
| localName = NULL;
|
| -
|
| +
|
| end = cur;
|
| if (*end == '*') {
|
| localName = xmlStrdup(BAD_CAST "*");
|
| @@ -2556,8 +2556,8 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
|
| while ((*end != 0) && (*end != '|'))
|
| end++;
|
| localName = xmlStrncat(localName, BAD_CAST cur, end - cur);
|
| - }
|
| - if (*end != 0) {
|
| + }
|
| + if (*end != 0) {
|
| end++;
|
| /*
|
| * Skip "*|*" if they come with negated expressions, since
|
| @@ -2573,12 +2573,12 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
|
| } else {
|
| while (*end != 0)
|
| end++;
|
| -
|
| +
|
| if (i >= nbval)
|
| nsName = xmlStrdup(BAD_CAST "{##other:");
|
| else
|
| nsName = xmlStrdup(BAD_CAST "{");
|
| -
|
| +
|
| nsName = xmlStrncat(nsName, BAD_CAST cur, end - cur);
|
| nsName = xmlStrcat(nsName, BAD_CAST "}");
|
| }
|
| @@ -2588,13 +2588,13 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
|
| FREE_AND_NULL(localName);
|
| continue;
|
| }
|
| - }
|
| + }
|
| str = xmlStrcat(str, BAD_CAST localName);
|
| FREE_AND_NULL(localName);
|
| -
|
| +
|
| if (i < nbval + nbneg -1)
|
| str = xmlStrcat(str, BAD_CAST ", ");
|
| - }
|
| + }
|
| str = xmlStrcat(str, BAD_CAST " ).\n");
|
| msg = xmlStrcat(msg, BAD_CAST str);
|
| FREE_AND_NULL(str)
|
| @@ -2626,8 +2626,8 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt,
|
| /*
|
| * If enumerations are validated, one must not expect the
|
| * facet to be given.
|
| - */
|
| - } else
|
| + */
|
| + } else
|
| facetType = facet->type;
|
| msg = xmlStrcat(msg, BAD_CAST "[");
|
| msg = xmlStrcat(msg, BAD_CAST "facet '");
|
| @@ -2655,31 +2655,31 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt,
|
| snprintf(actLen, 24, "%lu", length);
|
|
|
| if (facetType == XML_SCHEMA_FACET_LENGTH)
|
| - msg = xmlStrcat(msg,
|
| - BAD_CAST "this differs from the allowed length of '%s'.\n");
|
| + msg = xmlStrcat(msg,
|
| + BAD_CAST "this differs from the allowed length of '%s'.\n");
|
| else if (facetType == XML_SCHEMA_FACET_MAXLENGTH)
|
| - msg = xmlStrcat(msg,
|
| + msg = xmlStrcat(msg,
|
| BAD_CAST "this exceeds the allowed maximum length of '%s'.\n");
|
| else if (facetType == XML_SCHEMA_FACET_MINLENGTH)
|
| - msg = xmlStrcat(msg,
|
| + msg = xmlStrcat(msg,
|
| BAD_CAST "this underruns the allowed minimum length of '%s'.\n");
|
| -
|
| +
|
| if (nodeType == XML_ATTRIBUTE_NODE)
|
| xmlSchemaErr3(actxt, error, node, (const char *) msg,
|
| value, (const xmlChar *) actLen, (const xmlChar *) len);
|
| - else
|
| + else
|
| xmlSchemaErr(actxt, error, node, (const char *) msg,
|
| (const xmlChar *) actLen, (const xmlChar *) len);
|
| -
|
| +
|
| } else if (facetType == XML_SCHEMA_FACET_ENUMERATION) {
|
| msg = xmlStrcat(msg, BAD_CAST "The value '%s' is not an element "
|
| "of the set {%s}.\n");
|
| - xmlSchemaErr(actxt, error, node, (const char *) msg, value,
|
| + xmlSchemaErr(actxt, error, node, (const char *) msg, value,
|
| xmlSchemaFormatFacetEnumSet(actxt, &str, type));
|
| } else if (facetType == XML_SCHEMA_FACET_PATTERN) {
|
| msg = xmlStrcat(msg, BAD_CAST "The value '%s' is not accepted "
|
| "by the pattern '%s'.\n");
|
| - xmlSchemaErr(actxt, error, node, (const char *) msg, value,
|
| + xmlSchemaErr(actxt, error, node, (const char *) msg, value,
|
| facet->value);
|
| } else if (facetType == XML_SCHEMA_FACET_MININCLUSIVE) {
|
| msg = xmlStrcat(msg, BAD_CAST "The value '%s' is less than the "
|
| @@ -2711,10 +2711,10 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt,
|
| "digits than are allowed ('%s').\n");
|
| xmlSchemaErr(actxt, error, node, (const char*) msg, value,
|
| facet->value);
|
| - } else if (nodeType == XML_ATTRIBUTE_NODE) {
|
| + } else if (nodeType == XML_ATTRIBUTE_NODE) {
|
| msg = xmlStrcat(msg, BAD_CAST "The value '%s' is not facet-valid.\n");
|
| - xmlSchemaErr(actxt, error, node, (const char *) msg, value, NULL);
|
| - } else {
|
| + xmlSchemaErr(actxt, error, node, (const char *) msg, value, NULL);
|
| + } else {
|
| msg = xmlStrcat(msg, BAD_CAST "The value is not facet-valid.\n");
|
| xmlSchemaErr(actxt, error, node, (const char *) msg, NULL, NULL);
|
| }
|
| @@ -2722,7 +2722,7 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt,
|
| msg = xmlStrcat(msg, (const xmlChar *) message);
|
| msg = xmlStrcat(msg, BAD_CAST ".\n");
|
| xmlSchemaErr(actxt, error, node, (const char *) msg, str1, str2);
|
| - }
|
| + }
|
| FREE_AND_NULL(str)
|
| xmlFree(msg);
|
| }
|
| @@ -2967,9 +2967,9 @@ xmlSchemaPAttrUseErr4(xmlSchemaParserCtxtPtr ctxt,
|
| const xmlChar *str3,const xmlChar *str4)
|
| {
|
| xmlChar *str = NULL, *msg = NULL;
|
| -
|
| +
|
| xmlSchemaFormatItemForReport(&msg, NULL, ownerItem, NULL);
|
| - msg = xmlStrcat(msg, BAD_CAST ", ");
|
| + msg = xmlStrcat(msg, BAD_CAST ", ");
|
| msg = xmlStrcat(msg,
|
| BAD_CAST xmlSchemaFormatItemForReport(&str, NULL,
|
| WXS_BASIC_CAST attruse, NULL));
|
| @@ -2977,7 +2977,7 @@ xmlSchemaPAttrUseErr4(xmlSchemaParserCtxtPtr ctxt,
|
| msg = xmlStrcat(msg, BAD_CAST ": ");
|
| msg = xmlStrcat(msg, (const xmlChar *) message);
|
| msg = xmlStrcat(msg, BAD_CAST ".\n");
|
| - xmlSchemaErr4(ACTXT_CAST ctxt, error, node,
|
| + xmlSchemaErr4(ACTXT_CAST ctxt, error, node,
|
| (const char *) msg, str1, str2, str3, str4);
|
| xmlFree(msg);
|
| }
|
| @@ -3071,7 +3071,7 @@ xmlSchemaPMutualExclAttrErr(xmlSchemaParserCtxtPtr ctxt,
|
| * @error: the error code
|
| * @type: the type specifier
|
| * @ownerDes: the designation of the owner
|
| - * @ownerItem: the schema object if existent
|
| + * @ownerItem: the schema object if existent
|
| * @node: the validated node
|
| * @value: the validated value
|
| *
|
| @@ -3079,7 +3079,7 @@ xmlSchemaPMutualExclAttrErr(xmlSchemaParserCtxtPtr ctxt,
|
| * TODO: Should this report the value of an element as well?
|
| */
|
| static void
|
| -xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt,
|
| +xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt,
|
| xmlParserErrors error,
|
| xmlSchemaBasicItemPtr ownerItem ATTRIBUTE_UNUSED,
|
| xmlNodePtr node,
|
| @@ -3091,37 +3091,37 @@ xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt,
|
| const xmlChar *str2)
|
| {
|
| xmlChar *msg = NULL;
|
| -
|
| +
|
| xmlSchemaFormatNodeForError(&msg, ACTXT_CAST ctxt, node);
|
| if (message == NULL) {
|
| /*
|
| * Use default messages.
|
| - */
|
| + */
|
| if (type != NULL) {
|
| if (node->type == XML_ATTRIBUTE_NODE)
|
| msg = xmlStrcat(msg, BAD_CAST "'%s' is not a valid value of ");
|
| else
|
| msg = xmlStrcat(msg, BAD_CAST "The character content is not a "
|
| - "valid value of ");
|
| + "valid value of ");
|
| if (! xmlSchemaIsGlobalItem(type))
|
| msg = xmlStrcat(msg, BAD_CAST "the local ");
|
| else
|
| msg = xmlStrcat(msg, BAD_CAST "the ");
|
| -
|
| +
|
| if (WXS_IS_ATOMIC(type))
|
| msg = xmlStrcat(msg, BAD_CAST "atomic type");
|
| else if (WXS_IS_LIST(type))
|
| msg = xmlStrcat(msg, BAD_CAST "list type");
|
| else if (WXS_IS_UNION(type))
|
| msg = xmlStrcat(msg, BAD_CAST "union type");
|
| -
|
| +
|
| if (xmlSchemaIsGlobalItem(type)) {
|
| xmlChar *str = NULL;
|
| msg = xmlStrcat(msg, BAD_CAST " '");
|
| if (type->builtInType != 0) {
|
| msg = xmlStrcat(msg, BAD_CAST "xs:");
|
| msg = xmlStrcat(msg, type->name);
|
| - } else
|
| + } else
|
| msg = xmlStrcat(msg,
|
| xmlSchemaFormatQName(&str,
|
| type->targetNamespace, type->name));
|
| @@ -3134,7 +3134,7 @@ xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt,
|
| else
|
| msg = xmlStrcat(msg, BAD_CAST "The character content is not "
|
| "valid.");
|
| - }
|
| + }
|
| if (expected) {
|
| msg = xmlStrcat(msg, BAD_CAST " Expected is '");
|
| msg = xmlStrcat(msg, BAD_CAST expected);
|
| @@ -3151,7 +3151,7 @@ xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt,
|
| xmlSchemaPErrExt(ctxt, node, error, NULL, NULL, NULL,
|
| (const char*) msg, str1, str2, NULL, NULL, NULL);
|
| }
|
| - /* Cleanup. */
|
| + /* Cleanup. */
|
| FREE_AND_NULL(msg)
|
| }
|
|
|
| @@ -3372,7 +3372,7 @@ xmlSchemaItemListAddSize(xmlSchemaItemListPtr list,
|
|
|
| static int
|
| xmlSchemaItemListInsert(xmlSchemaItemListPtr list, void *item, int idx)
|
| -{
|
| +{
|
| if (list->items == NULL) {
|
| list->items = (void **) xmlMalloc(
|
| 20 * sizeof(void *));
|
| @@ -3412,7 +3412,7 @@ xmlSchemaItemListInsertSize(xmlSchemaItemListPtr list,
|
| int initialSize,
|
| void *item,
|
| int idx)
|
| -{
|
| +{
|
| if (list->items == NULL) {
|
| if (initialSize <= 0)
|
| initialSize = 1;
|
| @@ -3467,7 +3467,7 @@ xmlSchemaItemListRemove(xmlSchemaItemListPtr list, int idx)
|
| list->sizeItems = 0;
|
| } else if (list->nbItems -1 == idx) {
|
| list->nbItems--;
|
| - } else {
|
| + } else {
|
| for (i = idx; i < list->nbItems -1; i++)
|
| list->items[i] = list->items[i+1];
|
| list->nbItems--;
|
| @@ -3502,19 +3502,19 @@ xmlSchemaBucketFree(xmlSchemaBucketPtr bucket)
|
| }
|
| if (bucket->locals != NULL) {
|
| xmlSchemaComponentListFree(bucket->locals);
|
| - xmlSchemaItemListFree(bucket->locals);
|
| + xmlSchemaItemListFree(bucket->locals);
|
| }
|
| if (bucket->relations != NULL) {
|
| xmlSchemaSchemaRelationPtr prev, cur = bucket->relations;
|
| do {
|
| - prev = cur;
|
| + prev = cur;
|
| cur = cur->next;
|
| xmlFree(prev);
|
| } while (cur != NULL);
|
| }
|
| if ((! bucket->preserveDoc) && (bucket->doc != NULL)) {
|
| xmlFreeDoc(bucket->doc);
|
| - }
|
| + }
|
| if (bucket->type == XML_SCHEMA_SCHEMA_IMPORT) {
|
| if (WXS_IMPBUCKET(bucket)->schema != NULL)
|
| xmlSchemaFree(WXS_IMPBUCKET(bucket)->schema);
|
| @@ -3559,7 +3559,7 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt,
|
| xmlFree(ret);
|
| return(NULL);
|
| }
|
| - /*
|
| + /*
|
| * The following will assure that only the first bucket is marked as
|
| * XML_SCHEMA_SCHEMA_MAIN and it points to the *main* schema.
|
| * For each following import buckets an xmlSchema will be created.
|
| @@ -3573,7 +3573,7 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt,
|
| xmlSchemaBucketFree(ret);
|
| return(NULL);
|
| }
|
| - /* Force the type to be XML_SCHEMA_SCHEMA_MAIN. */
|
| + /* Force the type to be XML_SCHEMA_SCHEMA_MAIN. */
|
| ret->type = XML_SCHEMA_SCHEMA_MAIN;
|
| /* Point to the *main* schema. */
|
| WXS_CONSTRUCTOR(pctxt)->mainBucket = ret;
|
| @@ -3583,12 +3583,12 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt,
|
| */
|
| mainSchema->targetNamespace = targetNamespace;
|
| } else {
|
| - if (type == XML_SCHEMA_SCHEMA_MAIN) {
|
| + if (type == XML_SCHEMA_SCHEMA_MAIN) {
|
| PERROR_INT("xmlSchemaBucketCreate",
|
| "main bucket but it's not the first one");
|
| xmlSchemaBucketFree(ret);
|
| return(NULL);
|
| - } else if (type == XML_SCHEMA_SCHEMA_IMPORT) {
|
| + } else if (type == XML_SCHEMA_SCHEMA_IMPORT) {
|
| /*
|
| * Create a schema for imports and assign the
|
| * targetNamespace.
|
| @@ -3600,7 +3600,7 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt,
|
| }
|
| WXS_IMPBUCKET(ret)->schema->targetNamespace = targetNamespace;
|
| }
|
| - }
|
| + }
|
| if (WXS_IS_BUCKET_IMPMAIN(type)) {
|
| int res;
|
| /*
|
| @@ -3643,11 +3643,11 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt,
|
| if (mainSchema->includes == NULL) {
|
| xmlSchemaBucketFree(ret);
|
| return(NULL);
|
| - }
|
| + }
|
| }
|
| xmlSchemaItemListAdd(mainSchema->includes, ret);
|
| }
|
| - /*
|
| + /*
|
| * Add to list of all buckets; this is used for lookup
|
| * during schema construction time only.
|
| */
|
| @@ -4015,7 +4015,7 @@ xmlSchemaComponentListFree(xmlSchemaItemListPtr list)
|
| for (i = 0; i < list->nbItems; i++) {
|
| item = items[i];
|
| if (item == NULL)
|
| - continue;
|
| + continue;
|
| switch (item->type) {
|
| case XML_SCHEMA_TYPE_SIMPLE:
|
| case XML_SCHEMA_TYPE_COMPLEX:
|
| @@ -4122,7 +4122,7 @@ xmlSchemaFree(xmlSchemaPtr schema)
|
| xmlSchemaItemListPtr list = (xmlSchemaItemListPtr) schema->includes;
|
| int i;
|
| for (i = 0; i < list->nbItems; i++) {
|
| - xmlSchemaBucketFree((xmlSchemaBucketPtr) list->items[i]);
|
| + xmlSchemaBucketFree((xmlSchemaBucketPtr) list->items[i]);
|
| }
|
| xmlSchemaItemListFree(list);
|
| }
|
| @@ -4274,7 +4274,7 @@ xmlSchemaContentModelDump(xmlSchemaParticlePtr particle, FILE * output, int dept
|
| for (i = 0;((i < depth) && (i < 25));i++)
|
| shift[2 * i] = shift[2 * i + 1] = ' ';
|
| shift[2 * i] = shift[2 * i + 1] = 0;
|
| - fprintf(output, shift);
|
| + fprintf(output, "%s", shift);
|
| if (particle->children == NULL) {
|
| fprintf(output, "MISSING particle term\n");
|
| return;
|
| @@ -4330,7 +4330,7 @@ xmlSchemaContentModelDump(xmlSchemaParticlePtr particle, FILE * output, int dept
|
| /**
|
| * xmlSchemaAttrUsesDump:
|
| * @uses: attribute uses list
|
| - * @output: the file output
|
| + * @output: the file output
|
| *
|
| * Dumps a list of attribute use components.
|
| */
|
| @@ -4347,7 +4347,7 @@ xmlSchemaAttrUsesDump(xmlSchemaItemListPtr uses, FILE * output)
|
| if ((uses == NULL) || (uses->nbItems == 0))
|
| return;
|
|
|
| - fprintf(output, " attributes:\n");
|
| + fprintf(output, " attributes:\n");
|
| for (i = 0; i < uses->nbItems; i++) {
|
| use = uses->items[i];
|
| if (use->type == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB) {
|
| @@ -4533,7 +4533,7 @@ xmlSchemaDebugDumpIDCTable(FILE * output,
|
| return;
|
| do {
|
| fprintf(output, "IDC: BINDING '%s' (%d)\n",
|
| - xmlSchemaGetComponentQName(&str,
|
| + xmlSchemaGetComponentQName(&str,
|
| bind->definition), bind->nbNodes);
|
| FREE_AND_NULL(str)
|
| for (i = 0; i < bind->nbNodes; i++) {
|
| @@ -4634,7 +4634,7 @@ xmlSchemaGetPropNodeNs(xmlNodePtr node, const char *uri, const char *name)
|
| xmlAttrPtr prop;
|
|
|
| if ((node == NULL) || (name == NULL))
|
| - return(NULL);
|
| + return(NULL);
|
| prop = node->properties;
|
| while (prop != NULL) {
|
| if ((prop->ns != NULL) &&
|
| @@ -4729,12 +4729,12 @@ xmlSchemaGetElem(xmlSchemaPtr schema, const xmlChar * name,
|
| const xmlChar * nsName)
|
| {
|
| xmlSchemaElementPtr ret = NULL;
|
| -
|
| +
|
| if ((name == NULL) || (schema == NULL))
|
| return(NULL);
|
| if (schema != NULL) {
|
| WXS_FIND_GLOBAL_ITEM(elemDecl)
|
| - }
|
| + }
|
| exit:
|
| #ifdef DEBUG
|
| if (ret == NULL) {
|
| @@ -4765,9 +4765,9 @@ xmlSchemaGetType(xmlSchemaPtr schema, const xmlChar * name,
|
| xmlSchemaTypePtr ret = NULL;
|
|
|
| if (name == NULL)
|
| - return (NULL);
|
| + return (NULL);
|
| /* First try the built-in types. */
|
| - if ((nsName != NULL) && xmlStrEqual(nsName, xmlSchemaNs)) {
|
| + if ((nsName != NULL) && xmlStrEqual(nsName, xmlSchemaNs)) {
|
| ret = xmlSchemaGetPredefinedType(name, nsName);
|
| if (ret != NULL)
|
| goto exit;
|
| @@ -4780,7 +4780,7 @@ xmlSchemaGetType(xmlSchemaPtr schema, const xmlChar * name,
|
| }
|
| if (schema != NULL) {
|
| WXS_FIND_GLOBAL_ITEM(typeDecl)
|
| - }
|
| + }
|
| exit:
|
|
|
| #ifdef DEBUG
|
| @@ -4891,7 +4891,7 @@ xmlSchemaGetGroup(xmlSchemaPtr schema, const xmlChar * name,
|
| WXS_FIND_GLOBAL_ITEM(groupDecl)
|
| }
|
| exit:
|
| -
|
| +
|
| #ifdef DEBUG
|
| if (ret == NULL) {
|
| if (nsName == NULL)
|
| @@ -5000,7 +5000,7 @@ xmlSchemaIsBlank(xmlChar * str, int len)
|
| str++;
|
| len--;
|
| }
|
| -
|
| +
|
| return (1);
|
| }
|
|
|
| @@ -5061,7 +5061,7 @@ xmlSchemaFindRedefCompInGraph(xmlSchemaBucketPtr bucket,
|
| default:
|
| /* Should not be hit. */
|
| return(NULL);
|
| - }
|
| + }
|
| }
|
| }
|
| subschemas:
|
| @@ -5209,7 +5209,7 @@ xmlSchemaAddAttributeUse(xmlSchemaParserCtxtPtr pctxt,
|
| * resolve references to the redefined components and to check constraints.
|
| */
|
| static xmlSchemaRedefPtr
|
| -xmlSchemaAddRedef(xmlSchemaParserCtxtPtr pctxt,
|
| +xmlSchemaAddRedef(xmlSchemaParserCtxtPtr pctxt,
|
| xmlSchemaBucketPtr targetBucket,
|
| void *item,
|
| const xmlChar *refName,
|
| @@ -5272,7 +5272,7 @@ xmlSchemaAddAttributeGroupDefinition(xmlSchemaParserCtxtPtr pctxt,
|
| ret->type = XML_SCHEMA_TYPE_ATTRIBUTEGROUP;
|
| ret->name = name;
|
| ret->targetNamespace = nsName;
|
| - ret->node = node;
|
| + ret->node = node;
|
|
|
| /* TODO: Remove the flag. */
|
| ret->flags |= XML_SCHEMAS_ATTRGROUP_GLOBAL;
|
| @@ -5282,7 +5282,7 @@ xmlSchemaAddAttributeGroupDefinition(xmlSchemaParserCtxtPtr pctxt,
|
| if (pctxt->redef == NULL) {
|
| xmlFree(ret);
|
| return(NULL);
|
| - }
|
| + }
|
| pctxt->redefCounter = 0;
|
| }
|
| WXS_ADD_GLOBAL(pctxt, ret);
|
| @@ -5371,13 +5371,13 @@ xmlSchemaAddType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| if (ctxt->redef == NULL) {
|
| xmlFree(ret);
|
| return(NULL);
|
| - }
|
| + }
|
| ctxt->redefCounter = 0;
|
| }
|
| WXS_ADD_GLOBAL(ctxt, ret);
|
| } else
|
| WXS_ADD_LOCAL(ctxt, ret);
|
| - WXS_ADD_PENDING(ctxt, ret);
|
| + WXS_ADD_PENDING(ctxt, ret);
|
| return (ret);
|
| }
|
|
|
| @@ -5509,7 +5509,7 @@ xmlSchemaAddParticle(xmlSchemaParserCtxtPtr ctxt,
|
| ret->children = NULL;
|
|
|
| WXS_ADD_LOCAL(ctxt, ret);
|
| - /*
|
| + /*
|
| * Note that addition to pending components will be done locally
|
| * to the specific parsing function, since the most particles
|
| * need not to be fixed up (i.e. the reference to be resolved).
|
| @@ -5558,7 +5558,7 @@ xmlSchemaAddModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt,
|
| if (ctxt->redef == NULL) {
|
| xmlFree(ret);
|
| return(NULL);
|
| - }
|
| + }
|
| ctxt->redefCounter = 0;
|
| }
|
| WXS_ADD_GLOBAL(ctxt, ret);
|
| @@ -5595,7 +5595,7 @@ xmlSchemaAddIDC(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| const xmlChar *name, const xmlChar *nsName,
|
| int category, xmlNodePtr node)
|
| {
|
| - xmlSchemaIDCPtr ret = NULL;
|
| + xmlSchemaIDCPtr ret = NULL;
|
|
|
| if ((ctxt == NULL) || (schema == NULL) || (name == NULL))
|
| return (NULL);
|
| @@ -5611,8 +5611,8 @@ xmlSchemaAddIDC(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| ret->targetNamespace = nsName;
|
| ret->name = name;
|
| ret->type = category;
|
| - ret->node = node;
|
| -
|
| + ret->node = node;
|
| +
|
| WXS_ADD_GLOBAL(ctxt, ret);
|
| /*
|
| * Only keyrefs need to be fixup up.
|
| @@ -5648,7 +5648,7 @@ xmlSchemaAddWildcard(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| }
|
| memset(ret, 0, sizeof(xmlSchemaWildcard));
|
| ret->type = type;
|
| - ret->node = node;
|
| + ret->node = node;
|
| WXS_ADD_LOCAL(ctxt, ret);
|
| return (ret);
|
| }
|
| @@ -5704,7 +5704,7 @@ xmlSchemaSubstGroupAdd(xmlSchemaParserCtxtPtr pctxt,
|
| static xmlSchemaSubstGroupPtr
|
| xmlSchemaSubstGroupGet(xmlSchemaParserCtxtPtr pctxt,
|
| xmlSchemaElementPtr head)
|
| -{
|
| +{
|
| if (WXS_SUBST_GROUPS(pctxt) == NULL)
|
| return(NULL);
|
| return(xmlHashLookup2(WXS_SUBST_GROUPS(pctxt),
|
| @@ -6120,7 +6120,7 @@ xmlSchemaPGetBoolNodeValue(xmlSchemaParserCtxtPtr ctxt,
|
| value = xmlNodeGetContent(node);
|
| /*
|
| * 3.2.2.1 Lexical representation
|
| - * An instance of a datatype that is defined as ·boolean·
|
| + * An instance of a datatype that is defined as �boolean�
|
| * can have the following legal literals {true, false, 1, 0}.
|
| */
|
| if (xmlStrEqual(BAD_CAST value, BAD_CAST "true"))
|
| @@ -6168,7 +6168,7 @@ xmlGetBooleanProp(xmlSchemaParserCtxtPtr ctxt,
|
| return (def);
|
| /*
|
| * 3.2.2.1 Lexical representation
|
| - * An instance of a datatype that is defined as ·boolean·
|
| + * An instance of a datatype that is defined as �boolean�
|
| * can have the following legal literals {true, false, 1, 0}.
|
| */
|
| if (xmlStrEqual(val, BAD_CAST "true"))
|
| @@ -6288,7 +6288,7 @@ xmlSchemaPValAttrNodeValue(xmlSchemaParserCtxtPtr pctxt,
|
| ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2;
|
| else
|
| ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1;
|
| - xmlSchemaPSimpleTypeErr(pctxt,
|
| + xmlSchemaPSimpleTypeErr(pctxt,
|
| ret, ownerItem, (xmlNodePtr) attr,
|
| type, NULL, value, NULL, NULL, NULL);
|
| }
|
| @@ -6352,7 +6352,7 @@ xmlSchemaPValAttrNode(xmlSchemaParserCtxtPtr ctxt,
|
| * number otherwise and -1 in case of an internal or API error.
|
| */
|
| static int
|
| -xmlSchemaPValAttr(xmlSchemaParserCtxtPtr ctxt,
|
| +xmlSchemaPValAttr(xmlSchemaParserCtxtPtr ctxt,
|
| xmlSchemaBasicItemPtr ownerItem,
|
| xmlNodePtr ownerElem,
|
| const char *name,
|
| @@ -6442,7 +6442,7 @@ xmlSchemaCheckReference(xmlSchemaParserCtxtPtr pctxt,
|
| * @type: the hosting type where the attributes will be anchored
|
| *
|
| * Parses attribute uses and attribute declarations and
|
| - * attribute group references.
|
| + * attribute group references.
|
| */
|
| static int
|
| xmlSchemaParseLocalAttributes(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| @@ -6797,7 +6797,7 @@ xmlSchemaParseWildcardNs(xmlSchemaParserCtxtPtr ctxt,
|
| tmp->next = NULL;
|
| if (wildc->nsSet == NULL)
|
| wildc->nsSet = tmp;
|
| - else
|
| + else if (lastNs != NULL)
|
| lastNs->next = tmp;
|
| lastNs = tmp;
|
| }
|
| @@ -7085,7 +7085,7 @@ xmlSchemaParseLocalAttribute(xmlSchemaParserCtxtPtr pctxt,
|
| int parentType)
|
| {
|
| const xmlChar *attrValue, *name = NULL, *ns = NULL;
|
| - xmlSchemaAttributeUsePtr use = NULL;
|
| + xmlSchemaAttributeUsePtr use = NULL;
|
| xmlNodePtr child = NULL;
|
| xmlAttrPtr attr;
|
| const xmlChar *tmpNs = NULL, *tmpName = NULL, *defValue = NULL;
|
| @@ -7139,7 +7139,7 @@ xmlSchemaParseLocalAttribute(xmlSchemaParserCtxtPtr pctxt,
|
| /*
|
| * Evaluate the target namespace
|
| */
|
| - hasForm = 1;
|
| + hasForm = 1;
|
| attrValue = xmlSchemaGetNodeContent(pctxt,
|
| (xmlNodePtr) attr);
|
| if (xmlStrEqual(attrValue, BAD_CAST "qualified")) {
|
| @@ -7210,7 +7210,7 @@ xmlSchemaParseLocalAttribute(xmlSchemaParserCtxtPtr pctxt,
|
|
|
| attr_next:
|
| attr = attr->next;
|
| - }
|
| + }
|
| /*
|
| * 3.2.3 : 2
|
| * If default and use are both present, use must have
|
| @@ -7236,7 +7236,7 @@ attr_next:
|
|
|
| /* TODO: move XML_SCHEMAS_QUALIF_ATTR to the parser. */
|
| if ((! hasForm) && (schema->flags & XML_SCHEMAS_QUALIF_ATTR))
|
| - ns = pctxt->targetNamespace;
|
| + ns = pctxt->targetNamespace;
|
| /*
|
| * 3.2.6 Schema Component Constraint: xsi: Not Allowed
|
| * TODO: Move this to the component layer.
|
| @@ -7293,7 +7293,7 @@ attr_next:
|
| use->attrDecl = attrDecl;
|
| /*
|
| * Value constraint.
|
| - */
|
| + */
|
| if (defValue != NULL) {
|
| attrDecl->defValue = defValue;
|
| if (defValueType == WXS_ATTR_DEF_VAL_FIXED)
|
| @@ -7333,14 +7333,14 @@ attr_next:
|
| if (defValueType == WXS_ATTR_DEF_VAL_FIXED)
|
| use->flags |= XML_SCHEMA_ATTR_USE_FIXED;
|
| }
|
| -
|
| +
|
| check_children:
|
| /*
|
| * And now for the children...
|
| */
|
| child = node->children;
|
| if (occurs == XML_SCHEMAS_ATTR_USE_PROHIBITED) {
|
| - xmlSchemaAttributeUseProhibPtr prohib;
|
| + xmlSchemaAttributeUseProhibPtr prohib;
|
|
|
| if (IS_SCHEMA(child, "annotation")) {
|
| xmlSchemaParseAnnotation(pctxt, child, 0);
|
| @@ -7355,7 +7355,7 @@ check_children:
|
| /*
|
| * Check for pointlessness of attribute prohibitions.
|
| */
|
| - if (parentType == XML_SCHEMA_TYPE_ATTRIBUTEGROUP) {
|
| + if (parentType == XML_SCHEMA_TYPE_ATTRIBUTEGROUP) {
|
| xmlSchemaCustomWarning(ACTXT_CAST pctxt,
|
| XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH,
|
| node, NULL,
|
| @@ -7373,7 +7373,7 @@ check_children:
|
| return(NULL);
|
| }
|
| if (! isRef) {
|
| - tmpName = name;
|
| + tmpName = name;
|
| tmpNs = ns;
|
| }
|
| /*
|
| @@ -7381,7 +7381,7 @@ check_children:
|
| */
|
| if (uses) {
|
| int i;
|
| -
|
| +
|
| for (i = 0; i < uses->nbItems; i++) {
|
| use = uses->items[i];
|
| if ((use->type == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB) &&
|
| @@ -7389,16 +7389,16 @@ check_children:
|
| (tmpNs == (WXS_ATTR_PROHIB_CAST use)->targetNamespace))
|
| {
|
| xmlChar *str = NULL;
|
| -
|
| +
|
| xmlSchemaCustomWarning(ACTXT_CAST pctxt,
|
| XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH,
|
| node, NULL,
|
| "Skipping duplicate attribute use prohibition '%s'",
|
| xmlSchemaFormatQName(&str, tmpNs, tmpName),
|
| NULL, NULL);
|
| - FREE_AND_NULL(str)
|
| + FREE_AND_NULL(str)
|
| return(NULL);
|
| - }
|
| + }
|
| }
|
| }
|
| /*
|
| @@ -7417,7 +7417,7 @@ check_children:
|
| WXS_ADD_PENDING(pctxt, prohib);
|
| }
|
| return(WXS_BASIC_CAST prohib);
|
| - } else {
|
| + } else {
|
| if (IS_SCHEMA(child, "annotation")) {
|
| /*
|
| * TODO: Should this go into the attr decl?
|
| @@ -7464,7 +7464,7 @@ check_children:
|
| NULL, node, child, NULL,
|
| "(annotation?, simpleType?)");
|
| }
|
| - }
|
| + }
|
| return (WXS_BASIC_CAST use);
|
| }
|
|
|
| @@ -7486,7 +7486,7 @@ xmlSchemaParseGlobalAttribute(xmlSchemaParserCtxtPtr pctxt,
|
| * 3.2.3 Constraints on XML Representations of Attribute Declarations
|
| */
|
| if ((pctxt == NULL) || (schema == NULL) || (node == NULL))
|
| - return (NULL);
|
| + return (NULL);
|
| /*
|
| * 3.2.3 : 3.1
|
| * One of ref or name must be present, but not both
|
| @@ -7532,7 +7532,7 @@ xmlSchemaParseGlobalAttribute(xmlSchemaParserCtxtPtr pctxt,
|
| if (ret == NULL)
|
| return (NULL);
|
| ret->flags |= XML_SCHEMAS_ATTR_GLOBAL;
|
| -
|
| +
|
| /*
|
| * Check for illegal attributes.
|
| */
|
| @@ -7546,7 +7546,7 @@ xmlSchemaParseGlobalAttribute(xmlSchemaParserCtxtPtr pctxt,
|
| (!xmlStrEqual(attr->name, BAD_CAST "type")))
|
| {
|
| xmlSchemaPIllegalAttrErr(pctxt,
|
| - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr);
|
| + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr);
|
| }
|
| } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) {
|
| xmlSchemaPIllegalAttrErr(pctxt,
|
| @@ -7556,7 +7556,7 @@ xmlSchemaParseGlobalAttribute(xmlSchemaParserCtxtPtr pctxt,
|
| }
|
| xmlSchemaPValAttrQName(pctxt, schema, NULL,
|
| node, "type", &ret->typeNs, &ret->typeName);
|
| -
|
| +
|
| xmlSchemaPValAttrID(pctxt, node, BAD_CAST "id");
|
| /*
|
| * Attribute "fixed".
|
| @@ -7641,12 +7641,12 @@ xmlSchemaParseAttributeGroupRef(xmlSchemaParserCtxtPtr pctxt,
|
| XML_SCHEMAP_S4S_ATTR_MISSING,
|
| NULL, node, "ref", NULL);
|
| return (NULL);
|
| - }
|
| + }
|
| xmlSchemaPValAttrNodeQName(pctxt, schema,
|
| NULL, attr, &refNs, &ref);
|
| if (xmlSchemaCheckReference(pctxt, schema, node, attr, refNs) != 0)
|
| return(NULL);
|
| -
|
| +
|
| /*
|
| * Check for illegal attributes.
|
| */
|
| @@ -7698,13 +7698,13 @@ xmlSchemaParseAttributeGroupRef(xmlSchemaParserCtxtPtr pctxt,
|
| /*
|
| * SPEC src-redefine:
|
| * (7.1) "If it has an <attributeGroup> among its contents
|
| - * the ·actual value· of whose ref [attribute] is the same
|
| - * as the ·actual value· of its own name attribute plus
|
| + * the �actual value� of whose ref [attribute] is the same
|
| + * as the �actual value� of its own name attribute plus
|
| * target namespace, then it must have exactly one such group."
|
| */
|
| if (pctxt->redefCounter != 0) {
|
| xmlChar *str = NULL;
|
| -
|
| +
|
| xmlSchemaCustomErr(ACTXT_CAST pctxt,
|
| XML_SCHEMAP_SRC_REDEFINE, node, NULL,
|
| "The redefining attribute group definition "
|
| @@ -7738,7 +7738,7 @@ xmlSchemaParseAttributeGroupRef(xmlSchemaParserCtxtPtr pctxt,
|
| ret->node = node;
|
| /* Add to pending items, to be able to resolve the reference. */
|
| WXS_ADD_PENDING(pctxt, ret);
|
| - }
|
| + }
|
| return (ret);
|
| }
|
|
|
| @@ -7785,7 +7785,7 @@ xmlSchemaParseAttributeGroupDefinition(xmlSchemaParserCtxtPtr pctxt,
|
| ret = xmlSchemaAddAttributeGroupDefinition(pctxt, schema,
|
| name, pctxt->targetNamespace, node);
|
| if (ret == NULL)
|
| - return (NULL);
|
| + return (NULL);
|
| /*
|
| * Check for illegal attributes.
|
| */
|
| @@ -8185,7 +8185,7 @@ xmlSchemaAddAnnotation(xmlSchemaAnnotItemPtr annItem,
|
| * Returns the parsed identity-constraint definition.
|
| */
|
| static xmlSchemaIDCSelectPtr
|
| -xmlSchemaParseIDCSelectorAndField(xmlSchemaParserCtxtPtr ctxt,
|
| +xmlSchemaParseIDCSelectorAndField(xmlSchemaParserCtxtPtr ctxt,
|
| xmlSchemaIDCPtr idc,
|
| xmlNodePtr node,
|
| int isField)
|
| @@ -8848,7 +8848,7 @@ xmlSchemaParseUnion(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| type->flags |= XML_SCHEMAS_TYPE_VARIETY_UNION;
|
| /*
|
| * SPEC (Base type) (2) "If the <list> or <union> alternative is chosen,
|
| - * then the ·simple ur-type definition·."
|
| + * then the �simple ur-type definition�."
|
| */
|
| type->baseType = xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYSIMPLETYPE);
|
| /*
|
| @@ -9016,7 +9016,7 @@ xmlSchemaParseList(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| type->flags |= XML_SCHEMAS_TYPE_VARIETY_LIST;
|
| /*
|
| * SPEC (Base type) (2) "If the <list> or <union> alternative is chosen,
|
| - * then the ·simple ur-type definition·."
|
| + * then the �simple ur-type definition�."
|
| */
|
| type->baseType = xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYSIMPLETYPE);
|
| /*
|
| @@ -9161,9 +9161,9 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| }
|
| /*
|
| * TargetNamespace:
|
| - * SPEC "The ·actual value· of the targetNamespace [attribute]
|
| + * SPEC "The �actual value� of the targetNamespace [attribute]
|
| * of the <schema> ancestor element information item if present,
|
| - * otherwise ·absent·.
|
| + * otherwise �absent�.
|
| */
|
| if (topLevel == 0) {
|
| #ifdef ENABLE_NAMED_LOCALS
|
| @@ -9195,7 +9195,7 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| if (attr->ns == NULL) {
|
| if (!xmlStrEqual(attr->name, BAD_CAST "id")) {
|
| xmlSchemaPIllegalAttrErr(ctxt,
|
| - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr);
|
| + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr);
|
| }
|
| } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) {
|
| xmlSchemaPIllegalAttrErr(ctxt,
|
| @@ -9266,9 +9266,9 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| * And now for the children...
|
| */
|
| oldCtxtType = ctxt->ctxtType;
|
| -
|
| +
|
| ctxt->ctxtType = type;
|
| -
|
| +
|
| child = node->children;
|
| if (IS_SCHEMA(child, "annotation")) {
|
| type->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
|
| @@ -9278,10 +9278,10 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_MISSING,
|
| NULL, node, child, NULL,
|
| "(annotation?, (restriction | list | union))");
|
| - } else if (IS_SCHEMA(child, "restriction")) {
|
| + } else if (IS_SCHEMA(child, "restriction")) {
|
| xmlSchemaParseRestriction(ctxt, schema, child,
|
| - XML_SCHEMA_TYPE_SIMPLE);
|
| - hasRestriction = 1;
|
| + XML_SCHEMA_TYPE_SIMPLE);
|
| + hasRestriction = 1;
|
| child = child->next;
|
| } else if (IS_SCHEMA(child, "list")) {
|
| xmlSchemaParseList(ctxt, schema, child);
|
| @@ -9298,8 +9298,8 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| /*
|
| * REDEFINE: SPEC src-redefine (5)
|
| * "Within the [children], each <simpleType> must have a
|
| - * <restriction> among its [children] ... the ·actual value· of whose
|
| - * base [attribute] must be the same as the ·actual value· of its own
|
| + * <restriction> among its [children] ... the �actual value� of whose
|
| + * base [attribute] must be the same as the �actual value� of its own
|
| * name attribute plus target namespace;"
|
| */
|
| if (topLevel && ctxt->isRedefine && (! hasRestriction)) {
|
| @@ -9307,7 +9307,7 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| NULL, node, "This is a redefinition, thus the "
|
| "<simpleType> must have a <restriction> child", NULL);
|
| }
|
| -
|
| +
|
| ctxt->ctxtType = oldCtxtType;
|
| return (type);
|
| }
|
| @@ -9373,13 +9373,13 @@ xmlSchemaParseModelGroupDefRef(xmlSchemaParserCtxtPtr ctxt,
|
| xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
|
| item = xmlSchemaAddParticle(ctxt, node, min, max);
|
| if (item == NULL)
|
| - return (NULL);
|
| + return (NULL);
|
| /*
|
| * Create a qname-reference and set as the term; it will be substituted
|
| * for the model group after the reference has been resolved.
|
| */
|
| item->children = (xmlSchemaTreeItemPtr)
|
| - xmlSchemaNewQNameRef(ctxt, XML_SCHEMA_TYPE_GROUP, ref, refNs);
|
| + xmlSchemaNewQNameRef(ctxt, XML_SCHEMA_TYPE_GROUP, ref, refNs);
|
| xmlSchemaPCheckParticleCorrect_2(ctxt, item, node, min, max);
|
| /*
|
| * And now for the children...
|
| @@ -9419,7 +9419,7 @@ xmlSchemaParseModelGroupDefRef(xmlSchemaParserCtxtPtr ctxt,
|
| * Note that the contraint src-redefine (6.2) can't be applied until
|
| * references have been resolved. So we will do this at the
|
| * component fixup level.
|
| - *
|
| + *
|
| * *WARNING* this interface is highly subject to change
|
| *
|
| * Returns -1 in case of error, 0 if the declaration is improper and
|
| @@ -9493,7 +9493,7 @@ xmlSchemaParseModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt,
|
| child = child->next;
|
| }
|
|
|
| -
|
| +
|
|
|
| if (child != NULL) {
|
| xmlSchemaPContentErr(ctxt,
|
| @@ -9631,7 +9631,7 @@ xmlSchemaParseSchemaElement(xmlSchemaParserCtxtPtr ctxt,
|
| attr = xmlSchemaGetPropNode(node, "version");
|
| if (attr != NULL) {
|
| res = xmlSchemaPValAttrNode(ctxt, NULL, NULL, attr,
|
| - xmlSchemaGetBuiltInType(XML_SCHEMAS_TOKEN), &val);
|
| + xmlSchemaGetBuiltInType(XML_SCHEMAS_TOKEN), &val);
|
| HFAILURE;
|
| }
|
| */
|
| @@ -9691,7 +9691,7 @@ xmlSchemaParseSchemaElement(xmlSchemaParserCtxtPtr ctxt,
|
| }
|
| attr = xmlSchemaGetPropNode(node, "blockDefault");
|
| if (attr != NULL) {
|
| - val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
|
| + val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
|
| res = xmlSchemaPValAttrBlockFinal(val, &(schema->flags), -1,
|
| XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION,
|
| XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION,
|
| @@ -9752,14 +9752,14 @@ xmlSchemaParseSchemaTopLevel(xmlSchemaParserCtxtPtr ctxt,
|
| HFAILURE;
|
| HSTOP(ctxt);
|
| if (tmpOldErrs != ctxt->nberrors)
|
| - goto exit;
|
| + goto exit;
|
| } else if (IS_SCHEMA(child, "include")) {
|
| tmpOldErrs = ctxt->nberrors;
|
| res = xmlSchemaParseInclude(ctxt, schema, child);
|
| HFAILURE;
|
| HSTOP(ctxt);
|
| if (tmpOldErrs != ctxt->nberrors)
|
| - goto exit;
|
| + goto exit;
|
| } else if (IS_SCHEMA(child, "redefine")) {
|
| tmpOldErrs = ctxt->nberrors;
|
| res = xmlSchemaParseRedefine(ctxt, schema, child);
|
| @@ -9884,7 +9884,7 @@ xmlSchemaConstructionCtxtFree(xmlSchemaConstructionCtxtPtr con)
|
| xmlFree(con);
|
| }
|
|
|
| -static xmlSchemaConstructionCtxtPtr
|
| +static xmlSchemaConstructionCtxtPtr
|
| xmlSchemaConstructionCtxtCreate(xmlDictPtr dict)
|
| {
|
| xmlSchemaConstructionCtxtPtr ret;
|
| @@ -9954,10 +9954,10 @@ xmlSchemaNewParserCtxtUseDict(const char *URL, xmlDictPtr dict)
|
| xmlSchemaParserCtxtPtr ret;
|
|
|
| ret = xmlSchemaParserCtxtCreate();
|
| - if (ret == NULL)
|
| + if (ret == NULL)
|
| return (NULL);
|
| ret->dict = dict;
|
| - xmlDictReference(dict);
|
| + xmlDictReference(dict);
|
| if (URL != NULL)
|
| ret->URL = xmlDictLookup(dict, (const xmlChar *) URL, -1);
|
| return (ret);
|
| @@ -10082,8 +10082,8 @@ xmlSchemaParseNewDocWithContext(xmlSchemaParserCtxtPtr pctxt,
|
| xmlNodePtr node;
|
| int ret, oldErrs;
|
| xmlSchemaBucketPtr oldbucket = pctxt->constructor->bucket;
|
| -
|
| - /*
|
| +
|
| + /*
|
| * Save old values; reset the *main* schema.
|
| * URGENT TODO: This is not good; move the per-document information
|
| * to the parser. Get rid of passing the main schema to the
|
| @@ -10093,9 +10093,9 @@ xmlSchemaParseNewDocWithContext(xmlSchemaParserCtxtPtr pctxt,
|
| oldDoc = schema->doc;
|
| if (schema->flags != 0)
|
| xmlSchemaClearSchemaDefaults(schema);
|
| - schema->doc = bucket->doc;
|
| + schema->doc = bucket->doc;
|
| pctxt->schema = schema;
|
| - /*
|
| + /*
|
| * Keep the current target namespace on the parser *not* on the
|
| * main schema.
|
| */
|
| @@ -10108,7 +10108,7 @@ xmlSchemaParseNewDocWithContext(xmlSchemaParserCtxtPtr pctxt,
|
| * We are parsing the schema for schemas!
|
| */
|
| pctxt->isS4S = 1;
|
| - }
|
| + }
|
| /* Mark it as parsed, even if parsing fails. */
|
| bucket->parsed++;
|
| /* Compile the schema doc. */
|
| @@ -10132,7 +10132,7 @@ xmlSchemaParseNewDocWithContext(xmlSchemaParserCtxtPtr pctxt,
|
| ret = pctxt->err;
|
| goto exit;
|
| }
|
| -
|
| +
|
| exit:
|
| WXS_CONSTRUCTOR(pctxt)->bucket = oldbucket;
|
| /* Restore schema values. */
|
| @@ -10165,7 +10165,7 @@ xmlSchemaParseNewDoc(xmlSchemaParserCtxtPtr pctxt,
|
| PERROR_INT("xmlSchemaParseNewDoc",
|
| "no constructor");
|
| return(-1);
|
| - }
|
| + }
|
| /* Create and init the temporary parser context. */
|
| newpctxt = xmlSchemaNewParserCtxtUseDict(
|
| (const char *) bucket->schemaLocation, pctxt->dict);
|
| @@ -10173,7 +10173,7 @@ xmlSchemaParseNewDoc(xmlSchemaParserCtxtPtr pctxt,
|
| return(-1);
|
| newpctxt->constructor = pctxt->constructor;
|
| /*
|
| - * TODO: Can we avoid that the parser knows about the main schema?
|
| + * TODO: Can we avoid that the parser knows about the main schema?
|
| * It would be better if he knows about the current schema bucket
|
| * only.
|
| */
|
| @@ -10183,16 +10183,16 @@ xmlSchemaParseNewDoc(xmlSchemaParserCtxtPtr pctxt,
|
| xmlSchemaSetParserStructuredErrors(newpctxt, pctxt->serror,
|
| pctxt->errCtxt);
|
| newpctxt->counter = pctxt->counter;
|
| -
|
| +
|
|
|
| res = xmlSchemaParseNewDocWithContext(newpctxt, schema, bucket);
|
| -
|
| +
|
| /* Channel back errors and cleanup the temporary parser context. */
|
| if (res != 0)
|
| pctxt->err = res;
|
| pctxt->nberrors += newpctxt->nberrors;
|
| pctxt->counter = newpctxt->counter;
|
| - newpctxt->constructor = NULL;
|
| + newpctxt->constructor = NULL;
|
| /* Free the parser context. */
|
| xmlSchemaFreeParserCtxt(newpctxt);
|
| return(res);
|
| @@ -10217,11 +10217,11 @@ xmlSchemaSchemaRelationAddChild(xmlSchemaBucketPtr bucket,
|
| static const xmlChar *
|
| xmlSchemaBuildAbsoluteURI(xmlDictPtr dict, const xmlChar* location,
|
| xmlNodePtr ctxtNode)
|
| -{
|
| +{
|
| /*
|
| * Build an absolue location URI.
|
| */
|
| - if (location != NULL) {
|
| + if (location != NULL) {
|
| if (ctxtNode == NULL)
|
| return(location);
|
| else {
|
| @@ -10244,7 +10244,7 @@ xmlSchemaBuildAbsoluteURI(xmlDictPtr dict, const xmlChar* location,
|
| }
|
| return(NULL);
|
| }
|
| -
|
| +
|
|
|
|
|
| /**
|
| @@ -10267,8 +10267,8 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
|
| const char *schemaBuffer,
|
| int schemaBufferLen,
|
| xmlNodePtr invokingNode,
|
| - const xmlChar *sourceTargetNamespace,
|
| - const xmlChar *importNamespace,
|
| + const xmlChar *sourceTargetNamespace,
|
| + const xmlChar *importNamespace,
|
| xmlSchemaBucketPtr *bucket)
|
| {
|
| const xmlChar *targetNamespace = NULL;
|
| @@ -10279,7 +10279,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
|
|
|
| if (bucket != NULL)
|
| *bucket = NULL;
|
| -
|
| +
|
| switch (type) {
|
| case XML_SCHEMA_SCHEMA_IMPORT:
|
| case XML_SCHEMA_SCHEMA_MAIN:
|
| @@ -10291,23 +10291,23 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
|
| case XML_SCHEMA_SCHEMA_REDEFINE:
|
| err = XML_SCHEMAP_SRC_REDEFINE;
|
| break;
|
| - }
|
| -
|
| + }
|
| +
|
|
|
| /* Special handling for the main schema:
|
| * skip the location and relation logic and just parse the doc.
|
| * We need just a bucket to be returned in this case.
|
| - */
|
| + */
|
| if ((type == XML_SCHEMA_SCHEMA_MAIN) || (! WXS_HAS_BUCKETS(pctxt)))
|
| - goto doc_load;
|
| + goto doc_load;
|
|
|
| - /* Note that we expect the location to be an absulute URI. */
|
| + /* Note that we expect the location to be an absulute URI. */
|
| if (schemaLocation != NULL) {
|
| bkt = xmlSchemaGetSchemaBucket(pctxt, schemaLocation);
|
| if ((bkt != NULL) &&
|
| (pctxt->constructor->bucket == bkt)) {
|
| /* Report self-imports/inclusions/redefinitions. */
|
| -
|
| +
|
| xmlSchemaCustomErr(ACTXT_CAST pctxt, err,
|
| invokingNode, NULL,
|
| "The schema must not import/include/redefine itself",
|
| @@ -10320,7 +10320,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
|
| */
|
| relation = xmlSchemaSchemaRelationCreate();
|
| if (relation == NULL)
|
| - return(-1);
|
| + return(-1);
|
| xmlSchemaSchemaRelationAddChild(pctxt->constructor->bucket,
|
| relation);
|
| relation->type = type;
|
| @@ -10329,7 +10329,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
|
| * Save the namespace import information.
|
| */
|
| if (WXS_IS_BUCKET_IMPMAIN(type)) {
|
| - relation->importNamespace = importNamespace;
|
| + relation->importNamespace = importNamespace;
|
| if (schemaLocation == NULL) {
|
| /*
|
| * No location; this is just an import of the namespace.
|
| @@ -10342,36 +10342,48 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
|
| }
|
|
|
| /* Did we already fetch the doc? */
|
| - if (bkt != NULL) {
|
| - /* TODO: The following nasty cases will produce an error. */
|
| + if (bkt != NULL) {
|
| if ((WXS_IS_BUCKET_IMPMAIN(type)) && (! bkt->imported)) {
|
| - /* We included/redefined and then try to import a schema. */
|
| + /*
|
| + * We included/redefined and then try to import a schema,
|
| + * but the new location provided for import was different.
|
| + */
|
| if (schemaLocation == NULL)
|
| schemaLocation = BAD_CAST "in_memory_buffer";
|
| - xmlSchemaCustomErr(ACTXT_CAST pctxt, err,
|
| - invokingNode, NULL,
|
| - "The schema document '%s' cannot be imported, since "
|
| - "it was already included or redefined",
|
| - schemaLocation, NULL);
|
| - goto exit;
|
| + if (!xmlStrEqual(schemaLocation,
|
| + bkt->schemaLocation)) {
|
| + xmlSchemaCustomErr(ACTXT_CAST pctxt, err,
|
| + invokingNode, NULL,
|
| + "The schema document '%s' cannot be imported, since "
|
| + "it was already included or redefined",
|
| + schemaLocation, NULL);
|
| + goto exit;
|
| + }
|
| } else if ((! WXS_IS_BUCKET_IMPMAIN(type)) && (bkt->imported)) {
|
| - /* We imported and then try to include/redefine a schema. */
|
| + /*
|
| + * We imported and then try to include/redefine a schema,
|
| + * but the new location provided for the include/redefine
|
| + * was different.
|
| + */
|
| if (schemaLocation == NULL)
|
| schemaLocation = BAD_CAST "in_memory_buffer";
|
| - xmlSchemaCustomErr(ACTXT_CAST pctxt, err,
|
| - invokingNode, NULL,
|
| - "The schema document '%s' cannot be included or "
|
| - "redefined, since it was already imported",
|
| - schemaLocation, NULL);
|
| - goto exit;
|
| - }
|
| + if (!xmlStrEqual(schemaLocation,
|
| + bkt->schemaLocation)) {
|
| + xmlSchemaCustomErr(ACTXT_CAST pctxt, err,
|
| + invokingNode, NULL,
|
| + "The schema document '%s' cannot be included or "
|
| + "redefined, since it was already imported",
|
| + schemaLocation, NULL);
|
| + goto exit;
|
| + }
|
| + }
|
| }
|
| -
|
| +
|
| if (WXS_IS_BUCKET_IMPMAIN(type)) {
|
| /*
|
| * Given that the schemaLocation [attribute] is only a hint, it is open
|
| * to applications to ignore all but the first <import> for a given
|
| - * namespace, regardless of the ·actual value· of schemaLocation, but
|
| + * namespace, regardless of the �actual value� of schemaLocation, but
|
| * such a strategy risks missing useful information when new
|
| * schemaLocations are offered.
|
| *
|
| @@ -10387,7 +10399,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
|
| * 5 Attempt to resolve the namespace name to locate such a resource.
|
| *
|
| * NOTE: (3) and (5) are not supported.
|
| - */
|
| + */
|
| if (bkt != NULL) {
|
| relation->bucket = bkt;
|
| goto exit;
|
| @@ -10395,7 +10407,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
|
| bkt = xmlSchemaGetSchemaBucketByTNS(pctxt,
|
| importNamespace, 1);
|
|
|
| - if (bkt != NULL) {
|
| + if (bkt != NULL) {
|
| relation->bucket = bkt;
|
| if (bkt->schemaLocation == NULL) {
|
| /* First given location of the schema; load the doc. */
|
| @@ -10421,19 +10433,19 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
|
| }
|
| goto exit;
|
| }
|
| - }
|
| - /*
|
| + }
|
| + /*
|
| * No bucket + first location: load the doc and create a
|
| * bucket.
|
| */
|
| } else {
|
| /* <include> and <redefine> */
|
| if (bkt != NULL) {
|
| -
|
| +
|
| if ((bkt->origTargetNamespace == NULL) &&
|
| (bkt->targetNamespace != sourceTargetNamespace)) {
|
| xmlSchemaBucketPtr chamel;
|
| -
|
| +
|
| /*
|
| * Chameleon include/redefine: skip loading only if it was
|
| * aleady build for the targetNamespace of the including
|
| @@ -10458,7 +10470,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
|
| relation->bucket = chamel;
|
| goto exit;
|
| }
|
| - /*
|
| + /*
|
| * We need to parse the chameleon again for a different
|
| * targetNamespace.
|
| * CHAMELEON TODO: Optimize this by only parsing the
|
| @@ -10469,7 +10481,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
|
| } else {
|
| relation->bucket = bkt;
|
| goto exit;
|
| - }
|
| + }
|
| }
|
| }
|
| if ((bkt != NULL) && (bkt->doc != NULL)) {
|
| @@ -10519,9 +10531,9 @@ doc_load:
|
| /* Parse from memory buffer. */
|
| doc = xmlCtxtReadMemory(parserCtxt, schemaBuffer, schemaBufferLen,
|
| NULL, NULL, SCHEMAS_PARSE_OPTIONS);
|
| - schemaLocation = xmlStrdup(BAD_CAST "in_memory_buffer");
|
| + schemaLocation = BAD_CAST "in_memory_buffer";
|
| if (doc != NULL)
|
| - doc->URL = schemaLocation;
|
| + doc->URL = xmlStrdup(schemaLocation);
|
| }
|
| /*
|
| * For <import>:
|
| @@ -10575,11 +10587,11 @@ doc_load:
|
| if (doc != NULL) {
|
| xmlNodePtr docElem = NULL;
|
|
|
| - located = 1;
|
| + located = 1;
|
| docElem = xmlDocGetRootElement(doc);
|
| if (docElem == NULL) {
|
| xmlSchemaCustomErr(ACTXT_CAST pctxt, XML_SCHEMAP_NOROOT,
|
| - invokingNode, NULL,
|
| + invokingNode, NULL,
|
| "The document '%s' has no document element",
|
| schemaLocation, NULL);
|
| goto exit_error;
|
| @@ -10598,14 +10610,14 @@ doc_load:
|
| schemaLocation, NULL);
|
| goto exit_error;
|
| }
|
| - /*
|
| + /*
|
| * Note that we don't apply a type check for the
|
| * targetNamespace value here.
|
| */
|
| targetNamespace = xmlSchemaGetProp(pctxt, docElem,
|
| "targetNamespace");
|
| }
|
| -
|
| +
|
| /* after_doc_loading: */
|
| if ((bkt == NULL) && located) {
|
| /* Only create a bucket if the schema was located. */
|
| @@ -10632,14 +10644,14 @@ doc_load:
|
| if (relation != NULL)
|
| relation->bucket = bkt;
|
| }
|
| -
|
| +
|
| exit:
|
| /*
|
| * Return the bucket explicitely; this is needed for the
|
| * main schema.
|
| */
|
| if (bucket != NULL)
|
| - *bucket = bkt;
|
| + *bucket = bkt;
|
| return (0);
|
|
|
| exit_error:
|
| @@ -10655,7 +10667,7 @@ exit_failure:
|
| xmlFreeDoc(doc);
|
| if (bkt != NULL)
|
| bkt->doc = NULL;
|
| - }
|
| + }
|
| return (-1);
|
| }
|
|
|
| @@ -10755,8 +10767,8 @@ xmlSchemaParseImport(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema,
|
| thisTargetNamespace = WXS_BUCKET(pctxt)->origTargetNamespace;
|
| if (namespaceName != NULL) {
|
| /*
|
| - * 1.1 If the namespace [attribute] is present, then its ·actual value·
|
| - * must not match the ·actual value· of the enclosing <schema>'s
|
| + * 1.1 If the namespace [attribute] is present, then its �actual value�
|
| + * must not match the �actual value� of the enclosing <schema>'s
|
| * targetNamespace [attribute].
|
| */
|
| if (xmlStrEqual(thisTargetNamespace, namespaceName)) {
|
| @@ -10810,11 +10822,11 @@ xmlSchemaParseImport(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema,
|
| "Failed to locate a schema at location '%s'. "
|
| "Skipping the import", schemaLocation, NULL, NULL);
|
| }
|
| -
|
| - if ((bucket != NULL) && CAN_PARSE_SCHEMA(bucket)) {
|
| +
|
| + if ((bucket != NULL) && CAN_PARSE_SCHEMA(bucket)) {
|
| ret = xmlSchemaParseNewDoc(pctxt, schema, bucket);
|
| }
|
| -
|
| +
|
| return (ret);
|
| }
|
|
|
| @@ -10896,7 +10908,7 @@ xmlSchemaParseIncludeOrRedefineAttrs(xmlSchemaParserCtxtPtr pctxt,
|
| XML_SCHEMAP_SRC_REDEFINE,
|
| NULL, node,
|
| "The schema document '%s' cannot redefine itself.",
|
| - *schemaLocation);
|
| + *schemaLocation);
|
| } else {
|
| xmlSchemaPCustomErr(pctxt,
|
| XML_SCHEMAP_SRC_INCLUDE,
|
| @@ -10906,7 +10918,7 @@ xmlSchemaParseIncludeOrRedefineAttrs(xmlSchemaParserCtxtPtr pctxt,
|
| }
|
| goto exit_error;
|
| }
|
| -
|
| +
|
| return(0);
|
| exit_error:
|
| return(pctxt->err);
|
| @@ -10936,19 +10948,19 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
|
| res = xmlSchemaParseIncludeOrRedefineAttrs(pctxt, schema,
|
| node, (xmlChar **) (&schemaLocation), type);
|
| if (res != 0)
|
| - return(res);
|
| + return(res);
|
| /*
|
| * Load and add the schema document.
|
| */
|
| res = xmlSchemaAddSchemaDoc(pctxt, type, schemaLocation, NULL,
|
| NULL, 0, node, pctxt->targetNamespace, NULL, &bucket);
|
| if (res != 0)
|
| - return(res);
|
| + return(res);
|
| /*
|
| * If we get no schema bucket back, then this means that the schema
|
| * document could not be located or was broken XML or was not
|
| * a schema document.
|
| - */
|
| + */
|
| if ((bucket == NULL) || (bucket->doc == NULL)) {
|
| if (type == XML_SCHEMA_SCHEMA_INCLUDE) {
|
| /*
|
| @@ -10957,7 +10969,7 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
|
| * for inclusions, since the that was the feedback from the
|
| * schema people. I.e. the following spec piece will *not* be
|
| * satisfied:
|
| - * SPEC src-include: "It is not an error for the ·actual value· of the
|
| + * SPEC src-include: "It is not an error for the �actual value� of the
|
| * schemaLocation [attribute] to fail to resolve it all, in which
|
| * case no corresponding inclusion is performed.
|
| * So do we need a warning report here?"
|
| @@ -10974,7 +10986,7 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
|
| *
|
| * SPEC src-redefine (1)
|
| * "If there are any element information items among the [children]
|
| - * other than <annotation> then the ·actual value· of the
|
| + * other than <annotation> then the �actual value� of the
|
| * schemaLocation [attribute] must successfully resolve."
|
| * TODO: Ask the WG if a the location has always to resolve
|
| * here as well!
|
| @@ -10990,13 +11002,13 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
|
| * Check targetNamespace sanity before parsing the new schema.
|
| * TODO: Note that we won't check further content if the
|
| * targetNamespace was bad.
|
| - */
|
| - if (bucket->origTargetNamespace != NULL) {
|
| + */
|
| + if (bucket->origTargetNamespace != NULL) {
|
| /*
|
| * SPEC src-include (2.1)
|
| - * "SII has a targetNamespace [attribute], and its ·actual
|
| - * value· is identical to the ·actual value· of the targetNamespace
|
| - * [attribute] of SII (which must have such an [attribute])."
|
| + * "SII has a targetNamespace [attribute], and its �actual
|
| + * value� is identical to the �actual value� of the targetNamespace
|
| + * [attribute] of SII� (which must have such an [attribute])."
|
| */
|
| if (pctxt->targetNamespace == NULL) {
|
| xmlSchemaCustomErr(ACTXT_CAST pctxt,
|
| @@ -11020,28 +11032,29 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
|
| pctxt->targetNamespace);
|
| goto exit_error;
|
| }
|
| - } else if (pctxt->targetNamespace != NULL) {
|
| + } else if (pctxt->targetNamespace != NULL) {
|
| /*
|
| * Chameleons: the original target namespace will
|
| * differ from the resulting namespace.
|
| */
|
| isChameleon = 1;
|
| if (bucket->parsed &&
|
| - (bucket->targetNamespace != pctxt->targetNamespace)) {
|
| - /*
|
| - * This is a sanity check, I dunno yet if this can happen.
|
| - */
|
| - PERROR_INT("xmlSchemaParseIncludeOrRedefine",
|
| - "trying to use an already parsed schema for a "
|
| - "different targetNamespace");
|
| - return(-1);
|
| + bucket->origTargetNamespace != NULL) {
|
| + xmlSchemaCustomErr(ACTXT_CAST pctxt,
|
| + XML_SCHEMAP_SRC_INCLUDE,
|
| + node, NULL,
|
| + "The target namespace of the included/redefined schema "
|
| + "'%s' has to be absent or the same as the "
|
| + "including/redefining schema's target namespace",
|
| + schemaLocation, NULL);
|
| + goto exit_error;
|
| }
|
| bucket->targetNamespace = pctxt->targetNamespace;
|
| }
|
| - }
|
| + }
|
| /*
|
| * Parse the schema.
|
| - */
|
| + */
|
| if (bucket && (!bucket->parsed) && (bucket->doc != NULL)) {
|
| if (isChameleon) {
|
| /* TODO: Get rid of this flag on the schema itself. */
|
| @@ -11058,8 +11071,8 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
|
| /*
|
| * And now for the children...
|
| */
|
| - child = node->children;
|
| - if (type == XML_SCHEMA_SCHEMA_REDEFINE) {
|
| + child = node->children;
|
| + if (type == XML_SCHEMA_SCHEMA_REDEFINE) {
|
| /*
|
| * Parse (simpleType | complexType | group | attributeGroup))*
|
| */
|
| @@ -11082,7 +11095,7 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
|
| } else if (IS_SCHEMA(child, "complexType")) {
|
| xmlSchemaParseComplexType(pctxt, schema, child, 1);
|
| /* hasRedefinitions = 1; */
|
| - } else if (IS_SCHEMA(child, "group")) {
|
| + } else if (IS_SCHEMA(child, "group")) {
|
| /* hasRedefinitions = 1; */
|
| xmlSchemaParseModelGroupDefinition(pctxt,
|
| schema, child);
|
| @@ -11102,7 +11115,7 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
|
| */
|
| child = child->next;
|
| }
|
| - }
|
| + }
|
| if (child != NULL) {
|
| res = XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED;
|
| if (type == XML_SCHEMA_SCHEMA_REDEFINE) {
|
| @@ -11113,8 +11126,8 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
|
| xmlSchemaPContentErr(pctxt, res,
|
| NULL, node, child, NULL,
|
| "(annotation?)");
|
| - }
|
| - }
|
| + }
|
| + }
|
| return(res);
|
|
|
| exit_error:
|
| @@ -11164,7 +11177,7 @@ xmlSchemaParseInclude(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema,
|
| * Redefinition Constraints and Semantics (src-redefine)
|
| * (6.1), (6.1.1), (6.1.2)
|
| *
|
| - * Schema Component Constraint:
|
| + * Schema Component Constraint:
|
| * All Group Limited (cos-all-limited) (2)
|
| * TODO: Actually this should go to component-level checks,
|
| * but is done here due to performance. Move it to an other layer
|
| @@ -11343,8 +11356,8 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| /*
|
| * SPEC src-redefine:
|
| * (6.1) "If it has a <group> among its contents at
|
| - * some level the ·actual value· of whose ref
|
| - * [attribute] is the same as the ·actual value· of
|
| + * some level the �actual value� of whose ref
|
| + * [attribute] is the same as the �actual value� of
|
| * its own name attribute plus target namespace, then
|
| * all of the following must be true:"
|
| * (6.1.1) "It must have exactly one such group."
|
| @@ -11369,9 +11382,9 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| xmlChar *str = NULL;
|
| /*
|
| * SPEC src-redefine:
|
| - * (6.1.2) "The ·actual value· of both that
|
| + * (6.1.2) "The �actual value� of both that
|
| * group's minOccurs and maxOccurs [attribute]
|
| - * must be 1 (or ·absent·).
|
| + * must be 1 (or �absent�).
|
| */
|
| xmlSchemaCustomErr(ACTXT_CAST ctxt,
|
| XML_SCHEMAP_SRC_REDEFINE, child, NULL,
|
| @@ -11388,7 +11401,7 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| }
|
| ctxt->redef->reference = WXS_BASIC_CAST part;
|
| ctxt->redefCounter++;
|
| - }
|
| + }
|
| }
|
| } else if (IS_SCHEMA(child, "any")) {
|
| part = (xmlSchemaTreeItemPtr)
|
| @@ -11425,7 +11438,7 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| WXS_ADD_PENDING(ctxt, item);
|
| }
|
| if (withParticle)
|
| - return ((xmlSchemaTreeItemPtr) particle);
|
| + return ((xmlSchemaTreeItemPtr) particle);
|
| else
|
| return ((xmlSchemaTreeItemPtr) item);
|
| }
|
| @@ -11477,7 +11490,7 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| */
|
| xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
|
| /*
|
| - * Attribute
|
| + * Attribute
|
| */
|
| /*
|
| * Extract the base type. The "base" attribute is mandatory if inside
|
| @@ -11485,8 +11498,8 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| *
|
| * SPEC (1.2) "...otherwise (<restriction> has no <simpleType> "
|
| * among its [children]), the simple type definition which is
|
| - * the {content type} of the type definition ·resolved· to by
|
| - * the ·actual value· of the base [attribute]"
|
| + * the {content type} of the type definition �resolved� to by
|
| + * the �actual value� of the base [attribute]"
|
| */
|
| if (xmlSchemaPValAttrQName(ctxt, schema, NULL, node, "base",
|
| &(type->baseNs), &(type->base)) == 0)
|
| @@ -11509,8 +11522,8 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| /*
|
| * REDEFINE: SPEC src-redefine (5)
|
| * "Within the [children], each <simpleType> must have a
|
| - * <restriction> among its [children] ... the ·actual value· of
|
| - * whose base [attribute] must be the same as the ·actual value·
|
| + * <restriction> among its [children] ... the �actual value� of
|
| + * whose base [attribute] must be the same as the �actual value�
|
| * of its own name attribute plus target namespace;"
|
| */
|
| xmlSchemaPCustomErrExt(ctxt, XML_SCHEMAP_SRC_REDEFINE,
|
| @@ -11526,7 +11539,7 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| type->base = NULL;
|
| type->baseNs = NULL;
|
| }
|
| - }
|
| + }
|
| }
|
| /*
|
| * And now for the children...
|
| @@ -11593,7 +11606,7 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| /*
|
| * Model group reference <group>.
|
| */
|
| - } else if (IS_SCHEMA(child, "group")) {
|
| + } else if (IS_SCHEMA(child, "group")) {
|
| type->subtypes = (xmlSchemaTypePtr)
|
| xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
|
| /*
|
| @@ -11931,13 +11944,13 @@ xmlSchemaParseSimpleContent(xmlSchemaParserCtxtPtr ctxt,
|
| xmlSchemaPContentErr(ctxt,
|
| XML_SCHEMAP_S4S_ELEM_MISSING,
|
| NULL, node, NULL, NULL,
|
| - "(annotation?, (restriction | extension))");
|
| + "(annotation?, (restriction | extension))");
|
| }
|
| if (child == NULL) {
|
| xmlSchemaPContentErr(ctxt,
|
| XML_SCHEMAP_S4S_ELEM_MISSING,
|
| NULL, node, NULL, NULL,
|
| - "(annotation?, (restriction | extension))");
|
| + "(annotation?, (restriction | extension))");
|
| }
|
| if (IS_SCHEMA(child, "restriction")) {
|
| xmlSchemaParseRestriction(ctxt, schema, child,
|
| @@ -12094,7 +12107,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| } else if (xmlSchemaPValAttrNode(ctxt, NULL, attr,
|
| xmlSchemaGetBuiltInType(XML_SCHEMAS_NCNAME), &name) != 0) {
|
| return (NULL);
|
| - }
|
| + }
|
| }
|
|
|
| if (topLevel == 0) {
|
| @@ -12183,7 +12196,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| NULL, (xmlNodePtr) attr, NULL,
|
| "(#all | List of (extension | restriction))",
|
| attrValue, NULL, NULL, NULL);
|
| - } else
|
| + } else
|
| final = 1;
|
| } else if (xmlStrEqual(attr->name, BAD_CAST "block")) {
|
| /*
|
| @@ -12201,7 +12214,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| NULL, (xmlNodePtr) attr, NULL,
|
| "(#all | List of (extension | restriction)) ",
|
| attrValue, NULL, NULL, NULL);
|
| - } else
|
| + } else
|
| block = 1;
|
| } else {
|
| xmlSchemaPIllegalAttrErr(ctxt,
|
| @@ -12212,7 +12225,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr);
|
| }
|
| } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) {
|
| - xmlSchemaPIllegalAttrErr(ctxt,
|
| + xmlSchemaPIllegalAttrErr(ctxt,
|
| XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr);
|
| }
|
| attr = attr->next;
|
| @@ -12271,7 +12284,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
| * SPEC
|
| * "...the third alternative (neither <simpleContent> nor
|
| * <complexContent>) is chosen. This case is understood as shorthand
|
| - * for complex content restricting the ·ur-type definition·, and the
|
| + * for complex content restricting the �ur-type definition�, and the
|
| * details of the mappings should be modified as necessary.
|
| */
|
| type->baseType = xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYTYPE);
|
| @@ -12448,7 +12461,7 @@ xmlSchemaNewMemParserCtxt(const char *buffer, int size)
|
| return(NULL);
|
| ret->buffer = buffer;
|
| ret->size = size;
|
| - ret->dict = xmlDictCreate();
|
| + ret->dict = xmlDictCreate();
|
| return (ret);
|
| }
|
|
|
| @@ -12491,7 +12504,7 @@ xmlSchemaFreeParserCtxt(xmlSchemaParserCtxtPtr ctxt)
|
| if (ctxt == NULL)
|
| return;
|
| if (ctxt->doc != NULL && !ctxt->preserve)
|
| - xmlFreeDoc(ctxt->doc);
|
| + xmlFreeDoc(ctxt->doc);
|
| if (ctxt->vctxt != NULL) {
|
| xmlSchemaFreeValidCtxt(ctxt->vctxt);
|
| }
|
| @@ -12512,7 +12525,12 @@ xmlSchemaFreeParserCtxt(xmlSchemaParserCtxtPtr ctxt)
|
| * *
|
| ************************************************************************/
|
|
|
| -static void
|
| +/**
|
| + * xmlSchemaBuildContentModelForSubstGroup:
|
| + *
|
| + * Returns 1 if nillable, 0 otherwise
|
| + */
|
| +static int
|
| xmlSchemaBuildContentModelForSubstGroup(xmlSchemaParserCtxtPtr pctxt,
|
| xmlSchemaParticlePtr particle, int counter, xmlAutomataStatePtr end)
|
| {
|
| @@ -12520,6 +12538,7 @@ xmlSchemaBuildContentModelForSubstGroup(xmlSchemaParserCtxtPtr pctxt,
|
| xmlSchemaElementPtr elemDecl, member;
|
| xmlSchemaSubstGroupPtr substGroup;
|
| int i;
|
| + int ret = 0;
|
|
|
| elemDecl = (xmlSchemaElementPtr) particle->children;
|
| /*
|
| @@ -12535,7 +12554,7 @@ xmlSchemaBuildContentModelForSubstGroup(xmlSchemaParserCtxtPtr pctxt,
|
| "Internal error: xmlSchemaBuildContentModelForSubstGroup, "
|
| "declaration is marked having a subst. group but none "
|
| "available.\n", elemDecl->name, NULL);
|
| - return;
|
| + return(0);
|
| }
|
| if (counter >= 0) {
|
| /*
|
| @@ -12573,7 +12592,7 @@ xmlSchemaBuildContentModelForSubstGroup(xmlSchemaParserCtxtPtr pctxt,
|
| * was incorrectly used instead of xmlAutomataNewTransition2()
|
| * (seems like a copy&paste bug from the XML_SCHEMA_TYPE_ALL
|
| * section in xmlSchemaBuildAContentModel() ).
|
| - * TODO: Check if xmlAutomataNewOnceTrans2() was instead
|
| + * TODO: Check if xmlAutomataNewOnceTrans2() was instead
|
| * intended for the above "counter" section originally. I.e.,
|
| * check xs:all with subst-groups.
|
| *
|
| @@ -12582,7 +12601,7 @@ xmlSchemaBuildContentModelForSubstGroup(xmlSchemaParserCtxtPtr pctxt,
|
| * 1, 1, member);
|
| */
|
| tmp = xmlAutomataNewTransition2(pctxt->am, start, NULL,
|
| - member->name, member->targetNamespace, member);
|
| + member->name, member->targetNamespace, member);
|
| xmlAutomataNewEpsilon(pctxt->am, tmp, end);
|
| }
|
| } else {
|
| @@ -12615,21 +12634,31 @@ xmlSchemaBuildContentModelForSubstGroup(xmlSchemaParserCtxtPtr pctxt,
|
| xmlAutomataNewCountedTrans(pctxt->am, hop, start, counter);
|
| xmlAutomataNewCounterTrans(pctxt->am, hop, end, counter);
|
| }
|
| - if (particle->minOccurs == 0)
|
| + if (particle->minOccurs == 0) {
|
| xmlAutomataNewEpsilon(pctxt->am, start, end);
|
| + ret = 1;
|
| + }
|
| pctxt->state = end;
|
| + return(ret);
|
| }
|
|
|
| -static void
|
| +/**
|
| + * xmlSchemaBuildContentModelForElement:
|
| + *
|
| + * Returns 1 if nillable, 0 otherwise
|
| + */
|
| +static int
|
| xmlSchemaBuildContentModelForElement(xmlSchemaParserCtxtPtr ctxt,
|
| xmlSchemaParticlePtr particle)
|
| {
|
| + int ret = 0;
|
| +
|
| if (((xmlSchemaElementPtr) particle->children)->flags &
|
| XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD) {
|
| /*
|
| * Substitution groups.
|
| */
|
| - xmlSchemaBuildContentModelForSubstGroup(ctxt, particle, -1, NULL);
|
| + ret = xmlSchemaBuildContentModelForSubstGroup(ctxt, particle, -1, NULL);
|
| } else {
|
| xmlSchemaElementPtr elemDecl;
|
| xmlAutomataStatePtr start;
|
| @@ -12637,7 +12666,7 @@ xmlSchemaBuildContentModelForElement(xmlSchemaParserCtxtPtr ctxt,
|
| elemDecl = (xmlSchemaElementPtr) particle->children;
|
|
|
| if (elemDecl->flags & XML_SCHEMAS_ELEM_ABSTRACT)
|
| - return;
|
| + return(0);
|
| if (particle->maxOccurs == 1) {
|
| start = ctxt->state;
|
| ctxt->state = xmlAutomataNewTransition2(ctxt->am, start, NULL,
|
| @@ -12645,11 +12674,11 @@ xmlSchemaBuildContentModelForElement(xmlSchemaParserCtxtPtr ctxt,
|
| } else if ((particle->maxOccurs >= UNBOUNDED) &&
|
| (particle->minOccurs < 2)) {
|
| /* Special case. */
|
| - start = ctxt->state;
|
| + start = ctxt->state;
|
| ctxt->state = xmlAutomataNewTransition2(ctxt->am, start, NULL,
|
| - elemDecl->name, elemDecl->targetNamespace, elemDecl);
|
| + elemDecl->name, elemDecl->targetNamespace, elemDecl);
|
| ctxt->state = xmlAutomataNewTransition2(ctxt->am, ctxt->state, ctxt->state,
|
| - elemDecl->name, elemDecl->targetNamespace, elemDecl);
|
| + elemDecl->name, elemDecl->targetNamespace, elemDecl);
|
| } else {
|
| int counter;
|
| int maxOccurs = particle->maxOccurs == UNBOUNDED ?
|
| @@ -12665,9 +12694,12 @@ xmlSchemaBuildContentModelForElement(xmlSchemaParserCtxtPtr ctxt,
|
| ctxt->state = xmlAutomataNewCounterTrans(ctxt->am, ctxt->state,
|
| NULL, counter);
|
| }
|
| - if (particle->minOccurs == 0)
|
| + if (particle->minOccurs == 0) {
|
| xmlAutomataNewEpsilon(ctxt->am, start, ctxt->state);
|
| + ret = 1;
|
| + }
|
| }
|
| + return(ret);
|
| }
|
|
|
| /**
|
| @@ -12678,21 +12710,24 @@ xmlSchemaBuildContentModelForElement(xmlSchemaParserCtxtPtr ctxt,
|
| *
|
| * Create the automaton for the {content type} of a complex type.
|
| *
|
| + * Returns 1 if the content is nillable, 0 otherwise
|
| */
|
| -static void
|
| +static int
|
| xmlSchemaBuildAContentModel(xmlSchemaParserCtxtPtr pctxt,
|
| xmlSchemaParticlePtr particle)
|
| {
|
| + int ret = 0, tmp2;
|
| +
|
| if (particle == NULL) {
|
| - PERROR_INT("xmlSchemaBuildAContentModel", "particle is NULL");
|
| - return;
|
| + PERROR_INT("xmlSchemaBuildAContentModel", "particle is NULL");
|
| + return(1);
|
| }
|
| if (particle->children == NULL) {
|
| /*
|
| * Just return in this case. A missing "term" of the particle
|
| * might arise due to an invalid "term" component.
|
| */
|
| - return;
|
| + return(1);
|
| }
|
|
|
| switch (particle->children->type) {
|
| @@ -12744,7 +12779,8 @@ xmlSchemaBuildAContentModel(xmlSchemaParserCtxtPtr pctxt,
|
| int counter;
|
| xmlAutomataStatePtr hop;
|
| int maxOccurs =
|
| - particle->maxOccurs == UNBOUNDED ? UNBOUNDED : particle->maxOccurs - 1;
|
| + particle->maxOccurs == UNBOUNDED ? UNBOUNDED :
|
| + particle->maxOccurs - 1;
|
| int minOccurs =
|
| particle->minOccurs < 1 ? 0 : particle->minOccurs - 1;
|
|
|
| @@ -12779,243 +12815,273 @@ xmlSchemaBuildAContentModel(xmlSchemaParserCtxtPtr pctxt,
|
| }
|
| if (particle->minOccurs == 0) {
|
| xmlAutomataNewEpsilon(pctxt->am, start, end);
|
| + ret = 1;
|
| }
|
| pctxt->state = end;
|
| break;
|
| }
|
| case XML_SCHEMA_TYPE_ELEMENT:
|
| - xmlSchemaBuildContentModelForElement(pctxt, particle);
|
| + ret = xmlSchemaBuildContentModelForElement(pctxt, particle);
|
| break;
|
| case XML_SCHEMA_TYPE_SEQUENCE:{
|
| - xmlSchemaTreeItemPtr sub;
|
| + xmlSchemaTreeItemPtr sub;
|
|
|
| - /*
|
| - * If max and min occurances are default (1) then
|
| - * simply iterate over the particles of the <sequence>.
|
| - */
|
| - if ((particle->minOccurs == 1) && (particle->maxOccurs == 1)) {
|
| - sub = particle->children->children;
|
| - while (sub != NULL) {
|
| - xmlSchemaBuildAContentModel(pctxt,
|
| - (xmlSchemaParticlePtr) sub);
|
| - sub = sub->next;
|
| - }
|
| - } else {
|
| - xmlAutomataStatePtr oldstate = pctxt->state;
|
| -
|
| - if (particle->maxOccurs >= UNBOUNDED) {
|
| - if (particle->minOccurs > 1) {
|
| - xmlAutomataStatePtr tmp;
|
| - int counter;
|
| + ret = 1;
|
| + /*
|
| + * If max and min occurances are default (1) then
|
| + * simply iterate over the particles of the <sequence>.
|
| + */
|
| + if ((particle->minOccurs == 1) && (particle->maxOccurs == 1)) {
|
| + sub = particle->children->children;
|
|
|
| - pctxt->state = xmlAutomataNewEpsilon(pctxt->am,
|
| - oldstate, NULL);
|
| - oldstate = pctxt->state;
|
| -
|
| - counter = xmlAutomataNewCounter(pctxt->am,
|
| - particle->minOccurs - 1, UNBOUNDED);
|
| + while (sub != NULL) {
|
| + tmp2 = xmlSchemaBuildAContentModel(pctxt,
|
| + (xmlSchemaParticlePtr) sub);
|
| + if (tmp2 != 1) ret = 0;
|
| + sub = sub->next;
|
| + }
|
| + } else {
|
| + xmlAutomataStatePtr oldstate = pctxt->state;
|
|
|
| - sub = particle->children->children;
|
| - while (sub != NULL) {
|
| - xmlSchemaBuildAContentModel(pctxt,
|
| - (xmlSchemaParticlePtr) sub);
|
| - sub = sub->next;
|
| - }
|
| - tmp = pctxt->state;
|
| - xmlAutomataNewCountedTrans(pctxt->am, tmp,
|
| - oldstate, counter);
|
| - pctxt->state =
|
| - xmlAutomataNewCounterTrans(pctxt->am, tmp,
|
| - NULL, counter);
|
| -
|
| - } else {
|
| - pctxt->state = xmlAutomataNewEpsilon(pctxt->am,
|
| - oldstate, NULL);
|
| - oldstate = pctxt->state;
|
| -
|
| - sub = particle->children->children;
|
| - while (sub != NULL) {
|
| - xmlSchemaBuildAContentModel(pctxt,
|
| - (xmlSchemaParticlePtr) sub);
|
| - sub = sub->next;
|
| - }
|
| - xmlAutomataNewEpsilon(pctxt->am, pctxt->state,
|
| - oldstate);
|
| - /*
|
| - * epsilon needed to block previous trans from
|
| - * being allowed to enter back from another
|
| - * construct
|
| - */
|
| - pctxt->state = xmlAutomataNewEpsilon(pctxt->am,
|
| - pctxt->state, NULL);
|
| - if (particle->minOccurs == 0) {
|
| - xmlAutomataNewEpsilon(pctxt->am,
|
| - oldstate, pctxt->state);
|
| - }
|
| - }
|
| - } else if ((particle->maxOccurs > 1)
|
| - || (particle->minOccurs > 1)) {
|
| + if (particle->maxOccurs >= UNBOUNDED) {
|
| + if (particle->minOccurs > 1) {
|
| xmlAutomataStatePtr tmp;
|
| int counter;
|
|
|
| pctxt->state = xmlAutomataNewEpsilon(pctxt->am,
|
| - oldstate, NULL);
|
| + oldstate, NULL);
|
| oldstate = pctxt->state;
|
|
|
| counter = xmlAutomataNewCounter(pctxt->am,
|
| - particle->minOccurs - 1,
|
| - particle->maxOccurs - 1);
|
| + particle->minOccurs - 1, UNBOUNDED);
|
|
|
| sub = particle->children->children;
|
| while (sub != NULL) {
|
| - xmlSchemaBuildAContentModel(pctxt,
|
| - (xmlSchemaParticlePtr) sub);
|
| + tmp2 = xmlSchemaBuildAContentModel(pctxt,
|
| + (xmlSchemaParticlePtr) sub);
|
| + if (tmp2 != 1) ret = 0;
|
| sub = sub->next;
|
| }
|
| tmp = pctxt->state;
|
| - xmlAutomataNewCountedTrans(pctxt->am,
|
| - tmp, oldstate, counter);
|
| + xmlAutomataNewCountedTrans(pctxt->am, tmp,
|
| + oldstate, counter);
|
| pctxt->state =
|
| - xmlAutomataNewCounterTrans(pctxt->am, tmp, NULL,
|
| - counter);
|
| - if (particle->minOccurs == 0) {
|
| + xmlAutomataNewCounterTrans(pctxt->am, tmp,
|
| + NULL, counter);
|
| + if (ret == 1)
|
| xmlAutomataNewEpsilon(pctxt->am,
|
| - oldstate, pctxt->state);
|
| - }
|
| + oldstate, pctxt->state);
|
| +
|
| } else {
|
| + pctxt->state = xmlAutomataNewEpsilon(pctxt->am,
|
| + oldstate, NULL);
|
| + oldstate = pctxt->state;
|
| +
|
| sub = particle->children->children;
|
| while (sub != NULL) {
|
| - xmlSchemaBuildAContentModel(pctxt,
|
| - (xmlSchemaParticlePtr) sub);
|
| + tmp2 = xmlSchemaBuildAContentModel(pctxt,
|
| + (xmlSchemaParticlePtr) sub);
|
| + if (tmp2 != 1) ret = 0;
|
| sub = sub->next;
|
| }
|
| + xmlAutomataNewEpsilon(pctxt->am, pctxt->state,
|
| + oldstate);
|
| + /*
|
| + * epsilon needed to block previous trans from
|
| + * being allowed to enter back from another
|
| + * construct
|
| + */
|
| + pctxt->state = xmlAutomataNewEpsilon(pctxt->am,
|
| + pctxt->state, NULL);
|
| if (particle->minOccurs == 0) {
|
| - xmlAutomataNewEpsilon(pctxt->am, oldstate,
|
| - pctxt->state);
|
| + xmlAutomataNewEpsilon(pctxt->am,
|
| + oldstate, pctxt->state);
|
| + ret = 1;
|
| }
|
| }
|
| - }
|
| - break;
|
| - }
|
| - case XML_SCHEMA_TYPE_CHOICE:{
|
| - xmlSchemaTreeItemPtr sub;
|
| - xmlAutomataStatePtr start, end;
|
| + } else if ((particle->maxOccurs > 1)
|
| + || (particle->minOccurs > 1)) {
|
| + xmlAutomataStatePtr tmp;
|
| + int counter;
|
|
|
| - start = pctxt->state;
|
| - end = xmlAutomataNewState(pctxt->am);
|
| + pctxt->state = xmlAutomataNewEpsilon(pctxt->am,
|
| + oldstate, NULL);
|
| + oldstate = pctxt->state;
|
|
|
| - /*
|
| - * iterate over the subtypes and remerge the end with an
|
| - * epsilon transition
|
| - */
|
| - if (particle->maxOccurs == 1) {
|
| - sub = particle->children->children;
|
| + counter = xmlAutomataNewCounter(pctxt->am,
|
| + particle->minOccurs - 1,
|
| + particle->maxOccurs - 1);
|
| +
|
| + sub = particle->children->children;
|
| while (sub != NULL) {
|
| - pctxt->state = start;
|
| - xmlSchemaBuildAContentModel(pctxt,
|
| - (xmlSchemaParticlePtr) sub);
|
| - xmlAutomataNewEpsilon(pctxt->am, pctxt->state, end);
|
| + tmp2 = xmlSchemaBuildAContentModel(pctxt,
|
| + (xmlSchemaParticlePtr) sub);
|
| + if (tmp2 != 1) ret = 0;
|
| sub = sub->next;
|
| }
|
| + tmp = pctxt->state;
|
| + xmlAutomataNewCountedTrans(pctxt->am,
|
| + tmp, oldstate, counter);
|
| + pctxt->state =
|
| + xmlAutomataNewCounterTrans(pctxt->am, tmp, NULL,
|
| + counter);
|
| + if ((particle->minOccurs == 0) || (ret == 1)) {
|
| + xmlAutomataNewEpsilon(pctxt->am,
|
| + oldstate, pctxt->state);
|
| + ret = 1;
|
| + }
|
| } else {
|
| - int counter;
|
| - xmlAutomataStatePtr hop, base;
|
| - int maxOccurs = particle->maxOccurs == UNBOUNDED ?
|
| - UNBOUNDED : particle->maxOccurs - 1;
|
| - int minOccurs =
|
| - particle->minOccurs < 1 ? 0 : particle->minOccurs - 1;
|
| -
|
| - /*
|
| - * use a counter to keep track of the number of transtions
|
| - * which went through the choice.
|
| - */
|
| - counter =
|
| - xmlAutomataNewCounter(pctxt->am, minOccurs, maxOccurs);
|
| - hop = xmlAutomataNewState(pctxt->am);
|
| - base = xmlAutomataNewState(pctxt->am);
|
| -
|
| - sub = particle->children->children;
|
| + sub = particle->children->children;
|
| while (sub != NULL) {
|
| - pctxt->state = base;
|
| - xmlSchemaBuildAContentModel(pctxt,
|
| - (xmlSchemaParticlePtr) sub);
|
| - xmlAutomataNewEpsilon(pctxt->am, pctxt->state, hop);
|
| + tmp2 = xmlSchemaBuildAContentModel(pctxt,
|
| + (xmlSchemaParticlePtr) sub);
|
| + if (tmp2 != 1) ret = 0;
|
| sub = sub->next;
|
| }
|
| - xmlAutomataNewEpsilon(pctxt->am, start, base);
|
| - xmlAutomataNewCountedTrans(pctxt->am, hop, base, counter);
|
| - xmlAutomataNewCounterTrans(pctxt->am, hop, end, counter);
|
| - }
|
| - if (particle->minOccurs == 0) {
|
| - xmlAutomataNewEpsilon(pctxt->am, start, end);
|
| + if (particle->minOccurs == 0) {
|
| + xmlAutomataNewEpsilon(pctxt->am, oldstate,
|
| + pctxt->state);
|
| + ret = 1;
|
| + }
|
| }
|
| - pctxt->state = end;
|
| - break;
|
| }
|
| - case XML_SCHEMA_TYPE_ALL:{
|
| - xmlAutomataStatePtr start;
|
| - xmlSchemaParticlePtr sub;
|
| - xmlSchemaElementPtr elemDecl;
|
| - int lax;
|
| -
|
| - sub = (xmlSchemaParticlePtr) particle->children->children;
|
| - if (sub == NULL)
|
| - break;
|
| - start = pctxt->state;
|
| + break;
|
| + }
|
| + case XML_SCHEMA_TYPE_CHOICE:{
|
| + xmlSchemaTreeItemPtr sub;
|
| + xmlAutomataStatePtr start, end;
|
| +
|
| + ret = 0;
|
| + start = pctxt->state;
|
| + end = xmlAutomataNewState(pctxt->am);
|
| +
|
| + /*
|
| + * iterate over the subtypes and remerge the end with an
|
| + * epsilon transition
|
| + */
|
| + if (particle->maxOccurs == 1) {
|
| + sub = particle->children->children;
|
| while (sub != NULL) {
|
| pctxt->state = start;
|
| + tmp2 = xmlSchemaBuildAContentModel(pctxt,
|
| + (xmlSchemaParticlePtr) sub);
|
| + if (tmp2 == 1) ret = 1;
|
| + xmlAutomataNewEpsilon(pctxt->am, pctxt->state, end);
|
| + sub = sub->next;
|
| + }
|
| + } else {
|
| + int counter;
|
| + xmlAutomataStatePtr hop, base;
|
| + int maxOccurs = particle->maxOccurs == UNBOUNDED ?
|
| + UNBOUNDED : particle->maxOccurs - 1;
|
| + int minOccurs =
|
| + particle->minOccurs < 1 ? 0 : particle->minOccurs - 1;
|
|
|
| - elemDecl = (xmlSchemaElementPtr) sub->children;
|
| - if (elemDecl == NULL) {
|
| - PERROR_INT("xmlSchemaBuildAContentModel",
|
| - "<element> particle has no term");
|
| - return;
|
| - };
|
| - /*
|
| - * NOTE: The {max occurs} of all the particles in the
|
| - * {particles} of the group must be 0 or 1; this is
|
| - * already ensured during the parse of the content of
|
| - * <all>.
|
| - */
|
| - if (elemDecl->flags & XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD) {
|
| - int counter;
|
| -
|
| - /*
|
| - * This is an abstract group, we need to share
|
| - * the same counter for all the element transitions
|
| - * derived from the group
|
| - */
|
| - counter = xmlAutomataNewCounter(pctxt->am,
|
| - sub->minOccurs, sub->maxOccurs);
|
| - xmlSchemaBuildContentModelForSubstGroup(pctxt,
|
| - sub, counter, pctxt->state);
|
| - } else {
|
| - if ((sub->minOccurs == 1) &&
|
| - (sub->maxOccurs == 1)) {
|
| - xmlAutomataNewOnceTrans2(pctxt->am, pctxt->state,
|
| - pctxt->state,
|
| - elemDecl->name,
|
| - elemDecl->targetNamespace,
|
| - 1, 1, elemDecl);
|
| - } else if ((sub->minOccurs == 0) &&
|
| - (sub->maxOccurs == 1)) {
|
| -
|
| - xmlAutomataNewCountTrans2(pctxt->am, pctxt->state,
|
| - pctxt->state,
|
| - elemDecl->name,
|
| - elemDecl->targetNamespace,
|
| - 0,
|
| - 1,
|
| - elemDecl);
|
| - }
|
| - }
|
| - sub = (xmlSchemaParticlePtr) sub->next;
|
| + /*
|
| + * use a counter to keep track of the number of transtions
|
| + * which went through the choice.
|
| + */
|
| + counter =
|
| + xmlAutomataNewCounter(pctxt->am, minOccurs, maxOccurs);
|
| + hop = xmlAutomataNewState(pctxt->am);
|
| + base = xmlAutomataNewState(pctxt->am);
|
| +
|
| + sub = particle->children->children;
|
| + while (sub != NULL) {
|
| + pctxt->state = base;
|
| + tmp2 = xmlSchemaBuildAContentModel(pctxt,
|
| + (xmlSchemaParticlePtr) sub);
|
| + if (tmp2 == 1) ret = 1;
|
| + xmlAutomataNewEpsilon(pctxt->am, pctxt->state, hop);
|
| + sub = sub->next;
|
| }
|
| - lax = particle->minOccurs == 0;
|
| - pctxt->state =
|
| - xmlAutomataNewAllTrans(pctxt->am, pctxt->state, NULL, lax);
|
| + xmlAutomataNewEpsilon(pctxt->am, start, base);
|
| + xmlAutomataNewCountedTrans(pctxt->am, hop, base, counter);
|
| + xmlAutomataNewCounterTrans(pctxt->am, hop, end, counter);
|
| + if (ret == 1)
|
| + xmlAutomataNewEpsilon(pctxt->am, base, end);
|
| + }
|
| + if (particle->minOccurs == 0) {
|
| + xmlAutomataNewEpsilon(pctxt->am, start, end);
|
| + ret = 1;
|
| + }
|
| + pctxt->state = end;
|
| + break;
|
| + }
|
| + case XML_SCHEMA_TYPE_ALL:{
|
| + xmlAutomataStatePtr start, tmp;
|
| + xmlSchemaParticlePtr sub;
|
| + xmlSchemaElementPtr elemDecl;
|
| +
|
| + ret = 1;
|
| +
|
| + sub = (xmlSchemaParticlePtr) particle->children->children;
|
| + if (sub == NULL)
|
| break;
|
| +
|
| + ret = 0;
|
| +
|
| + start = pctxt->state;
|
| + tmp = xmlAutomataNewState(pctxt->am);
|
| + xmlAutomataNewEpsilon(pctxt->am, pctxt->state, tmp);
|
| + pctxt->state = tmp;
|
| + while (sub != NULL) {
|
| + pctxt->state = tmp;
|
| +
|
| + elemDecl = (xmlSchemaElementPtr) sub->children;
|
| + if (elemDecl == NULL) {
|
| + PERROR_INT("xmlSchemaBuildAContentModel",
|
| + "<element> particle has no term");
|
| + return(ret);
|
| + };
|
| + /*
|
| + * NOTE: The {max occurs} of all the particles in the
|
| + * {particles} of the group must be 0 or 1; this is
|
| + * already ensured during the parse of the content of
|
| + * <all>.
|
| + */
|
| + if (elemDecl->flags & XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD) {
|
| + int counter;
|
| +
|
| + /*
|
| + * This is an abstract group, we need to share
|
| + * the same counter for all the element transitions
|
| + * derived from the group
|
| + */
|
| + counter = xmlAutomataNewCounter(pctxt->am,
|
| + sub->minOccurs, sub->maxOccurs);
|
| + xmlSchemaBuildContentModelForSubstGroup(pctxt,
|
| + sub, counter, pctxt->state);
|
| + } else {
|
| + if ((sub->minOccurs == 1) &&
|
| + (sub->maxOccurs == 1)) {
|
| + xmlAutomataNewOnceTrans2(pctxt->am, pctxt->state,
|
| + pctxt->state,
|
| + elemDecl->name,
|
| + elemDecl->targetNamespace,
|
| + 1, 1, elemDecl);
|
| + } else if ((sub->minOccurs == 0) &&
|
| + (sub->maxOccurs == 1)) {
|
| +
|
| + xmlAutomataNewCountTrans2(pctxt->am, pctxt->state,
|
| + pctxt->state,
|
| + elemDecl->name,
|
| + elemDecl->targetNamespace,
|
| + 0,
|
| + 1,
|
| + elemDecl);
|
| + }
|
| + }
|
| + sub = (xmlSchemaParticlePtr) sub->next;
|
| }
|
| + pctxt->state =
|
| + xmlAutomataNewAllTrans(pctxt->am, pctxt->state, NULL, 0);
|
| + if (particle->minOccurs == 0) {
|
| + xmlAutomataNewEpsilon(pctxt->am, start, pctxt->state);
|
| + ret = 1;
|
| + }
|
| + break;
|
| + }
|
| case XML_SCHEMA_TYPE_GROUP:
|
| /*
|
| * If we hit a model group definition, then this means that
|
| @@ -13024,14 +13090,16 @@ xmlSchemaBuildAContentModel(xmlSchemaParserCtxtPtr pctxt,
|
| * TODO: But the group should be substituted and not occur at
|
| * all in the content model at this point. Fix this.
|
| */
|
| + ret = 1;
|
| break;
|
| default:
|
| xmlSchemaInternalErr2(ACTXT_CAST pctxt,
|
| "xmlSchemaBuildAContentModel",
|
| "found unexpected term of type '%s' in content model",
|
| WXS_ITEM_TYPE_NAME(particle->children), NULL);
|
| - return;
|
| + return(ret);
|
| }
|
| + return(ret);
|
| }
|
|
|
| /**
|
| @@ -13115,8 +13183,8 @@ xmlSchemaResolveElementReferences(xmlSchemaElementPtr elemDecl,
|
| if ((elemDecl->subtypes == NULL) && (elemDecl->namedType != NULL)) {
|
| xmlSchemaTypePtr type;
|
|
|
| - /* (type definition) ... otherwise the type definition ·resolved·
|
| - * to by the ·actual value· of the type [attribute] ...
|
| + /* (type definition) ... otherwise the type definition �resolved�
|
| + * to by the �actual value� of the type [attribute] ...
|
| */
|
| type = xmlSchemaGetType(ctxt->schema, elemDecl->namedType,
|
| elemDecl->namedTypeNs);
|
| @@ -13154,7 +13222,7 @@ xmlSchemaResolveElementReferences(xmlSchemaElementPtr elemDecl,
|
| /*
|
| * The type definitions is set to:
|
| * SPEC "...the {type definition} of the element
|
| - * declaration ·resolved· to by the ·actual value·
|
| + * declaration �resolved� to by the �actual value�
|
| * of the substitutionGroup [attribute], if present"
|
| */
|
| if (elemDecl->subtypes == NULL)
|
| @@ -13192,8 +13260,8 @@ xmlSchemaResolveUnionMemberTypes(xmlSchemaParserCtxtPtr ctxt,
|
|
|
| /*
|
| * SPEC (1) "If the <union> alternative is chosen, then [Definition:]
|
| - * define the explicit members as the type definitions ·resolved·
|
| - * to by the items in the ·actual value· of the memberTypes [attribute],
|
| + * define the explicit members as the type definitions �resolved�
|
| + * to by the items in the �actual value� of the memberTypes [attribute],
|
| * if any, followed by the type definitions corresponding to the
|
| * <simpleType>s among the [children] of <union>, if any."
|
| */
|
| @@ -13306,7 +13374,6 @@ xmlSchemaIsUserDerivedFromBuiltInType(xmlSchemaTypePtr type, int valType)
|
|
|
| return (0);
|
| }
|
| -#endif
|
|
|
| static xmlSchemaTypePtr
|
| xmlSchemaQueryBuiltInType(xmlSchemaTypePtr type)
|
| @@ -13319,6 +13386,7 @@ xmlSchemaQueryBuiltInType(xmlSchemaTypePtr type)
|
| return(type);
|
| return(xmlSchemaQueryBuiltInType(type->subtypes));
|
| }
|
| +#endif
|
|
|
| /**
|
| * xmlSchemaGetPrimitiveType:
|
| @@ -13488,7 +13556,7 @@ xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
|
| return (0);
|
| }
|
| /*
|
| - * 3 If both O1 and O2 are sets of (namespace names or ·absent·),
|
| + * 3 If both O1 and O2 are sets of (namespace names or �absent�),
|
| * then the union of those sets must be the value.
|
| */
|
| if ((completeWild->nsSet != NULL) && (curWild->nsSet != NULL)) {
|
| @@ -13522,7 +13590,7 @@ xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
|
| }
|
| /*
|
| * 4 If the two are negations of different values (namespace names
|
| - * or ·absent·), then a pair of not and ·absent· must be the value.
|
| + * or �absent�), then a pair of not and �absent� must be the value.
|
| */
|
| if ((completeWild->negNsSet != NULL) &&
|
| (curWild->negNsSet != NULL) &&
|
| @@ -13564,7 +13632,7 @@ xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
|
| if (nsFound && absentFound) {
|
| /*
|
| * 5.1 If the set S includes both the negated namespace
|
| - * name and ·absent·, then any must be the value.
|
| + * name and �absent�, then any must be the value.
|
| */
|
| completeWild->any = 1;
|
| if (completeWild->nsSet != NULL) {
|
| @@ -13578,7 +13646,7 @@ xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
|
| } else if (nsFound && (!absentFound)) {
|
| /*
|
| * 5.2 If the set S includes the negated namespace name
|
| - * but not ·absent·, then a pair of not and ·absent· must
|
| + * but not �absent�, then a pair of not and �absent� must
|
| * be the value.
|
| */
|
| if (completeWild->nsSet != NULL) {
|
| @@ -13593,7 +13661,7 @@ xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
|
| completeWild->negNsSet->value = NULL;
|
| } else if ((!nsFound) && absentFound) {
|
| /*
|
| - * 5.3 If the set S includes ·absent· but not the negated
|
| + * 5.3 If the set S includes �absent� but not the negated
|
| * namespace name, then the union is not expressible.
|
| */
|
| xmlSchemaPErr(ctxt, completeWild->node,
|
| @@ -13604,7 +13672,7 @@ xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
|
| } else if ((!nsFound) && (!absentFound)) {
|
| /*
|
| * 5.4 If the set S does not include either the negated namespace
|
| - * name or ·absent·, then whichever of O1 or O2 is a pair of not
|
| + * name or �absent�, then whichever of O1 or O2 is a pair of not
|
| * and a namespace name must be the value.
|
| */
|
| if (completeWild->negNsSet == NULL) {
|
| @@ -13638,7 +13706,7 @@ xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
|
| while (cur != NULL) {
|
| if (cur->value == NULL) {
|
| /*
|
| - * 6.1 If the set S includes ·absent·, then any must be the
|
| + * 6.1 If the set S includes �absent�, then any must be the
|
| * value.
|
| */
|
| completeWild->any = 1;
|
| @@ -13656,8 +13724,8 @@ xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
|
| }
|
| if (completeWild->negNsSet == NULL) {
|
| /*
|
| - * 6.2 If the set S does not include ·absent·, then a pair of not
|
| - * and ·absent· must be the value.
|
| + * 6.2 If the set S does not include �absent�, then a pair of not
|
| + * and �absent� must be the value.
|
| */
|
| if (completeWild->nsSet != NULL) {
|
| xmlSchemaFreeWildcardNsSet(completeWild->nsSet);
|
| @@ -13740,9 +13808,9 @@ xmlSchemaIntersectWildcards(xmlSchemaParserCtxtPtr ctxt,
|
| }
|
| /*
|
| * 3 If either O1 or O2 is a pair of not and a value (a namespace
|
| - * name or ·absent·) and the other is a set of (namespace names or
|
| - * ·absent·), then that set, minus the negated value if it was in
|
| - * the set, minus ·absent· if it was in the set, must be the value.
|
| + * name or �absent�) and the other is a set of (namespace names or
|
| + * �absent�), then that set, minus the negated value if it was in
|
| + * the set, minus �absent� if it was in the set, must be the value.
|
| */
|
| if (((completeWild->negNsSet != NULL) && (curWild->nsSet != NULL)) ||
|
| ((curWild->negNsSet != NULL) && (completeWild->nsSet != NULL))) {
|
| @@ -13791,7 +13859,7 @@ xmlSchemaIntersectWildcards(xmlSchemaParserCtxtPtr ctxt,
|
| return(0);
|
| }
|
| /*
|
| - * 4 If both O1 and O2 are sets of (namespace names or ·absent·),
|
| + * 4 If both O1 and O2 are sets of (namespace names or �absent�),
|
| * then the intersection of those sets must be the value.
|
| */
|
| if ((completeWild->nsSet != NULL) && (curWild->nsSet != NULL)) {
|
| @@ -13841,7 +13909,7 @@ xmlSchemaIntersectWildcards(xmlSchemaParserCtxtPtr ctxt,
|
| }
|
| /*
|
| * 6 If the one is a negation of a namespace name and the other
|
| - * is a negation of ·absent·, then the one which is the negation
|
| + * is a negation of �absent�, then the one which is the negation
|
| * of a namespace name must be the value.
|
| */
|
| if ((completeWild->negNsSet != NULL) && (curWild->negNsSet != NULL) &&
|
| @@ -13873,7 +13941,7 @@ xmlSchemaCheckCOSNSSubset(xmlSchemaWildcardPtr sub,
|
| if (super->any)
|
| return (0);
|
| /*
|
| - * 2.1 sub must be a pair of not and a namespace name or ·absent·.
|
| + * 2.1 sub must be a pair of not and a namespace name or �absent�.
|
| * 2.2 super must be a pair of not and the same value.
|
| */
|
| if ((sub->negNsSet != NULL) &&
|
| @@ -13881,7 +13949,7 @@ xmlSchemaCheckCOSNSSubset(xmlSchemaWildcardPtr sub,
|
| (sub->negNsSet->value == sub->negNsSet->value))
|
| return (0);
|
| /*
|
| - * 3.1 sub must be a set whose members are either namespace names or ·absent·.
|
| + * 3.1 sub must be a set whose members are either namespace names or �absent�.
|
| */
|
| if (sub->nsSet != NULL) {
|
| /*
|
| @@ -13912,7 +13980,7 @@ xmlSchemaCheckCOSNSSubset(xmlSchemaWildcardPtr sub,
|
| xmlSchemaWildcardNsPtr cur;
|
| /*
|
| * 3.2.2 super must be a pair of not and a namespace name or
|
| - * ·absent· and that value must not be in sub's set.
|
| + * �absent� and that value must not be in sub's set.
|
| */
|
| cur = sub->nsSet;
|
| while (cur != NULL) {
|
| @@ -13937,7 +14005,7 @@ xmlSchemaGetEffectiveValueConstraint(xmlSchemaAttributeUsePtr attruse,
|
| if (val != 0)
|
| *val = NULL;
|
|
|
| - if (attruse->defValue != NULL) {
|
| + if (attruse->defValue != NULL) {
|
| *value = attruse->defValue;
|
| if (val != NULL)
|
| *val = attruse->defVal;
|
| @@ -14017,12 +14085,12 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt,
|
| xmlSchemaItemListPtr baseUses,
|
| xmlSchemaWildcardPtr wild,
|
| xmlSchemaWildcardPtr baseWild)
|
| -{
|
| +{
|
| xmlSchemaAttributeUsePtr cur = NULL, bcur;
|
| int i, j, found; /* err = 0; */
|
| const xmlChar *bEffValue;
|
| int effFixed;
|
| -
|
| +
|
| if (uses != NULL) {
|
| for (i = 0; i < uses->nbItems; i++) {
|
| cur = uses->items[i];
|
| @@ -14030,7 +14098,7 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt,
|
| if (baseUses == NULL)
|
| goto not_found;
|
| for (j = 0; j < baseUses->nbItems; j++) {
|
| - bcur = baseUses->items[j];
|
| + bcur = baseUses->items[j];
|
| if ((WXS_ATTRUSE_DECL_NAME(cur) ==
|
| WXS_ATTRUSE_DECL_NAME(bcur)) &&
|
| (WXS_ATTRUSE_DECL_TNS(cur) ==
|
| @@ -14043,7 +14111,7 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt,
|
| * namespace}, then all of the following must be true:"
|
| */
|
| found = 1;
|
| -
|
| +
|
| if ((cur->occurs == XML_SCHEMAS_ATTR_USE_OPTIONAL) &&
|
| (bcur->occurs == XML_SCHEMAS_ATTR_USE_REQUIRED))
|
| {
|
| @@ -14069,12 +14137,12 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt,
|
| WXS_ATTRUSE_TYPEDEF(bcur), 0) != 0)
|
| {
|
| xmlChar *strA = NULL, *strB = NULL, *strC = NULL;
|
| -
|
| +
|
| /*
|
| * SPEC (2.1.2) "R's {attribute declaration}'s
|
| * {type definition} must be validly derived from
|
| * B's {type definition} given the empty set as
|
| - * defined in Type Derivation OK (Simple) (§3.14.6)."
|
| + * defined in Type Derivation OK (Simple) (�3.14.6)."
|
| */
|
| xmlSchemaPAttrUseErr4(pctxt,
|
| XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2,
|
| @@ -14106,17 +14174,17 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt,
|
| /*
|
| * 2.1.3 ... one of the following must be true
|
| *
|
| - * 2.1.3.1 B's ·effective value constraint· is
|
| - * ·absent· or default.
|
| + * 2.1.3.1 B's �effective value constraint� is
|
| + * �absent� or default.
|
| */
|
| if ((bEffValue != NULL) &&
|
| (effFixed == 1)) {
|
| const xmlChar *rEffValue = NULL;
|
| -
|
| +
|
| xmlSchemaGetEffectiveValueConstraint(bcur,
|
| &effFixed, &rEffValue, NULL);
|
| /*
|
| - * 2.1.3.2 R's ·effective value constraint· is
|
| + * 2.1.3.2 R's �effective value constraint� is
|
| * fixed with the same string as B's.
|
| * MAYBE TODO: Compare the computed values.
|
| * Hmm, it says "same string" so
|
| @@ -14126,7 +14194,7 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt,
|
| (! WXS_ARE_DEFAULT_STR_EQUAL(rEffValue, bEffValue)))
|
| {
|
| xmlChar *str = NULL;
|
| -
|
| +
|
| xmlSchemaPAttrUseErr4(pctxt,
|
| XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3,
|
| WXS_ITEM_NODE(item), item, cur,
|
| @@ -14145,21 +14213,21 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt,
|
| break;
|
| }
|
| }
|
| -not_found:
|
| +not_found:
|
| if (!found) {
|
| /*
|
| * (2.2) "otherwise the {base type definition} must have an
|
| * {attribute wildcard} and the {target namespace} of the
|
| - * R's {attribute declaration} must be ·valid· with respect
|
| + * R's {attribute declaration} must be �valid� with respect
|
| * to that wildcard, as defined in Wildcard allows Namespace
|
| - * Name (§3.10.4)."
|
| + * Name (�3.10.4)."
|
| */
|
| if ((baseWild == NULL) ||
|
| (xmlSchemaCheckCVCWildcardNamespace(baseWild,
|
| (WXS_ATTRUSE_DECL(cur))->targetNamespace) != 0))
|
| {
|
| xmlChar *str = NULL;
|
| -
|
| +
|
| xmlSchemaPAttrUseErr4(pctxt,
|
| XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2,
|
| WXS_ITEM_NODE(item), item, cur,
|
| @@ -14175,7 +14243,7 @@ not_found:
|
| }
|
| }
|
| /*
|
| - * SPEC derivation-ok-restriction (3):
|
| + * SPEC derivation-ok-restriction (3):
|
| * (3) "For each attribute use in the {attribute uses} of the {base type
|
| * definition} whose {required} is true, there must be an attribute
|
| * use with an {attribute declaration} with the same {name} and
|
| @@ -14190,7 +14258,7 @@ not_found:
|
| found = 0;
|
| if (uses != NULL) {
|
| for (i = 0; i < uses->nbItems; i++) {
|
| - cur = uses->items[i];
|
| + cur = uses->items[i];
|
| if ((WXS_ATTRUSE_DECL_NAME(cur) ==
|
| WXS_ATTRUSE_DECL_NAME(bcur)) &&
|
| (WXS_ATTRUSE_DECL_TNS(cur) ==
|
| @@ -14202,7 +14270,7 @@ not_found:
|
| }
|
| if (!found) {
|
| xmlChar *strA = NULL, *strB = NULL;
|
| -
|
| +
|
| xmlSchemaCustomErr4(ACTXT_CAST pctxt,
|
| XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3,
|
| NULL, item,
|
| @@ -14224,19 +14292,19 @@ not_found:
|
| /*
|
| * (4) "If there is an {attribute wildcard}, all of the
|
| * following must be true:"
|
| - */
|
| + */
|
| if (baseWild == NULL) {
|
| xmlChar *str = NULL;
|
|
|
| /*
|
| * (4.1) "The {base type definition} must also have one."
|
| - */
|
| + */
|
| xmlSchemaCustomErr4(ACTXT_CAST pctxt,
|
| XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1,
|
| NULL, item,
|
| "The %s has an attribute wildcard, "
|
| "but the %s %s '%s' does not have one",
|
| - WXS_ITEM_TYPE_NAME(item),
|
| + WXS_ITEM_TYPE_NAME(item),
|
| WXS_ACTION_STR(action),
|
| WXS_ITEM_TYPE_NAME(baseItem),
|
| xmlSchemaGetComponentQName(&str, baseItem));
|
| @@ -14250,7 +14318,7 @@ not_found:
|
| * (4.2) "The complex type definition's {attribute wildcard}'s
|
| * {namespace constraint} must be a subset of the {base type
|
| * definition}'s {attribute wildcard}'s {namespace constraint},
|
| - * as defined by Wildcard Subset (§3.10.6)."
|
| + * as defined by Wildcard Subset (�3.10.6)."
|
| */
|
| xmlSchemaCustomErr4(ACTXT_CAST pctxt,
|
| XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2,
|
| @@ -14264,8 +14332,8 @@ not_found:
|
| FREE_AND_NULL(str);
|
| return(pctxt->err);
|
| }
|
| - /* 4.3 Unless the {base type definition} is the ·ur-type
|
| - * definition·, the complex type definition's {attribute
|
| + /* 4.3 Unless the {base type definition} is the �ur-type
|
| + * definition�, the complex type definition's {attribute
|
| * wildcard}'s {process contents} must be identical to or
|
| * stronger than the {base type definition}'s {attribute
|
| * wildcard}'s {process contents}, where strict is stronger
|
| @@ -14316,7 +14384,7 @@ xmlSchemaFixupTypeAttributeUses(xmlSchemaParserCtxtPtr pctxt,
|
| xmlSchemaTypePtr type)
|
| {
|
| xmlSchemaTypePtr baseType = NULL;
|
| - xmlSchemaAttributeUsePtr use;
|
| + xmlSchemaAttributeUsePtr use;
|
| xmlSchemaItemListPtr uses, baseUses, prohibs = NULL;
|
|
|
| if (type->baseType == NULL) {
|
| @@ -14324,7 +14392,7 @@ xmlSchemaFixupTypeAttributeUses(xmlSchemaParserCtxtPtr pctxt,
|
| "no base type");
|
| return (-1);
|
| }
|
| - baseType = type->baseType;
|
| + baseType = type->baseType;
|
| if (WXS_IS_TYPE_NOT_FIXED(baseType))
|
| if (xmlSchemaTypeFixup(baseType, ACTXT_CAST pctxt) == -1)
|
| return(-1);
|
| @@ -14336,7 +14404,7 @@ xmlSchemaFixupTypeAttributeUses(xmlSchemaParserCtxtPtr pctxt,
|
| * wildcard, i.e. intersect multiple wildcards.
|
| * Move attribute prohibitions into a separate list.
|
| */
|
| - if (uses != NULL) {
|
| + if (uses != NULL) {
|
| if (WXS_IS_RESTRICTION(type)) {
|
| /*
|
| * This one will transfer all attr. prohibitions
|
| @@ -14370,7 +14438,7 @@ xmlSchemaFixupTypeAttributeUses(xmlSchemaParserCtxtPtr pctxt,
|
|
|
| if (WXS_IS_RESTRICTION(type)) {
|
| int usesCount;
|
| - xmlSchemaAttributeUsePtr tmp;
|
| + xmlSchemaAttributeUsePtr tmp;
|
|
|
| if (uses != NULL)
|
| usesCount = uses->nbItems;
|
| @@ -14420,15 +14488,15 @@ inherit_next: {}
|
| }
|
| } else {
|
| /* Extension. */
|
| - for (i = 0; i < baseUses->nbItems; i++) {
|
| - use = baseUses->items[i];
|
| + for (i = 0; i < baseUses->nbItems; i++) {
|
| + use = baseUses->items[i];
|
| if (uses == NULL) {
|
| type->attrUses = xmlSchemaItemListCreate();
|
| if (type->attrUses == NULL)
|
| goto exit_failure;
|
| uses = type->attrUses;
|
| }
|
| - xmlSchemaItemListAddSize(uses, baseUses->nbItems, use);
|
| + xmlSchemaItemListAddSize(uses, baseUses->nbItems, use);
|
| }
|
| }
|
| }
|
| @@ -14448,10 +14516,10 @@ inherit_next: {}
|
| /*
|
| * Compute the complete wildcard.
|
| */
|
| - if (WXS_IS_EXTENSION(type)) {
|
| + if (WXS_IS_EXTENSION(type)) {
|
| if (baseType->attributeWildcard != NULL) {
|
| /*
|
| - * (3.2.2.1) "If the ·base wildcard· is non-·absent·, then
|
| + * (3.2.2.1) "If the �base wildcard� is non-�absent�, then
|
| * the appropriate case among the following:"
|
| */
|
| if (type->attributeWildcard != NULL) {
|
| @@ -14459,26 +14527,26 @@ inherit_next: {}
|
| * Union the complete wildcard with the base wildcard.
|
| * SPEC {attribute wildcard}
|
| * (3.2.2.1.2) "otherwise a wildcard whose {process contents}
|
| - * and {annotation} are those of the ·complete wildcard·,
|
| + * and {annotation} are those of the �complete wildcard�,
|
| * and whose {namespace constraint} is the intensional union
|
| - * of the {namespace constraint} of the ·complete wildcard·
|
| - * and of the ·base wildcard·, as defined in Attribute
|
| - * Wildcard Union (§3.10.6)."
|
| + * of the {namespace constraint} of the �complete wildcard�
|
| + * and of the �base wildcard�, as defined in Attribute
|
| + * Wildcard Union (�3.10.6)."
|
| */
|
| if (xmlSchemaUnionWildcards(pctxt, type->attributeWildcard,
|
| baseType->attributeWildcard) == -1)
|
| - goto exit_failure;
|
| + goto exit_failure;
|
| } else {
|
| /*
|
| - * (3.2.2.1.1) "If the ·complete wildcard· is ·absent·,
|
| - * then the ·base wildcard·."
|
| + * (3.2.2.1.1) "If the �complete wildcard� is �absent�,
|
| + * then the �base wildcard�."
|
| */
|
| type->attributeWildcard = baseType->attributeWildcard;
|
| - }
|
| + }
|
| } else {
|
| /*
|
| - * (3.2.2.2) "otherwise (the ·base wildcard· is ·absent·) the
|
| - * ·complete wildcard"
|
| + * (3.2.2.2) "otherwise (the �base wildcard� is �absent�) the
|
| + * �complete wildcard"
|
| * NOOP
|
| */
|
| }
|
| @@ -14486,11 +14554,11 @@ inherit_next: {}
|
| /*
|
| * SPEC {attribute wildcard}
|
| * (3.1) "If the <restriction> alternative is chosen, then the
|
| - * ·complete wildcard·;"
|
| + * �complete wildcard�;"
|
| * NOOP
|
| */
|
| }
|
| -
|
| +
|
| return (0);
|
|
|
| exit_failure:
|
| @@ -14594,6 +14662,7 @@ xmlSchemaGetParticleTotalRangeMin(xmlSchemaParticlePtr particle)
|
| }
|
| }
|
|
|
| +#if 0
|
| /**
|
| * xmlSchemaGetParticleTotalRangeMax:
|
| * @particle: the particle
|
| @@ -14653,6 +14722,7 @@ xmlSchemaGetParticleTotalRangeMax(xmlSchemaParticlePtr particle)
|
| return (particle->maxOccurs * sum);
|
| }
|
| }
|
| +#endif
|
|
|
| /**
|
| * xmlSchemaIsParticleEmptiable:
|
| @@ -14733,12 +14803,12 @@ xmlSchemaCheckCOSSTDerivedOK(xmlSchemaAbstractCtxtPtr actxt,
|
| /* 2.2 */
|
| if (type->baseType == baseType) {
|
| /*
|
| - * 2.2.1 D's ·base type definition· is B.
|
| + * 2.2.1 D's �base type definition� is B.
|
| */
|
| return (0);
|
| }
|
| /*
|
| - * 2.2.2 D's ·base type definition· is not the ·ur-type definition·
|
| + * 2.2.2 D's �base type definition� is not the �ur-type definition�
|
| * and is validly derived from B given the subset, as defined by this
|
| * constraint.
|
| */
|
| @@ -14748,8 +14818,8 @@ xmlSchemaCheckCOSSTDerivedOK(xmlSchemaAbstractCtxtPtr actxt,
|
| return (0);
|
| }
|
| /*
|
| - * 2.2.3 D's {variety} is list or union and B is the ·simple ur-type
|
| - * definition·.
|
| + * 2.2.3 D's {variety} is list or union and B is the �simple ur-type
|
| + * definition�.
|
| */
|
| if (WXS_IS_ANY_SIMPLE_TYPE(baseType) &&
|
| (WXS_IS_LIST(type) || WXS_IS_UNION(type))) {
|
| @@ -14865,10 +14935,10 @@ static int
|
| xmlSchemaCheckUnionTypeDefCircularRecur(xmlSchemaParserCtxtPtr pctxt,
|
| xmlSchemaTypePtr ctxType,
|
| xmlSchemaTypeLinkPtr members)
|
| -{
|
| +{
|
| xmlSchemaTypeLinkPtr member;
|
| xmlSchemaTypePtr memberType;
|
| -
|
| +
|
| member = members;
|
| while (member != NULL) {
|
| memberType = member->type;
|
| @@ -14969,7 +15039,7 @@ xmlSchemaResolveTypeReferences(xmlSchemaTypePtr typeDef,
|
| }
|
| return;
|
| }
|
| - }
|
| + }
|
| /*
|
| * The ball of letters below means, that if we have a particle
|
| * which has a QName-helper component as its {term}, we want
|
| @@ -15012,7 +15082,7 @@ xmlSchemaResolveTypeReferences(xmlSchemaTypePtr typeDef,
|
| * particle's {term}.
|
| */
|
| WXS_TYPE_PARTICLE_TERM(typeDef) = WXS_MODELGROUPDEF_MODEL(groupDef);
|
| -
|
| +
|
| if (WXS_MODELGROUPDEF_MODEL(groupDef)->type == XML_SCHEMA_TYPE_ALL) {
|
| /*
|
| * SPEC cos-all-limited (1.2)
|
| @@ -15061,14 +15131,14 @@ xmlSchemaCheckSTPropsCorrect(xmlSchemaParserCtxtPtr ctxt,
|
| * NOTE: This is somehow redundant, since we actually built a simple type
|
| * to have all the needed information; this acts as an self test.
|
| */
|
| - /* Base type: If the datatype has been ·derived· by ·restriction·
|
| - * then the Simple Type Definition component from which it is ·derived·,
|
| - * otherwise the Simple Type Definition for anySimpleType (§4.1.6).
|
| + /* Base type: If the datatype has been �derived� by �restriction�
|
| + * then the Simple Type Definition component from which it is �derived�,
|
| + * otherwise the Simple Type Definition for anySimpleType (�4.1.6).
|
| */
|
| if (baseType == NULL) {
|
| /*
|
| * TODO: Think about: "modulo the impact of Missing
|
| - * Sub-components (§5.3)."
|
| + * Sub-components (�5.3)."
|
| */
|
| xmlSchemaPCustomErr(ctxt,
|
| XML_SCHEMAP_ST_PROPS_CORRECT_1,
|
| @@ -15092,7 +15162,7 @@ xmlSchemaCheckSTPropsCorrect(xmlSchemaParserCtxtPtr ctxt,
|
| xmlSchemaPCustomErr(ctxt,
|
| XML_SCHEMAP_ST_PROPS_CORRECT_1,
|
| WXS_BASIC_CAST type, NULL,
|
| - "A type, derived by list or union, must have"
|
| + "A type, derived by list or union, must have "
|
| "the simple ur-type definition as base type, not '%s'",
|
| xmlSchemaGetComponentQName(&str, baseType));
|
| FREE_AND_NULL(str)
|
| @@ -15127,10 +15197,10 @@ xmlSchemaCheckSTPropsCorrect(xmlSchemaParserCtxtPtr ctxt,
|
| }
|
|
|
| /*
|
| - * 2 All simple type definitions must be derived ultimately from the ·simple
|
| - * ur-type definition (so· circular definitions are disallowed). That is, it
|
| - * must be possible to reach a built-in primitive datatype or the ·simple
|
| - * ur-type definition· by repeatedly following the {base type definition}.
|
| + * 2 All simple type definitions must be derived ultimately from the �simple
|
| + * ur-type definition (so� circular definitions are disallowed). That is, it
|
| + * must be possible to reach a built-in primitive datatype or the �simple
|
| + * ur-type definition� by repeatedly following the {base type definition}.
|
| *
|
| * NOTE: this is done in xmlSchemaCheckTypeDefCircular().
|
| */
|
| @@ -15314,10 +15384,10 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt,
|
| }
|
| /*
|
| * MAYBE TODO: (Hmm, not really) Datatypes states:
|
| - * A ·list· datatype can be ·derived· from an ·atomic· datatype
|
| - * whose ·lexical space· allows space (such as string or anyURI)or
|
| - * a ·union· datatype any of whose {member type definitions}'s
|
| - * ·lexical space· allows space.
|
| + * A �list� datatype can be �derived� from an �atomic� datatype
|
| + * whose �lexical space� allows space (such as string or anyURI)or
|
| + * a �union� datatype any of whose {member type definitions}'s
|
| + * �lexical space� allows space.
|
| */
|
| } else {
|
| /*
|
| @@ -15354,7 +15424,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt,
|
| /*
|
| * 2.3.2.3 The {item type definition} must be validly derived
|
| * from the {base type definition}'s {item type definition} given
|
| - * the empty set, as defined in Type Derivation OK (Simple) (§3.14.6).
|
| + * the empty set, as defined in Type Derivation OK (Simple) (�3.14.6).
|
| */
|
| {
|
| xmlSchemaTypePtr baseItemType;
|
| @@ -15401,7 +15471,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt,
|
| case XML_SCHEMA_FACET_WHITESPACE:
|
| /*
|
| * TODO: 2.5.1.2 List datatypes
|
| - * The value of ·whiteSpace· is fixed to the value collapse.
|
| + * The value of �whiteSpace� is fixed to the value collapse.
|
| */
|
| case XML_SCHEMA_FACET_PATTERN:
|
| case XML_SCHEMA_FACET_ENUMERATION:
|
| @@ -15454,8 +15524,8 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt,
|
| member = member->next;
|
| }
|
| /*
|
| - * 3.3.1 If the {base type definition} is the ·simple ur-type
|
| - * definition·
|
| + * 3.3.1 If the {base type definition} is the �simple ur-type
|
| + * definition�
|
| */
|
| if (type->baseType->builtInType == XML_SCHEMAS_ANYSIMPLETYPE) {
|
| /*
|
| @@ -15517,7 +15587,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt,
|
| * 3.3.2.3 The {member type definitions}, in order, must be validly
|
| * derived from the corresponding type definitions in the {base
|
| * type definition}'s {member type definitions} given the empty set,
|
| - * as defined in Type Derivation OK (Simple) (§3.14.6).
|
| + * as defined in Type Derivation OK (Simple) (�3.14.6).
|
| */
|
| {
|
| xmlSchemaTypeLinkPtr baseMember;
|
| @@ -15565,7 +15635,8 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt,
|
| return (XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3);
|
| }
|
| member = member->next;
|
| - baseMember = baseMember->next;
|
| + if (baseMember != NULL)
|
| + baseMember = baseMember->next;
|
| }
|
| }
|
| }
|
| @@ -15609,7 +15680,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt,
|
| * @ctxt: the schema parser context
|
| * @type: the simple type definition
|
| *
|
| - * Checks crc-simple-type constraints.
|
| + * Checks crc-simple-type constraints.
|
| *
|
| * Returns 0 if the constraints are satisfied,
|
| * if not a positive error code and -1 on internal
|
| @@ -15623,8 +15694,8 @@ xmlSchemaCheckSRCSimpleType(xmlSchemaParserCtxtPtr ctxt,
|
| /*
|
| * src-simple-type.1 The corresponding simple type definition, if any,
|
| * must satisfy the conditions set out in Constraints on Simple Type
|
| - * Definition Schema Components (§3.14.6).
|
| - */
|
| + * Definition Schema Components (�3.14.6).
|
| + */
|
| if (WXS_IS_RESTRICTION(type)) {
|
| /*
|
| * src-simple-type.2 "If the <restriction> alternative is chosen,
|
| @@ -15633,7 +15704,7 @@ xmlSchemaCheckSRCSimpleType(xmlSchemaParserCtxtPtr ctxt,
|
| * NOTE: This is checked in the parse function of <restriction>.
|
| */
|
| /*
|
| - *
|
| + *
|
| */
|
| } else if (WXS_IS_LIST(type)) {
|
| /* src-simple-type.3 "If the <list> alternative is chosen, either it must have
|
| @@ -15642,8 +15713,8 @@ xmlSchemaCheckSRCSimpleType(xmlSchemaParserCtxtPtr ctxt,
|
| *
|
| * NOTE: This is checked in the parse function of <list>.
|
| */
|
| - } else if (WXS_IS_UNION(type)) {
|
| - /*
|
| + } else if (WXS_IS_UNION(type)) {
|
| + /*
|
| * src-simple-type.4 is checked in xmlSchemaCheckUnionTypeDefCircular().
|
| */
|
| }
|
| @@ -15721,8 +15792,8 @@ xmlSchemaParseCheckCOSValidDefault(xmlSchemaParserCtxtPtr pctxt,
|
| * SPEC (2.1) "its {content type} must be a simple type definition
|
| * or mixed."
|
| * SPEC (2.2.2) "If the {content type} is mixed, then the {content
|
| - * type}'s particle must be ·emptiable· as defined by
|
| - * Particle Emptiable (§3.9.6)."
|
| + * type}'s particle must be �emptiable� as defined by
|
| + * Particle Emptiable (�3.9.6)."
|
| */
|
| if ((! WXS_HAS_SIMPLE_CONTENT(type)) &&
|
| ((! WXS_HAS_MIXED_CONTENT(type)) || (! WXS_EMPTIABLE(type)))) {
|
| @@ -15738,14 +15809,14 @@ xmlSchemaParseCheckCOSValidDefault(xmlSchemaParserCtxtPtr pctxt,
|
| }
|
| /*
|
| * 1 If the type definition is a simple type definition, then the string
|
| - * must be ·valid· with respect to that definition as defined by String
|
| - * Valid (§3.14.4).
|
| + * must be �valid� with respect to that definition as defined by String
|
| + * Valid (�3.14.4).
|
| *
|
| * AND
|
| *
|
| * 2.2.1 If the {content type} is a simple type definition, then the
|
| - * string must be ·valid· with respect to that simple type definition
|
| - * as defined by String Valid (§3.14.4).
|
| + * string must be �valid� with respect to that simple type definition
|
| + * as defined by String Valid (�3.14.4).
|
| */
|
| if (WXS_IS_SIMPLE(type))
|
| ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST pctxt, node,
|
| @@ -15786,8 +15857,8 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
|
| *
|
| * SPEC (1) "The values of the properties of a complex type definition must
|
| * be as described in the property tableau in The Complex Type Definition
|
| - * Schema Component (§3.4.1), modulo the impact of Missing
|
| - * Sub-components (§5.3)."
|
| + * Schema Component (�3.4.1), modulo the impact of Missing
|
| + * Sub-components (�5.3)."
|
| */
|
| if ((type->baseType != NULL) &&
|
| (WXS_IS_SIMPLE(type->baseType)) &&
|
| @@ -15798,14 +15869,14 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
|
| */
|
| xmlSchemaCustomErr(ACTXT_CAST pctxt,
|
| XML_SCHEMAP_SRC_CT_1,
|
| - NULL, WXS_BASIC_CAST type,
|
| + NULL, WXS_BASIC_CAST type,
|
| "If the base type is a simple type, the derivation method must be "
|
| "'extension'", NULL, NULL);
|
| return (XML_SCHEMAP_SRC_CT_1);
|
| }
|
| /*
|
| - * SPEC (3) "Circular definitions are disallowed, except for the ·ur-type
|
| - * definition·. That is, it must be possible to reach the ·ur-type
|
| + * SPEC (3) "Circular definitions are disallowed, except for the �ur-type
|
| + * definition�. That is, it must be possible to reach the �ur-type
|
| * definition by repeatedly following the {base type definition}."
|
| *
|
| * NOTE (3) is done in xmlSchemaCheckTypeDefCircular().
|
| @@ -15815,7 +15886,7 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
|
| * - attribute uses need to be already inherited (apply attr. prohibitions)
|
| * - attribute group references need to be expanded already
|
| * - simple types need to be typefixed already
|
| - */
|
| + */
|
| if (type->attrUses &&
|
| (((xmlSchemaItemListPtr) type->attrUses)->nbItems > 1))
|
| {
|
| @@ -15825,8 +15896,8 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
|
|
|
| for (i = uses->nbItems -1; i >= 0; i--) {
|
| use = uses->items[i];
|
| -
|
| - /*
|
| +
|
| + /*
|
| * SPEC ct-props-correct
|
| * (4) "Two distinct attribute declarations in the
|
| * {attribute uses} must not have identical {name}s and
|
| @@ -15867,10 +15938,10 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
|
| if (WXS_ATTRUSE_TYPEDEF(use) != NULL) {
|
| if (xmlSchemaIsDerivedFromBuiltInType(
|
| WXS_ATTRUSE_TYPEDEF(use), XML_SCHEMAS_ID))
|
| - {
|
| + {
|
| if (hasId) {
|
| xmlChar *str = NULL;
|
| -
|
| +
|
| xmlSchemaCustomErr(ACTXT_CAST pctxt,
|
| XML_SCHEMAP_AG_PROPS_CORRECT,
|
| NULL, WXS_BASIC_CAST type,
|
| @@ -15884,7 +15955,7 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
|
| if (xmlSchemaItemListRemove(uses, i) == -1)
|
| goto exit_failure;
|
| }
|
| -
|
| +
|
| hasId = 1;
|
| }
|
| }
|
| @@ -15958,8 +16029,8 @@ xmlSchemaCheckCOSCTDerivedOK(xmlSchemaAbstractCtxtPtr actxt,
|
| if (type->baseType == baseType)
|
| return (0);
|
| /*
|
| - * SPEC (2.3.1) "D's {base type definition} must not be the ·ur-type
|
| - * definition·."
|
| + * SPEC (2.3.1) "D's {base type definition} must not be the �ur-type
|
| + * definition�."
|
| */
|
| if (WXS_IS_ANYTYPE(type->baseType))
|
| return (1);
|
| @@ -15976,7 +16047,7 @@ xmlSchemaCheckCOSCTDerivedOK(xmlSchemaAbstractCtxtPtr actxt,
|
| /*
|
| * SPEC (2.3.2.2) "If D's {base type definition} is simple, then it
|
| * must be validly derived from B given the subset as defined in Type
|
| - * Derivation OK (Simple) (§3.14.6).
|
| + * Derivation OK (Simple) (�3.14.6).
|
| */
|
| return (xmlSchemaCheckCOSSTDerivedOK(actxt, type->baseType,
|
| baseType, set));
|
| @@ -16037,7 +16108,7 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt,
|
| * SPEC (1) "If the {base type definition} is a complex type definition,
|
| * then all of the following must be true:"
|
| */
|
| - if (WXS_IS_COMPLEX(base)) {
|
| + if (WXS_IS_COMPLEX(base)) {
|
| /*
|
| * SPEC (1.1) "The {final} of the {base type definition} must not
|
| * contain extension."
|
| @@ -16050,7 +16121,7 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt,
|
| "contains 'extension'", NULL);
|
| return (XML_SCHEMAP_COS_CT_EXTENDS_1_1);
|
| }
|
| -
|
| +
|
| /*
|
| * ATTENTION: The constrains (1.2) and (1.3) are not applied,
|
| * since they are automatically satisfied through the
|
| @@ -16094,11 +16165,11 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt,
|
| }
|
| if (! found) {
|
| xmlChar *str = NULL;
|
| -
|
| +
|
| xmlSchemaCustomErr(ACTXT_CAST ctxt,
|
| XML_SCHEMAP_COS_CT_EXTENDS_1_2,
|
| NULL, WXS_BASIC_CAST type,
|
| - /*
|
| + /*
|
| * TODO: The report does not indicate that also the
|
| * type needs to be the same.
|
| */
|
| @@ -16116,9 +16187,9 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt,
|
| * definition must also have one, and the base type definition's
|
| * {attribute wildcard}'s {namespace constraint} must be a subset
|
| * of the complex type definition's {attribute wildcard}'s {namespace
|
| - * constraint}, as defined by Wildcard Subset (§3.10.6)."
|
| + * constraint}, as defined by Wildcard Subset (�3.10.6)."
|
| */
|
| -
|
| +
|
| /*
|
| * MAYBE TODO: Enable if ever needed. But this will be needed only
|
| * if created the type via a schema construction API.
|
| @@ -16126,7 +16197,7 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt,
|
| if (base->attributeWildcard != NULL) {
|
| if (type->attributeWilcard == NULL) {
|
| xmlChar *str = NULL;
|
| -
|
| +
|
| xmlSchemaCustomErr(ACTXT_CAST pctxt,
|
| XML_SCHEMAP_COS_CT_EXTENDS_1_3,
|
| NULL, type,
|
| @@ -16139,7 +16210,7 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt,
|
| base->attributeWildcard, type->attributeWildcard))
|
| {
|
| xmlChar *str = NULL;
|
| -
|
| +
|
| xmlSchemaCustomErr(ACTXT_CAST pctxt,
|
| XML_SCHEMAP_COS_CT_EXTENDS_1_3,
|
| NULL, type,
|
| @@ -16213,9 +16284,9 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt,
|
| }
|
| /*
|
| * URGENT TODO SPEC (1.4.3.2.2.2) "The particle of the
|
| - * complex type definition must be a ·valid extension·
|
| + * complex type definition must be a �valid extension�
|
| * of the {base type definition}'s particle, as defined
|
| - * in Particle Valid (Extension) (§3.9.6)."
|
| + * in Particle Valid (Extension) (�3.9.6)."
|
| *
|
| * NOTE that we won't check "Particle Valid (Extension)",
|
| * since it is ensured by the derivation process in
|
| @@ -16293,7 +16364,7 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
|
| */
|
| base = type->baseType;
|
| if (! WXS_IS_COMPLEX(base)) {
|
| - xmlSchemaCustomErr(ACTXT_CAST ctxt,
|
| + xmlSchemaCustomErr(ACTXT_CAST ctxt,
|
| XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1,
|
| type->node, WXS_BASIC_CAST type,
|
| "The base type must be a complex type", NULL, NULL);
|
| @@ -16304,7 +16375,7 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
|
| * SPEC (1) "The {base type definition} must be a complex type
|
| * definition whose {final} does not contain restriction."
|
| */
|
| - xmlSchemaCustomErr(ACTXT_CAST ctxt,
|
| + xmlSchemaCustomErr(ACTXT_CAST ctxt,
|
| XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1,
|
| type->node, WXS_BASIC_CAST type,
|
| "The 'final' of the base type definition "
|
| @@ -16332,7 +16403,7 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
|
| if (base->builtInType == XML_SCHEMAS_ANYTYPE) {
|
| /*
|
| * SPEC (5.1) "The {base type definition} must be the
|
| - * ·ur-type definition·."
|
| + * �ur-type definition�."
|
| * PASS
|
| */
|
| } else if ((type->contentType == XML_SCHEMA_CONTENT_SIMPLE) ||
|
| @@ -16351,11 +16422,11 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
|
| * SPEC (5.2.2.1) "The {content type} of the {base type
|
| * definition} must be a simple type definition from which
|
| * the {content type} is validly derived given the empty
|
| - * set as defined in Type Derivation OK (Simple) (§3.14.6)."
|
| + * set as defined in Type Derivation OK (Simple) (�3.14.6)."
|
| *
|
| * ATTENTION TODO: This seems not needed if the type implicitely
|
| * derived from the base type.
|
| - *
|
| + *
|
| */
|
| err = xmlSchemaCheckCOSSTDerivedOK(ACTXT_CAST ctxt,
|
| type->contentTypeDef, base->contentTypeDef, 0);
|
| @@ -16382,8 +16453,8 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
|
| (xmlSchemaParticlePtr) base->subtypes))) {
|
| /*
|
| * SPEC (5.2.2.2) "The {base type definition} must be mixed
|
| - * and have a particle which is ·emptiable· as defined in
|
| - * Particle Emptiable (§3.9.6)."
|
| + * and have a particle which is �emptiable� as defined in
|
| + * Particle Emptiable (�3.9.6)."
|
| * PASS
|
| */
|
| } else {
|
| @@ -16412,7 +16483,7 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
|
| /*
|
| * SPEC (5.3.2.2) "The {content type} of the {base type
|
| * definition} must be elementOnly or mixed and have a particle
|
| - * which is ·emptiable· as defined in Particle Emptiable (§3.9.6)."
|
| + * which is �emptiable� as defined in Particle Emptiable (�3.9.6)."
|
| * PASS
|
| */
|
| } else {
|
| @@ -16429,7 +16500,7 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
|
| /*
|
| * SPEC (5.4.1.1) "The {content type} of the complex type definition
|
| * itself must be element-only"
|
| - */
|
| + */
|
| if (WXS_HAS_MIXED_CONTENT(type) && (! WXS_HAS_MIXED_CONTENT(base))) {
|
| /*
|
| * SPEC (5.4.1.2) "The {content type} of the complex type
|
| @@ -16445,9 +16516,9 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
|
| }
|
| /*
|
| * SPEC (5.4.2) "The particle of the complex type definition itself
|
| - * must be a ·valid restriction· of the particle of the {content
|
| + * must be a �valid restriction� of the particle of the {content
|
| * type} of the {base type definition} as defined in Particle Valid
|
| - * (Restriction) (§3.9.6).
|
| + * (Restriction) (�3.9.6).
|
| *
|
| * URGENT TODO: (5.4.2)
|
| */
|
| @@ -16516,7 +16587,7 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt,
|
| if (! WXS_HAS_SIMPLE_CONTENT(type)) {
|
| /*
|
| * 1 If the <complexContent> alternative is chosen, the type definition
|
| - * ·resolved· to by the ·actual value· of the base [attribute]
|
| + * �resolved� to by the �actual value� of the base [attribute]
|
| * must be a complex type definition;
|
| */
|
| if (! WXS_IS_COMPLEX(base)) {
|
| @@ -16536,7 +16607,7 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt,
|
| * SPEC
|
| * 2 If the <simpleContent> alternative is chosen, all of the
|
| * following must be true:
|
| - * 2.1 The type definition ·resolved· to by the ·actual value· of the
|
| + * 2.1 The type definition �resolved� to by the �actual value� of the
|
| * base [attribute] must be one of the following:
|
| */
|
| if (WXS_IS_SIMPLE(base)) {
|
| @@ -16586,11 +16657,11 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt,
|
| if (! xmlSchemaIsParticleEmptiable(
|
| (xmlSchemaParticlePtr) base->subtypes)) {
|
| ret = XML_SCHEMAP_SRC_CT_1;
|
| - } else
|
| + } else
|
| /*
|
| * Attention: at this point the <simpleType> child is in
|
| * ->contentTypeDef (put there during parsing).
|
| - */
|
| + */
|
| if (type->contentTypeDef == NULL) {
|
| xmlChar *str = NULL;
|
| /*
|
| @@ -16642,14 +16713,14 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt,
|
| /*
|
| * SPEC (3) "The corresponding complex type definition component must
|
| * satisfy the conditions set out in Constraints on Complex Type
|
| - * Definition Schema Components (§3.4.6);"
|
| + * Definition Schema Components (�3.4.6);"
|
| * NOTE (3) will be done in xmlSchemaTypeFixup().
|
| */
|
| /*
|
| * SPEC (4) If clause 2.2.1 or clause 2.2.2 in the correspondence specification
|
| * above for {attribute wildcard} is satisfied, the intensional
|
| * intersection must be expressible, as defined in Attribute Wildcard
|
| - * Intersection (§3.10.6).
|
| + * Intersection (�3.10.6).
|
| * NOTE (4) is done in xmlSchemaFixupTypeAttributeUses().
|
| */
|
| return (ret);
|
| @@ -16720,7 +16791,7 @@ xmlSchemaCheckRCaseNameAndTypeOK(xmlSchemaParserCtxtPtr ctxt,
|
| return (1);
|
| /*
|
| * SPEC (2) "R's occurrence range is a valid restriction of B's
|
| - * occurrence range as defined by Occurrence Range OK (§3.9.6)."
|
| + * occurrence range as defined by Occurrence Range OK (�3.9.6)."
|
| */
|
| if (xmlSchemaCheckParticleRangeOK(r->minOccurs, r->maxOccurs,
|
| b->minOccurs, b->maxOccurs) != 0)
|
| @@ -16812,19 +16883,19 @@ xmlSchemaCheckRCaseNSCompat(xmlSchemaParserCtxtPtr ctxt,
|
| {
|
| /* TODO:Error codes (rcase-NSCompat). */
|
| /*
|
| - * SPEC "For an element declaration particle to be a ·valid restriction·
|
| + * SPEC "For an element declaration particle to be a �valid restriction�
|
| * of a wildcard particle all of the following must be true:"
|
| *
|
| - * SPEC (1) "The element declaration's {target namespace} is ·valid·
|
| + * SPEC (1) "The element declaration's {target namespace} is �valid�
|
| * with respect to the wildcard's {namespace constraint} as defined by
|
| - * Wildcard allows Namespace Name (§3.10.4)."
|
| + * Wildcard allows Namespace Name (�3.10.4)."
|
| */
|
| if (xmlSchemaCheckCVCWildcardNamespace((xmlSchemaWildcardPtr) b->children,
|
| ((xmlSchemaElementPtr) r->children)->targetNamespace) != 0)
|
| return (1);
|
| /*
|
| * SPEC (2) "R's occurrence range is a valid restriction of B's
|
| - * occurrence range as defined by Occurrence Range OK (§3.9.6)."
|
| + * occurrence range as defined by Occurrence Range OK (�3.9.6)."
|
| */
|
| if (xmlSchemaCheckParticleRangeOK(r->minOccurs, r->maxOccurs,
|
| b->minOccurs, b->maxOccurs) != 0)
|
| @@ -16884,21 +16955,21 @@ xmlSchemaCheckRCaseNSSubset(xmlSchemaParserCtxtPtr ctxt,
|
| /* TODO: Error codes (rcase-NSSubset). */
|
| /*
|
| * SPEC (1) "R's occurrence range is a valid restriction of B's
|
| - * occurrence range as defined by Occurrence Range OK (§3.9.6)."
|
| + * occurrence range as defined by Occurrence Range OK (�3.9.6)."
|
| */
|
| if (xmlSchemaCheckParticleRangeOK(r->minOccurs, r->maxOccurs,
|
| b->minOccurs, b->maxOccurs))
|
| return (1);
|
| /*
|
| * SPEC (2) "R's {namespace constraint} must be an intensional subset
|
| - * of B's {namespace constraint} as defined by Wildcard Subset (§3.10.6)."
|
| + * of B's {namespace constraint} as defined by Wildcard Subset (�3.10.6)."
|
| */
|
| if (xmlSchemaCheckCOSNSSubset((xmlSchemaWildcardPtr) r->children,
|
| (xmlSchemaWildcardPtr) b->children))
|
| return (1);
|
| /*
|
| - * SPEC (3) "Unless B is the content model wildcard of the ·ur-type
|
| - * definition·, R's {process contents} must be identical to or stronger
|
| + * SPEC (3) "Unless B is the content model wildcard of the �ur-type
|
| + * definition�, R's {process contents} must be identical to or stronger
|
| * than B's {process contents}, where strict is stronger than lax is
|
| * stronger than skip."
|
| */
|
| @@ -16948,6 +17019,7 @@ xmlSchemaCheckCOSParticleRestrict(xmlSchemaParserCtxtPtr ctxt,
|
| return (0);
|
| }
|
|
|
| +#if 0
|
| /**
|
| * xmlSchemaCheckRCaseNSRecurseCheckCardinality:
|
| * @ctxt: the schema parser context
|
| @@ -16975,12 +17047,12 @@ xmlSchemaCheckRCaseNSRecurseCheckCardinality(xmlSchemaParserCtxtPtr ctxt,
|
| if ((r->children == NULL) || (r->children->children == NULL))
|
| return (-1);
|
| /*
|
| - * SPEC "For a group particle to be a ·valid restriction· of a
|
| + * SPEC "For a group particle to be a �valid restriction� of a
|
| * wildcard particle..."
|
| *
|
| - * SPEC (1) "Every member of the {particles} of the group is a ·valid
|
| - * restriction· of the wildcard as defined by
|
| - * Particle Valid (Restriction) (§3.9.6)."
|
| + * SPEC (1) "Every member of the {particles} of the group is a �valid
|
| + * restriction� of the wildcard as defined by
|
| + * Particle Valid (Restriction) (�3.9.6)."
|
| */
|
| part = (xmlSchemaParticlePtr) r->children->children;
|
| do {
|
| @@ -16991,7 +17063,7 @@ xmlSchemaCheckRCaseNSRecurseCheckCardinality(xmlSchemaParserCtxtPtr ctxt,
|
| /*
|
| * SPEC (2) "The effective total range of the group [...] is a
|
| * valid restriction of B's occurrence range as defined by
|
| - * Occurrence Range OK (§3.9.6)."
|
| + * Occurrence Range OK (�3.9.6)."
|
| */
|
| if (xmlSchemaCheckParticleRangeOK(
|
| xmlSchemaGetParticleTotalRangeMin(r),
|
| @@ -17000,6 +17072,7 @@ xmlSchemaCheckRCaseNSRecurseCheckCardinality(xmlSchemaParserCtxtPtr ctxt,
|
| return (1);
|
| return (0);
|
| }
|
| +#endif
|
|
|
| /**
|
| * xmlSchemaCheckRCaseRecurse:
|
| @@ -17030,11 +17103,11 @@ xmlSchemaCheckRCaseRecurse(xmlSchemaParserCtxtPtr ctxt,
|
| (r->children->type != b->children->type))
|
| return (-1);
|
| /*
|
| - * SPEC "For an all or sequence group particle to be a ·valid
|
| - * restriction· of another group particle with the same {compositor}..."
|
| + * SPEC "For an all or sequence group particle to be a �valid
|
| + * restriction� of another group particle with the same {compositor}..."
|
| *
|
| * SPEC (1) "R's occurrence range is a valid restriction of B's
|
| - * occurrence range as defined by Occurrence Range OK (§3.9.6)."
|
| + * occurrence range as defined by Occurrence Range OK (�3.9.6)."
|
| */
|
| if (xmlSchemaCheckParticleRangeOK(r->minOccurs, r->maxOccurs,
|
| b->minOccurs, b->maxOccurs))
|
| @@ -17131,7 +17204,7 @@ xmlSchemaDeriveAndValidateFacets(xmlSchemaParserCtxtPtr pctxt,
|
|
|
| /*
|
| * SPEC st-restrict-facets 1:
|
| - * "The {variety} of R is the same as that of B."
|
| + * "The {variety} of R is the same as that of B."
|
| */
|
| /*
|
| * SPEC st-restrict-facets 2:
|
| @@ -17285,7 +17358,7 @@ xmlSchemaDeriveAndValidateFacets(xmlSchemaParserCtxtPtr pctxt,
|
| flength = bflength;
|
| if (flength) {
|
| if (! fminlen)
|
| - flength = bflength;
|
| + fminlen = bfminlen;
|
| if (fminlen) {
|
| /* (1.1) length >= minLength */
|
| res = xmlSchemaCompareValues(flength->val, fminlen->val);
|
| @@ -17603,7 +17676,7 @@ xmlSchemaDeriveAndValidateFacets(xmlSchemaParserCtxtPtr pctxt,
|
| * The whitespace must be stronger.
|
| */
|
| if (facet->whitespace < bfacet->whitespace) {
|
| - FACET_RESTR_ERR(flength,
|
| + FACET_RESTR_ERR(facet,
|
| "The 'whitespace' value has to be equal to "
|
| "or stronger than the 'whitespace' value of "
|
| "the base type")
|
| @@ -17658,7 +17731,7 @@ xmlSchemaFinishMemberTypeDefinitionsProperty(xmlSchemaParserCtxtPtr pctxt,
|
| xmlSchemaTypeLinkPtr link, lastLink, prevLink, subLink, newLink;
|
| /*
|
| * The actual value is then formed by replacing any union type
|
| - * definition in the ·explicit members· with the members of their
|
| + * definition in the �explicit members� with the members of their
|
| * {member type definitions}, in order.
|
| *
|
| * TODO: There's a bug entry at
|
| @@ -17704,7 +17777,7 @@ xmlSchemaFinishMemberTypeDefinitionsProperty(xmlSchemaParserCtxtPtr pctxt,
|
|
|
| static void
|
| xmlSchemaTypeFixupOptimFacets(xmlSchemaTypePtr type)
|
| -{
|
| +{
|
| int has = 0, needVal = 0, normVal = 0;
|
|
|
| has = (type->baseType->flags & XML_SCHEMAS_TYPE_HAS_FACETS) ? 1 : 0;
|
| @@ -17716,7 +17789,7 @@ xmlSchemaTypeFixupOptimFacets(xmlSchemaTypePtr type)
|
| }
|
| if (type->facets != NULL) {
|
| xmlSchemaFacetPtr fac;
|
| -
|
| +
|
| for (fac = type->facets; fac != NULL; fac = fac->next) {
|
| switch (fac->type) {
|
| case XML_SCHEMA_FACET_WHITESPACE:
|
| @@ -17734,7 +17807,7 @@ xmlSchemaTypeFixupOptimFacets(xmlSchemaTypePtr type)
|
| has = 1;
|
| break;
|
| }
|
| - }
|
| + }
|
| }
|
| if (normVal)
|
| type->flags |= XML_SCHEMAS_TYPE_NORMVALUENEEDED;
|
| @@ -17751,24 +17824,24 @@ xmlSchemaTypeFixupOptimFacets(xmlSchemaTypePtr type)
|
| if ((prim->builtInType != XML_SCHEMAS_ANYSIMPLETYPE) &&
|
| (prim->builtInType != XML_SCHEMAS_STRING)) {
|
| type->flags |= XML_SCHEMAS_TYPE_FACETSNEEDVALUE;
|
| - }
|
| - }
|
| + }
|
| + }
|
| }
|
|
|
| static int
|
| xmlSchemaTypeFixupWhitespace(xmlSchemaTypePtr type)
|
| {
|
| -
|
| -
|
| +
|
| +
|
| /*
|
| * Evaluate the whitespace-facet value.
|
| - */
|
| + */
|
| if (WXS_IS_LIST(type)) {
|
| type->flags |= XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE;
|
| return (0);
|
| } else if (WXS_IS_UNION(type))
|
| return (0);
|
| -
|
| +
|
| if (type->facetSet != NULL) {
|
| xmlSchemaFacetLinkPtr lin;
|
|
|
| @@ -17792,23 +17865,23 @@ xmlSchemaTypeFixupWhitespace(xmlSchemaTypePtr type)
|
| }
|
| }
|
| /*
|
| - * For all ·atomic· datatypes other than string (and types ·derived·
|
| - * by ·restriction· from it) the value of whiteSpace is fixed to
|
| + * For all �atomic� datatypes other than string (and types �derived�
|
| + * by �restriction� from it) the value of whiteSpace is fixed to
|
| * collapse
|
| */
|
| {
|
| xmlSchemaTypePtr anc;
|
|
|
| - for (anc = type->baseType; anc != NULL &&
|
| + for (anc = type->baseType; anc != NULL &&
|
| anc->builtInType != XML_SCHEMAS_ANYTYPE;
|
| anc = anc->baseType) {
|
|
|
| if (anc->type == XML_SCHEMA_TYPE_BASIC) {
|
| - if (anc->builtInType == XML_SCHEMAS_NORMSTRING) {
|
| + if (anc->builtInType == XML_SCHEMAS_NORMSTRING) {
|
| type->flags |= XML_SCHEMAS_TYPE_WHITESPACE_REPLACE;
|
|
|
| } else if ((anc->builtInType == XML_SCHEMAS_STRING) ||
|
| - (anc->builtInType == XML_SCHEMAS_ANYSIMPLETYPE)) {
|
| + (anc->builtInType == XML_SCHEMAS_ANYSIMPLETYPE)) {
|
| type->flags |= XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE;
|
|
|
| } else
|
| @@ -17845,7 +17918,7 @@ xmlSchemaFixupSimpleTypeStageOne(xmlSchemaParserCtxtPtr pctxt,
|
| } else if (WXS_IS_UNION(type)) {
|
| /*
|
| * Corresponds to <simpleType><union>...
|
| - */
|
| + */
|
| if (type->memberTypes == NULL) {
|
| /*
|
| * This one is really needed, so get out.
|
| @@ -17853,8 +17926,8 @@ xmlSchemaFixupSimpleTypeStageOne(xmlSchemaParserCtxtPtr pctxt,
|
| PERROR_INT("xmlSchemaFixupSimpleTypeStageOne",
|
| "union type has no member-types assigned");
|
| return(-1);
|
| - }
|
| - } else {
|
| + }
|
| + } else {
|
| /*
|
| * Corresponds to <simpleType><restriction>...
|
| */
|
| @@ -17969,7 +18042,7 @@ xmlSchemaFixupSimpleTypeStageTwo(xmlSchemaParserCtxtPtr pctxt,
|
| }
|
| if (WXS_IS_TYPE_NOT_FIXED(type->baseType))
|
| xmlSchemaTypeFixup(type->baseType, ACTXT_CAST pctxt);
|
| - /*
|
| + /*
|
| * If a member type of a union is a union itself, we need to substitute
|
| * that member type for its member types.
|
| * NOTE that this might change in WXS 1.1; i.e. we will keep the union
|
| @@ -17977,12 +18050,12 @@ xmlSchemaFixupSimpleTypeStageTwo(xmlSchemaParserCtxtPtr pctxt,
|
| */
|
| if ((type->memberTypes != NULL) &&
|
| (xmlSchemaFinishMemberTypeDefinitionsProperty(pctxt, type) == -1))
|
| - return(-1);
|
| + return(-1);
|
| /*
|
| - * SPEC src-simple-type 1
|
| + * SPEC src-simple-type 1
|
| * "The corresponding simple type definition, if any, must satisfy
|
| * the conditions set out in Constraints on Simple Type Definition
|
| - * Schema Components (§3.14.6)."
|
| + * Schema Components (�3.14.6)."
|
| */
|
| /*
|
| * Schema Component Constraint: Simple Type Definition Properties Correct
|
| @@ -17990,7 +18063,7 @@ xmlSchemaFixupSimpleTypeStageTwo(xmlSchemaParserCtxtPtr pctxt,
|
| */
|
| res = xmlSchemaCheckSTPropsCorrect(pctxt, type);
|
| HFAILURE HERROR
|
| - /*
|
| + /*
|
| * Schema Component Constraint: Derivation Valid (Restriction, Simple)
|
| * (cos-st-restricts)
|
| */
|
| @@ -18023,7 +18096,7 @@ xmlSchemaFixupSimpleTypeStageTwo(xmlSchemaParserCtxtPtr pctxt,
|
| */
|
| res = xmlSchemaTypeFixupWhitespace(type);
|
| HFAILURE HERROR
|
| - xmlSchemaTypeFixupOptimFacets(type);
|
| + xmlSchemaTypeFixupOptimFacets(type);
|
|
|
| exit_error:
|
| #ifdef DEBUG_TYPE
|
| @@ -18054,7 +18127,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
|
| PERROR_INT("xmlSchemaFixupComplexType",
|
| "missing baseType");
|
| goto exit_failure;
|
| - }
|
| + }
|
| /*
|
| * Fixup the base type.
|
| */
|
| @@ -18066,12 +18139,12 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
|
| * TODO: Generate a warning!
|
| */
|
| return(0);
|
| - }
|
| + }
|
| /*
|
| * This basically checks if the base type can be derived.
|
| */
|
| res = xmlSchemaCheckSRCCT(pctxt, type);
|
| - HFAILURE HERROR
|
| + HFAILURE HERROR
|
| /*
|
| * Fixup the content type.
|
| */
|
| @@ -18145,7 +18218,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
|
| type->facets = NULL;
|
| content->facetSet = type->facetSet;
|
| type->facetSet = NULL;
|
| -
|
| +
|
| type->contentTypeDef = content;
|
| if (WXS_IS_TYPE_NOT_FIXED(contentBase))
|
| xmlSchemaTypeFixup(contentBase, ACTXT_CAST pctxt);
|
| @@ -18154,10 +18227,10 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
|
| * for circularity here.
|
| */
|
| res = xmlSchemaFixupSimpleTypeStageOne(pctxt, content);
|
| - HFAILURE HERROR
|
| + HFAILURE HERROR
|
| res = xmlSchemaFixupSimpleTypeStageTwo(pctxt, content);
|
| - HFAILURE HERROR
|
| -
|
| + HFAILURE HERROR
|
| +
|
| } else if ((WXS_IS_COMPLEX(baseType)) &&
|
| (baseType->contentType == XML_SCHEMA_CONTENT_MIXED) &&
|
| (WXS_IS_RESTRICTION(type))) {
|
| @@ -18242,7 +18315,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
|
| ( ((xmlSchemaTreeItemPtr) particle->children)->children == NULL))) {
|
| if (type->flags & XML_SCHEMAS_TYPE_MIXED) {
|
| /*
|
| - * SPEC (2.1.4) "If the ·effective mixed· is true, then
|
| + * SPEC (2.1.4) "If the �effective mixed� is true, then
|
| * a particle whose properties are as follows:..."
|
| *
|
| * Empty sequence model group with
|
| @@ -18267,7 +18340,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
|
| XML_SCHEMA_TYPE_SEQUENCE, type->node);
|
| if (particle->children == NULL)
|
| goto exit_failure;
|
| -
|
| +
|
| type->subtypes = (xmlSchemaTypePtr) particle;
|
| }
|
| dummySequence = 1;
|
| @@ -18304,7 +18377,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
|
| if (type->contentType == XML_SCHEMA_CONTENT_EMPTY) {
|
| /*
|
| * SPEC (3.2.1)
|
| - * "If the ·effective content· is empty, then the
|
| + * "If the �effective content� is empty, then the
|
| * {content type} of the [...] base ..."
|
| */
|
| type->contentType = baseType->contentType;
|
| @@ -18411,7 +18484,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
|
| particle->children =
|
| ((xmlSchemaParticlePtr) baseType->subtypes)->children;
|
| /*
|
| - * SPEC "followed by the ·effective content·."
|
| + * SPEC "followed by the �effective content�."
|
| */
|
| particle->next = effectiveContent;
|
| /*
|
| @@ -18555,12 +18628,12 @@ xmlSchemaCheckFacet(xmlSchemaFacetPtr facet,
|
|
|
| /* 4.3.5.5 Constraints on enumeration Schema Components
|
| * Schema Component Constraint: enumeration valid restriction
|
| - * It is an ·error· if any member of {value} is not in the
|
| - * ·value space· of {base type definition}.
|
| + * It is an �error� if any member of {value} is not in the
|
| + * �value space� of {base type definition}.
|
| *
|
| * minInclusive, maxInclusive, minExclusive, maxExclusive:
|
| - * The value ·must· be in the
|
| - * ·value space· of the ·base type·.
|
| + * The value �must� be in the
|
| + * �value space� of the �base type�.
|
| */
|
| /*
|
| * This function is intended to deliver a compiled value
|
| @@ -18580,11 +18653,11 @@ xmlSchemaCheckFacet(xmlSchemaFacetPtr facet,
|
| }
|
| } else
|
| base = typeDecl;
|
| -
|
| +
|
| if (! ctxtGiven) {
|
| /*
|
| * A context is needed if called from RelaxNG.
|
| - */
|
| + */
|
| pctxt = xmlSchemaNewParserCtxt("*");
|
| if (pctxt == NULL)
|
| return (-1);
|
| @@ -18595,17 +18668,17 @@ xmlSchemaCheckFacet(xmlSchemaFacetPtr facet,
|
| * facet->node is just the node holding the facet
|
| * definition, *not* the attribute holding the *value*
|
| * of the facet.
|
| - */
|
| + */
|
| ret = xmlSchemaVCheckCVCSimpleType(
|
| ACTXT_CAST pctxt, facet->node, base,
|
| facet->value, &(facet->val), 1, 1, 0);
|
| if (ret != 0) {
|
| if (ret < 0) {
|
| /* No error message for RelaxNG. */
|
| - if (ctxtGiven) {
|
| + if (ctxtGiven) {
|
| xmlSchemaCustomErr(ACTXT_CAST pctxt,
|
| XML_SCHEMAP_INTERNAL, facet->node, NULL,
|
| - "Internal error: xmlSchemaCheckFacet, "
|
| + "Internal error: xmlSchemaCheckFacet, "
|
| "failed to validate the value '%s' of the "
|
| "facet '%s' against the base type",
|
| facet->value, xmlSchemaFacetTypeToString(facet->type));
|
| @@ -18680,17 +18753,17 @@ xmlSchemaCheckFacet(xmlSchemaFacetPtr facet,
|
| /* error code */
|
| xmlSchemaCustomErr4(ACTXT_CAST pctxt,
|
| ret, facet->node, WXS_BASIC_CAST typeDecl,
|
| - "The value '%s' of the facet '%s' is not a valid '%s'",
|
| + "The value '%s' of the facet '%s' is not a valid '%s'",
|
| facet->value,
|
| xmlSchemaFacetTypeToString(facet->type),
|
| - (facet->type != XML_SCHEMA_FACET_TOTALDIGITS) ?
|
| + (facet->type != XML_SCHEMA_FACET_TOTALDIGITS) ?
|
| BAD_CAST "nonNegativeInteger" :
|
| BAD_CAST "positiveInteger",
|
| NULL);
|
| }
|
| }
|
| break;
|
| -
|
| +
|
| case XML_SCHEMA_FACET_WHITESPACE:{
|
| if (xmlStrEqual(facet->value, BAD_CAST "preserve")) {
|
| facet->whitespace = XML_SCHEMAS_FACET_PRESERVE;
|
| @@ -18903,7 +18976,7 @@ xmlSchemaModelGroupToModelGroupDefFixup(
|
| {
|
| particle = WXS_PTC_CAST particle->next;
|
| continue;
|
| - }
|
| + }
|
| if (WXS_MODELGROUPDEF_MODEL(WXS_PARTICLE_TERM(particle)) == NULL) {
|
| /*
|
| * TODO: Remove the particle.
|
| @@ -18953,7 +19026,7 @@ xmlSchemaCheckAttrGroupCircularRecur(xmlSchemaAttributeGroupPtr ctxtGr,
|
| if (gr == ctxtGr)
|
| return(ref);
|
| if (gr->flags & XML_SCHEMAS_ATTRGROUP_MARKED)
|
| - continue;
|
| + continue;
|
| /*
|
| * Mark as visited to avoid infinite recursion on
|
| * circular references not yet examined.
|
| @@ -18963,12 +19036,12 @@ xmlSchemaCheckAttrGroupCircularRecur(xmlSchemaAttributeGroupPtr ctxtGr,
|
| {
|
| gr->flags |= XML_SCHEMAS_ATTRGROUP_MARKED;
|
| circ = xmlSchemaCheckAttrGroupCircularRecur(ctxtGr,
|
| - (xmlSchemaItemListPtr) gr->attrUses);
|
| + (xmlSchemaItemListPtr) gr->attrUses);
|
| gr->flags ^= XML_SCHEMAS_ATTRGROUP_MARKED;
|
| if (circ != NULL)
|
| return (circ);
|
| }
|
| -
|
| +
|
| }
|
| }
|
| return (NULL);
|
| @@ -18995,9 +19068,9 @@ xmlSchemaCheckAttrGroupCircular(xmlSchemaAttributeGroupPtr attrGr,
|
| * not be an <attributeGroup> with ref [attribute] which resolves
|
| * to the component corresponding to this <attributeGroup>. Indirect
|
| * circularity is also ruled out. That is, when QName resolution
|
| - * (Schema Document) (§3.15.3) is applied to a ·QName· arising from
|
| + * (Schema Document) (�3.15.3) is applied to a �QName� arising from
|
| * any <attributeGroup>s with a ref [attribute] among the [children],
|
| - * it must not be the case that a ·QName· is encountered at any depth
|
| + * it must not be the case that a �QName� is encountered at any depth
|
| * which resolves to the component corresponding to this <attributeGroup>.
|
| */
|
| if (attrGr->attrUses == NULL)
|
| @@ -19006,9 +19079,9 @@ xmlSchemaCheckAttrGroupCircular(xmlSchemaAttributeGroupPtr attrGr,
|
| return(0);
|
| else {
|
| xmlSchemaQNameRefPtr circ;
|
| -
|
| +
|
| circ = xmlSchemaCheckAttrGroupCircularRecur(attrGr,
|
| - (xmlSchemaItemListPtr) attrGr->attrUses);
|
| + (xmlSchemaItemListPtr) attrGr->attrUses);
|
| if (circ != NULL) {
|
| xmlChar *str = NULL;
|
| /*
|
| @@ -19040,7 +19113,7 @@ xmlSchemaAttributeGroupExpandRefs(xmlSchemaParserCtxtPtr pctxt,
|
| * xmlSchemaExpandAttributeGroupRefs:
|
| * @pctxt: the parser context
|
| * @node: the node of the component holding the attribute uses
|
| - * @completeWild: the intersected wildcard to be returned
|
| + * @completeWild: the intersected wildcard to be returned
|
| * @list: the attribute uses
|
| *
|
| * Substitutes contained attribute group references
|
| @@ -19069,7 +19142,7 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt,
|
| for (i = 0; i < list->nbItems; i++) {
|
| use = list->items[i];
|
|
|
| - if (use->type == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB) {
|
| + if (use->type == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB) {
|
| if (prohibs == NULL) {
|
| PERROR_INT("xmlSchemaExpandAttributeGroupRefs",
|
| "unexpected attr prohibition found");
|
| @@ -19084,7 +19157,7 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt,
|
| /*
|
| * Note that duplicate prohibitions were already
|
| * handled at parsing time.
|
| - */
|
| + */
|
| /*
|
| * Add to list of prohibitions.
|
| */
|
| @@ -19137,7 +19210,7 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt,
|
| *completeWild = tmpWild;
|
| created = 1;
|
| }
|
| -
|
| +
|
| if (xmlSchemaIntersectWildcards(pctxt, *completeWild,
|
| gr->attributeWildcard) == -1)
|
| return(-1);
|
| @@ -19211,7 +19284,7 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt,
|
| /**
|
| * xmlSchemaAttributeGroupExpandRefs:
|
| * @pctxt: the parser context
|
| - * @attrGr: the attribute group definition
|
| + * @attrGr: the attribute group definition
|
| *
|
| * Computation of:
|
| * {attribute uses} property
|
| @@ -19223,7 +19296,7 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt,
|
| static int
|
| xmlSchemaAttributeGroupExpandRefs(xmlSchemaParserCtxtPtr pctxt,
|
| xmlSchemaAttributeGroupPtr attrGr)
|
| -{
|
| +{
|
| if ((attrGr->attrUses == NULL) ||
|
| (attrGr->flags & XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED))
|
| return(0);
|
| @@ -19231,33 +19304,33 @@ xmlSchemaAttributeGroupExpandRefs(xmlSchemaParserCtxtPtr pctxt,
|
| attrGr->flags |= XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED;
|
| if (xmlSchemaExpandAttributeGroupRefs(pctxt, WXS_BASIC_CAST attrGr,
|
| &(attrGr->attributeWildcard), attrGr->attrUses, NULL) == -1)
|
| - return(-1);
|
| + return(-1);
|
| return(0);
|
| }
|
|
|
| /**
|
| * xmlSchemaAttributeGroupExpandRefs:
|
| * @pctxt: the parser context
|
| - * @attrGr: the attribute group definition
|
| + * @attrGr: the attribute group definition
|
| *
|
| * Substitutes contained attribute group references
|
| * for their attribute uses. Wilcards are intersected.
|
| - *
|
| + *
|
| * Schema Component Constraint:
|
| - * Attribute Group Definition Properties Correct (ag-props-correct)
|
| + * Attribute Group Definition Properties Correct (ag-props-correct)
|
| */
|
| static int
|
| xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
|
| xmlSchemaAttributeGroupPtr attrGr)
|
| -{
|
| +{
|
| /*
|
| * SPEC ag-props-correct
|
| * (1) "The values of the properties of an attribute group definition
|
| * must be as described in the property tableau in The Attribute
|
| - * Group Definition Schema Component (§3.6.1), modulo the impact of
|
| - * Missing Sub-components (§5.3);"
|
| + * Group Definition Schema Component (�3.6.1), modulo the impact of
|
| + * Missing Sub-components (�5.3);"
|
| */
|
| -
|
| +
|
| if ((attrGr->attrUses != NULL) &&
|
| (WXS_LIST_CAST attrGr->attrUses)->nbItems > 1)
|
| {
|
| @@ -19266,7 +19339,7 @@ xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
|
| int i, j, hasId = 0;
|
|
|
| for (i = uses->nbItems -1; i >= 0; i--) {
|
| - use = uses->items[i];
|
| + use = uses->items[i];
|
| /*
|
| * SPEC ag-props-correct
|
| * (2) "Two distinct members of the {attribute uses} must not have
|
| @@ -19282,7 +19355,7 @@ xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
|
| WXS_ATTRUSE_DECL_TNS(tmp)))
|
| {
|
| xmlChar *str = NULL;
|
| -
|
| +
|
| xmlSchemaCustomErr(ACTXT_CAST pctxt,
|
| XML_SCHEMAP_AG_PROPS_CORRECT,
|
| attrGr->node, WXS_BASIC_CAST attrGr,
|
| @@ -19306,13 +19379,13 @@ xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
|
| * are derived from ID."
|
| * TODO: Does 'derived' include member-types of unions?
|
| */
|
| - if (WXS_ATTRUSE_TYPEDEF(use) != NULL) {
|
| + if (WXS_ATTRUSE_TYPEDEF(use) != NULL) {
|
| if (xmlSchemaIsDerivedFromBuiltInType(
|
| WXS_ATTRUSE_TYPEDEF(use), XML_SCHEMAS_ID))
|
| - {
|
| + {
|
| if (hasId) {
|
| xmlChar *str = NULL;
|
| -
|
| +
|
| xmlSchemaCustomErr(ACTXT_CAST pctxt,
|
| XML_SCHEMAP_AG_PROPS_CORRECT,
|
| attrGr->node, WXS_BASIC_CAST attrGr,
|
| @@ -19325,7 +19398,7 @@ xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
|
| FREE_AND_NULL(str);
|
| if (xmlSchemaItemListRemove(uses, i) == -1)
|
| return(-1);
|
| - }
|
| + }
|
| hasId = 1;
|
| }
|
| }
|
| @@ -19389,10 +19462,10 @@ xmlSchemaCheckAttrPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
|
| * SPEC a-props-correct (1)
|
| * "The values of the properties of an attribute declaration must
|
| * be as described in the property tableau in The Attribute
|
| - * Declaration Schema Component (§3.2.1), modulo the impact of
|
| - * Missing Sub-components (§5.3)."
|
| + * Declaration Schema Component (�3.2.1), modulo the impact of
|
| + * Missing Sub-components (�5.3)."
|
| */
|
| -
|
| +
|
| if (WXS_ATTR_TYPEDEF(attr) == NULL)
|
| return(0);
|
|
|
| @@ -19418,8 +19491,8 @@ xmlSchemaCheckAttrPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
|
| /*
|
| * SPEC a-props-correct (2)
|
| * "if there is a {value constraint}, the canonical lexical
|
| - * representation of its value must be ·valid· with respect
|
| - * to the {type definition} as defined in String Valid (§3.14.4)."
|
| + * representation of its value must be �valid� with respect
|
| + * to the {type definition} as defined in String Valid (�3.14.4)."
|
| * TODO: Don't care about the *cononical* stuff here, this requirement
|
| * will be removed in WXS 1.1 anyway.
|
| */
|
| @@ -19441,7 +19514,7 @@ xmlSchemaCheckAttrPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
|
| return(pctxt->err);
|
| }
|
| }
|
| -
|
| +
|
| return(0);
|
| }
|
|
|
| @@ -19487,15 +19560,15 @@ xmlSchemaCheckElemPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
|
| /*
|
| * SPEC (1) "The values of the properties of an element declaration
|
| * must be as described in the property tableau in The Element
|
| - * Declaration Schema Component (§3.3.1), modulo the impact of Missing
|
| - * Sub-components (§5.3)."
|
| + * Declaration Schema Component (�3.3.1), modulo the impact of Missing
|
| + * Sub-components (�5.3)."
|
| */
|
| if (WXS_SUBST_HEAD(elemDecl) != NULL) {
|
| xmlSchemaElementPtr head = WXS_SUBST_HEAD(elemDecl), circ;
|
|
|
| xmlSchemaCheckElementDeclComponent(head, pctxt);
|
| /*
|
| - * SPEC (3) "If there is a non-·absent· {substitution group
|
| + * SPEC (3) "If there is a non-�absent� {substitution group
|
| * affiliation}, then {scope} must be global."
|
| */
|
| if ((elemDecl->flags & XML_SCHEMAS_ELEM_GLOBAL) == 0) {
|
| @@ -19539,9 +19612,9 @@ xmlSchemaCheckElemPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
|
| * of the element declaration must be validly derived from the {type
|
| * definition} of the {substitution group affiliation}, given the value
|
| * of the {substitution group exclusions} of the {substitution group
|
| - * affiliation}, as defined in Type Derivation OK (Complex) (§3.4.6)
|
| + * affiliation}, as defined in Type Derivation OK (Complex) (�3.4.6)
|
| * (if the {type definition} is complex) or as defined in
|
| - * Type Derivation OK (Simple) (§3.14.6) (if the {type definition} is
|
| + * Type Derivation OK (Simple) (�3.14.6) (if the {type definition} is
|
| * simple)."
|
| *
|
| * NOTE: {substitution group exclusions} means the values of the
|
| @@ -19605,9 +19678,9 @@ xmlSchemaCheckElemPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
|
|
|
| /*
|
| * SPEC (2) "If there is a {value constraint}, the canonical lexical
|
| - * representation of its value must be ·valid· with respect to the
|
| + * representation of its value must be �valid� with respect to the
|
| * {type definition} as defined in Element Default Valid (Immediate)
|
| - * (§3.3.6)."
|
| + * (�3.3.6)."
|
| */
|
| if (typeDef == NULL) {
|
| xmlSchemaPErr(pctxt, elemDecl->node,
|
| @@ -19675,7 +19748,7 @@ xmlSchemaCheckElemSubstGroup(xmlSchemaParserCtxtPtr ctxt,
|
| /*
|
| * SPEC (2) "It is validly substitutable for HEAD subject to HEAD's
|
| * {disallowed substitutions} as the blocking constraint, as defined in
|
| - * Substitution Group OK (Transitive) (§3.3.6)."
|
| + * Substitution Group OK (Transitive) (�3.3.6)."
|
| */
|
| for (head = WXS_SUBST_HEAD(elemDecl); head != NULL;
|
| head = WXS_SUBST_HEAD(head)) {
|
| @@ -19767,12 +19840,12 @@ add_member:
|
| * @ctxtParticle: the first particle of the context component
|
| * @searchParticle: the element declaration particle to be analysed
|
| *
|
| - * Schema Component Constraint: Element Declarations Consistent
|
| + * Schema Component Constraint: Element Declarations Consistent
|
| */
|
| static int
|
| xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt,
|
| xmlSchemaBasicItemPtr ctxtComponent,
|
| - xmlSchemaParticlePtr ctxtParticle,
|
| + xmlSchemaParticlePtr ctxtParticle,
|
| xmlSchemaParticlePtr searchParticle,
|
| xmlSchemaParticlePtr curParticle,
|
| int search)
|
| @@ -19781,7 +19854,7 @@ xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt,
|
|
|
| int ret = 0;
|
| xmlSchemaParticlePtr cur = curParticle;
|
| - if (curParticle == NULL) {
|
| + if (curParticle == NULL) {
|
| return(0);
|
| }
|
| if (WXS_PARTICLE_TERM(curParticle) == NULL) {
|
| @@ -19790,7 +19863,7 @@ xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt,
|
| * might arise due to an invalid "term" component.
|
| */
|
| return(0);
|
| - }
|
| + }
|
| while (cur != NULL) {
|
| switch (WXS_PARTICLE_TERM(cur)->type) {
|
| case XML_SCHEMA_TYPE_ANY:
|
| @@ -19800,7 +19873,7 @@ xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt,
|
| ret = xmlSchemaCheckElementDeclConsistent(pctxt,
|
| ctxtComponent, ctxtParticle, cur, ctxtParticle, 1);
|
| if (ret != 0)
|
| - return(ret);
|
| + return(ret);
|
| } else {
|
| xmlSchemaElementPtr elem =
|
| WXS_ELEM_CAST(WXS_PARTICLE_TERM(cur));
|
| @@ -19808,7 +19881,7 @@ xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt,
|
| * SPEC Element Declarations Consistent:
|
| * "If the {particles} contains, either directly,
|
| * indirectly (that is, within the {particles} of a
|
| - * contained model group, recursively) or ·implicitly·
|
| + * contained model group, recursively) or �implicitly�
|
| * two or more element declaration particles with
|
| * the same {name} and {target namespace}, then
|
| * all their type definitions must be the same
|
| @@ -19820,7 +19893,7 @@ xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt,
|
| WXS_PARTICLE_TERM_AS_ELEM(searchParticle)->targetNamespace))
|
| {
|
| xmlChar *strA = NULL, *strB = NULL;
|
| -
|
| +
|
| xmlSchemaCustomErr(ACTXT_CAST pctxt,
|
| /* TODO: error code */
|
| XML_SCHEMAP_COS_NONAMBIG,
|
| @@ -19837,16 +19910,16 @@ xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt,
|
| FREE_AND_NULL(strB);
|
| return(XML_SCHEMAP_COS_NONAMBIG);
|
| }
|
| - }
|
| + }
|
| break;
|
| - case XML_SCHEMA_TYPE_SEQUENCE: {
|
| + case XML_SCHEMA_TYPE_SEQUENCE: {
|
| break;
|
| }
|
| case XML_SCHEMA_TYPE_CHOICE:{
|
| /*
|
| xmlSchemaTreeItemPtr sub;
|
| -
|
| - sub = WXS_PARTICLE_TERM(particle)->children; (xmlSchemaParticlePtr)
|
| +
|
| + sub = WXS_PARTICLE_TERM(particle)->children; (xmlSchemaParticlePtr)
|
| while (sub != NULL) {
|
| ret = xmlSchemaCheckElementDeclConsistent(pctxt, ctxtComponent,
|
| ctxtParticle, ctxtElem);
|
| @@ -19883,7 +19956,7 @@ exit:
|
| * @name: the name of the attribute
|
| *
|
| * Validates the value constraints of an element declaration.
|
| - * Adds substitution group members.
|
| + * Adds substitution group members.
|
| */
|
| static void
|
| xmlSchemaCheckElementDeclComponent(xmlSchemaElementPtr elemDecl,
|
| @@ -19898,7 +19971,7 @@ xmlSchemaCheckElementDeclComponent(xmlSchemaElementPtr elemDecl,
|
| /*
|
| * Adds substitution group members.
|
| */
|
| - xmlSchemaCheckElemSubstGroup(ctxt, elemDecl);
|
| + xmlSchemaCheckElemSubstGroup(ctxt, elemDecl);
|
| }
|
| }
|
|
|
| @@ -19928,7 +20001,7 @@ xmlSchemaResolveModelGroupParticleReferences(
|
| XML_SCHEMA_EXTRA_QNAMEREF))
|
| {
|
| goto next_particle;
|
| - }
|
| + }
|
| ref = WXS_QNAME_CAST WXS_PARTICLE_TERM(particle);
|
| /*
|
| * Resolve the reference.
|
| @@ -19944,7 +20017,7 @@ xmlSchemaResolveModelGroupParticleReferences(
|
| ref->targetNamespace, ref->itemType, NULL);
|
| /* TODO: remove the particle. */
|
| goto next_particle;
|
| - }
|
| + }
|
| if (refItem->type == XML_SCHEMA_TYPE_GROUP) {
|
| if (WXS_MODELGROUPDEF_MODEL(refItem) == NULL)
|
| /* TODO: remove the particle. */
|
| @@ -19994,9 +20067,9 @@ next_particle:
|
|
|
| static int
|
| xmlSchemaAreValuesEqual(xmlSchemaValPtr x,
|
| - xmlSchemaValPtr y)
|
| -{
|
| - xmlSchemaTypePtr tx, ty, ptx, pty;
|
| + xmlSchemaValPtr y)
|
| +{
|
| + xmlSchemaTypePtr tx, ty, ptx, pty;
|
| int ret;
|
|
|
| while (x != NULL) {
|
| @@ -20006,12 +20079,12 @@ xmlSchemaAreValuesEqual(xmlSchemaValPtr x,
|
| ptx = xmlSchemaGetPrimitiveType(tx);
|
| pty = xmlSchemaGetPrimitiveType(ty);
|
| /*
|
| - * (1) if a datatype T' is ·derived· by ·restriction· from an
|
| - * atomic datatype T then the ·value space· of T' is a subset of
|
| - * the ·value space· of T. */
|
| + * (1) if a datatype T' is �derived� by �restriction� from an
|
| + * atomic datatype T then the �value space� of T' is a subset of
|
| + * the �value space� of T. */
|
| /*
|
| - * (2) if datatypes T' and T'' are ·derived· by ·restriction·
|
| - * from a common atomic ancestor T then the ·value space·s of T'
|
| + * (2) if datatypes T' and T'' are �derived� by �restriction�
|
| + * from a common atomic ancestor T then the �value space�s of T'
|
| * and T'' may overlap.
|
| */
|
| if (ptx != pty)
|
| @@ -20042,7 +20115,7 @@ xmlSchemaAreValuesEqual(xmlSchemaValPtr x,
|
| if (x != NULL) {
|
| y = xmlSchemaValueGetNext(y);
|
| if (y == NULL)
|
| - return (0);
|
| + return (0);
|
| } else if (xmlSchemaValueGetNext(y) != NULL)
|
| return (0);
|
| else
|
| @@ -20092,11 +20165,11 @@ xmlSchemaResolveAttrUseReferences(xmlSchemaAttributeUsePtr ause,
|
| /**
|
| * xmlSchemaCheckAttrUsePropsCorrect:
|
| * @ctxt: a parser context
|
| - * @use: an attribute use
|
| + * @use: an attribute use
|
| *
|
| * Schema Component Constraint:
|
| * Attribute Use Correct (au-props-correct)
|
| - *
|
| + *
|
| */
|
| static int
|
| xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt,
|
| @@ -20106,16 +20179,16 @@ xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt,
|
| return(-1);
|
| if ((use->defValue == NULL) || (WXS_ATTRUSE_DECL(use) == NULL) ||
|
| ((WXS_ATTRUSE_DECL(use))->type != XML_SCHEMA_TYPE_ATTRIBUTE))
|
| - return(0);
|
| + return(0);
|
|
|
| /*
|
| * SPEC au-props-correct (1)
|
| * "The values of the properties of an attribute use must be as
|
| * described in the property tableau in The Attribute Use Schema
|
| - * Component (§3.5.1), modulo the impact of Missing
|
| - * Sub-components (§5.3)."
|
| + * Component (�3.5.1), modulo the impact of Missing
|
| + * Sub-components (�5.3)."
|
| */
|
| -
|
| +
|
| if (((WXS_ATTRUSE_DECL(use))->defValue != NULL) &&
|
| ((WXS_ATTRUSE_DECL(use))->flags & XML_SCHEMAS_ATTR_FIXED) &&
|
| ((use->flags & XML_SCHEMA_ATTR_USE_FIXED) == 0))
|
| @@ -20135,7 +20208,7 @@ xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt,
|
| if ((use->defVal != NULL) && (WXS_ATTRUSE_TYPEDEF(use) != NULL)) {
|
| int ret;
|
| /*
|
| - * TODO: The spec seems to be missing a check of the
|
| + * TODO: The spec seems to be missing a check of the
|
| * value constraint of the attribute use. We will do it here.
|
| */
|
| /*
|
| @@ -20152,7 +20225,7 @@ xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt,
|
| NULL, NULL);
|
| return(ctxt->err);
|
| }
|
| -
|
| +
|
| ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST ctxt,
|
| use->node, WXS_ATTRUSE_TYPEDEF(use),
|
| use->defValue, &(use->defVal),
|
| @@ -20203,7 +20276,7 @@ xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt,
|
| /**
|
| * xmlSchemaResolveAttrTypeReferences:
|
| * @item: an attribute declaration
|
| - * @ctxt: a parser context
|
| + * @ctxt: a parser context
|
| *
|
| * Resolves the referenced type definition component.
|
| */
|
| @@ -20214,8 +20287,8 @@ xmlSchemaResolveAttrTypeReferences(xmlSchemaAttributePtr item,
|
| /*
|
| * The simple type definition corresponding to the <simpleType> element
|
| * information item in the [children], if present, otherwise the simple
|
| - * type definition ·resolved· to by the ·actual value· of the type
|
| - * [attribute], if present, otherwise the ·simple ur-type definition·.
|
| + * type definition �resolved� to by the �actual value� of the type
|
| + * [attribute], if present, otherwise the �simple ur-type definition�.
|
| */
|
| if (item->flags & XML_SCHEMAS_ATTR_INTERNAL_RESOLVED)
|
| return(0);
|
| @@ -20294,7 +20367,7 @@ xmlSchemaResolveIDCKeyReferences(xmlSchemaIDCPtr idc,
|
| ((xmlSchemaIDCPtr) idc->ref->item)->nbFields) {
|
| xmlChar *str = NULL;
|
| xmlSchemaIDCPtr refer;
|
| -
|
| +
|
| refer = (xmlSchemaIDCPtr) idc->ref->item;
|
| /*
|
| * SPEC c-props-correct(2)
|
| @@ -20353,7 +20426,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
|
| int wasRedefined;
|
|
|
| if (redef == NULL)
|
| - return(0);
|
| + return(0);
|
|
|
| do {
|
| item = redef->item;
|
| @@ -20368,7 +20441,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
|
| * <redefine>d schema. Currenlty we latter approach is used.
|
| * SUPPLEMENT: It seems that the WG moves towards the latter
|
| * approach, so we are doing it right.
|
| - *
|
| + *
|
| */
|
| prev = xmlSchemaFindRedefCompInGraph(
|
| redef->targetBucket, item->type,
|
| @@ -20379,11 +20452,11 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
|
|
|
| /*
|
| * SPEC src-redefine:
|
| - * (6.2.1) "The ·actual value· of its own name attribute plus
|
| - * target namespace must successfully ·resolve· to a model
|
| + * (6.2.1) "The �actual value� of its own name attribute plus
|
| + * target namespace must successfully �resolve� to a model
|
| * group definition in I."
|
| - * (7.2.1) "The ·actual value· of its own name attribute plus
|
| - * target namespace must successfully ·resolve· to an attribute
|
| + * (7.2.1) "The �actual value� of its own name attribute plus
|
| + * target namespace must successfully �resolve� to an attribute
|
| * group definition in I."
|
|
|
| *
|
| @@ -20400,7 +20473,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
|
| /*
|
| * TODO: error code.
|
| * Probably XML_SCHEMAP_SRC_RESOLVE, if this is using the
|
| - * reference kind.
|
| + * reference kind.
|
| */
|
| XML_SCHEMAP_SRC_REDEFINE, node, NULL,
|
| "The %s '%s' to be redefined could not be found in "
|
| @@ -20408,7 +20481,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
|
| WXS_ITEM_TYPE_NAME(item),
|
| xmlSchemaFormatQName(&str, redef->refTargetNs,
|
| redef->refName));
|
| - FREE_AND_NULL(str);
|
| + FREE_AND_NULL(str);
|
| err = pctxt->err;
|
| redef = redef->next;
|
| continue;
|
| @@ -20434,7 +20507,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
|
| * base type of the redefining type.
|
| * TODO: How
|
| */
|
| - ((xmlSchemaTypePtr) item)->baseType =
|
| + ((xmlSchemaTypePtr) item)->baseType =
|
| (xmlSchemaTypePtr) prev;
|
| break;
|
| case XML_SCHEMA_TYPE_GROUP:
|
| @@ -20489,7 +20562,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
|
| default:
|
| PERROR_INT("xmlSchemaResolveRedefReferences",
|
| "Unexpected redefined component type");
|
| - return(-1);
|
| + return(-1);
|
| }
|
| if (wasRedefined) {
|
| xmlChar *str = NULL;
|
| @@ -20499,7 +20572,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
|
| node = WXS_ITEM_NODE(redef->reference);
|
| else
|
| node = WXS_ITEM_NODE(redef->item);
|
| -
|
| +
|
| xmlSchemaCustomErr(ACTXT_CAST pctxt,
|
| /* TODO: error code. */
|
| XML_SCHEMAP_SRC_REDEFINE,
|
| @@ -20508,12 +20581,12 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
|
| "redefinition of the same component is not supported",
|
| xmlSchemaGetComponentDesignation(&str, prev),
|
| NULL);
|
| - FREE_AND_NULL(str)
|
| + FREE_AND_NULL(str)
|
| err = pctxt->err;
|
| redef = redef->next;
|
| continue;
|
| }
|
| - redef = redef->next;
|
| + redef = redef->next;
|
| } while (redef != NULL);
|
|
|
| return(err);
|
| @@ -20527,7 +20600,7 @@ xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt)
|
| xmlSchemaBasicItemPtr item;
|
|
|
| if (redef == NULL)
|
| - return(0);
|
| + return(0);
|
|
|
| do {
|
| if (redef->target == NULL) {
|
| @@ -20535,7 +20608,7 @@ xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt)
|
| continue;
|
| }
|
| item = redef->item;
|
| -
|
| +
|
| switch (item->type) {
|
| case XML_SCHEMA_TYPE_SIMPLE:
|
| case XML_SCHEMA_TYPE_COMPLEX:
|
| @@ -20544,7 +20617,7 @@ xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt)
|
| * type to be 'absent', we'll NULL it.
|
| */
|
| (WXS_TYPE_CAST redef->target)->name = NULL;
|
| -
|
| +
|
| /*
|
| * TODO: Seems like there's nothing more to do. The normal
|
| * inheritance mechanism is used. But not 100% sure.
|
| @@ -20556,10 +20629,10 @@ xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt)
|
| * SPEC src-redefine:
|
| * (6.2.2) "The {model group} of the model group definition
|
| * which corresponds to it per XML Representation of Model
|
| - * Group Definition Schema Components (§3.7.2) must be a
|
| - * ·valid restriction· of the {model group} of that model
|
| + * Group Definition Schema Components (�3.7.2) must be a
|
| + * �valid restriction� of the {model group} of that model
|
| * group definition in I, as defined in Particle Valid
|
| - * (Restriction) (§3.9.6)."
|
| + * (Restriction) (�3.9.6)."
|
| */
|
| break;
|
| case XML_SCHEMA_TYPE_ATTRIBUTEGROUP:
|
| @@ -20568,11 +20641,11 @@ xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt)
|
| * (7.2.2) "The {attribute uses} and {attribute wildcard} of
|
| * the attribute group definition which corresponds to it
|
| * per XML Representation of Attribute Group Definition Schema
|
| - * Components (§3.6.2) must be ·valid restrictions· of the
|
| + * Components (�3.6.2) must be �valid restrictions� of the
|
| * {attribute uses} and {attribute wildcard} of that attribute
|
| * group definition in I, as defined in clause 2, clause 3 and
|
| * clause 4 of Derivation Valid (Restriction, Complex)
|
| - * (§3.4.6) (where references to the base type definition are
|
| + * (�3.4.6) (where references to the base type definition are
|
| * understood as references to the attribute group definition
|
| * in I)."
|
| */
|
| @@ -20593,7 +20666,7 @@ xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt)
|
| } while (redef != NULL);
|
| return(0);
|
| }
|
| -
|
| +
|
|
|
| static int
|
| xmlSchemaAddComponents(xmlSchemaParserCtxtPtr pctxt,
|
| @@ -20627,8 +20700,8 @@ xmlSchemaAddComponents(xmlSchemaParserCtxtPtr pctxt,
|
| return(-1);
|
| if (bucket->flags & XML_SCHEMA_BUCKET_COMPS_ADDED)
|
| return(0);
|
| - bucket->flags |= XML_SCHEMA_BUCKET_COMPS_ADDED;
|
| -
|
| + bucket->flags |= XML_SCHEMA_BUCKET_COMPS_ADDED;
|
| +
|
| for (i = 0; i < bucket->globals->nbItems; i++) {
|
| item = bucket->globals->items[i];
|
| table = NULL;
|
| @@ -20669,12 +20742,12 @@ xmlSchemaAddComponents(xmlSchemaParserCtxtPtr pctxt,
|
| case XML_SCHEMA_TYPE_NOTATION:
|
| name = ((xmlSchemaNotationPtr) item)->name;
|
| WXS_GET_GLOBAL_HASH(bucket, notaDecl)
|
| - break;
|
| + break;
|
| default:
|
| PERROR_INT("xmlSchemaAddComponents",
|
| "Unexpected global component type");
|
| - continue;
|
| - }
|
| + continue;
|
| + }
|
| if (*table == NULL) {
|
| *table = xmlHashCreateDict(10, pctxt->dict);
|
| if (*table == NULL) {
|
| @@ -20682,11 +20755,11 @@ xmlSchemaAddComponents(xmlSchemaParserCtxtPtr pctxt,
|
| "failed to create a component hash table");
|
| return(-1);
|
| }
|
| - }
|
| + }
|
| err = xmlHashAddEntry(*table, name, item);
|
| - if (err != 0) {
|
| + if (err != 0) {
|
| xmlChar *str = NULL;
|
| -
|
| +
|
| xmlSchemaCustomErr(ACTXT_CAST pctxt,
|
| XML_SCHEMAP_REDEFINED_TYPE,
|
| WXS_ITEM_NODE(item),
|
| @@ -20694,7 +20767,7 @@ xmlSchemaAddComponents(xmlSchemaParserCtxtPtr pctxt,
|
| "A global %s '%s' does already exist",
|
| WXS_ITEM_TYPE_NAME(item),
|
| xmlSchemaGetComponentQName(&str, item));
|
| - FREE_AND_NULL(str);
|
| + FREE_AND_NULL(str);
|
| }
|
| }
|
| /*
|
| @@ -20728,34 +20801,34 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
|
|
|
| if ((con->pending == NULL) ||
|
| (con->pending->nbItems == 0))
|
| - return(0);
|
| + return(0);
|
|
|
| /*
|
| * Since xmlSchemaFixupComplexType() will create new particles
|
| * (local components), and those particle components need a bucket
|
| * on the constructor, we'll assure here that the constructor has
|
| * a bucket.
|
| - * TODO: Think about storing locals _only_ on the main bucket.
|
| - */
|
| + * TODO: Think about storing locals _only_ on the main bucket.
|
| + */
|
| if (con->bucket == NULL)
|
| - con->bucket = rootBucket;
|
| + con->bucket = rootBucket;
|
|
|
| /* TODO:
|
| * SPEC (src-redefine):
|
| * (6.2) "If it has no such self-reference, then all of the
|
| * following must be true:"
|
| -
|
| +
|
| * (6.2.2) The {model group} of the model group definition which
|
| * corresponds to it per XML Representation of Model Group
|
| - * Definition Schema Components (§3.7.2) must be a ·valid
|
| - * restriction· of the {model group} of that model group definition
|
| - * in I, as defined in Particle Valid (Restriction) (§3.9.6)."
|
| + * Definition Schema Components (�3.7.2) must be a �valid
|
| + * restriction� of the {model group} of that model group definition
|
| + * in I, as defined in Particle Valid (Restriction) (�3.9.6)."
|
| */
|
| xmlSchemaCheckSRCRedefineFirst(pctxt);
|
|
|
| /*
|
| * Add global components to the schemata's hash tables.
|
| - */
|
| + */
|
| xmlSchemaAddComponents(pctxt, rootBucket);
|
|
|
| pctxt->ctxtType = NULL;
|
| @@ -20765,7 +20838,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
|
| * Now that we have parsed *all* the schema document(s) and converted
|
| * them to schema components, we can resolve references, apply component
|
| * constraints, create the FSA from the content model, etc.
|
| - */
|
| + */
|
| /*
|
| * Resolve references of..
|
| *
|
| @@ -20786,7 +20859,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
|
| * 6. IDC key-references:
|
| * - the referenced IDC 'key' or 'unique' definition
|
| * 7. Attribute prohibitions which had a "ref" attribute.
|
| - */
|
| + */
|
| for (i = 0; i < nbItems; i++) {
|
| item = items[i];
|
| switch (item->type) {
|
| @@ -20812,7 +20885,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
|
| FIXHFAILURE;
|
| break;
|
| case XML_SCHEMA_EXTRA_QNAMEREF:
|
| - if ((WXS_QNAME_CAST item)->itemType ==
|
| + if ((WXS_QNAME_CAST item)->itemType ==
|
| XML_SCHEMA_TYPE_ATTRIBUTEGROUP)
|
| {
|
| xmlSchemaResolveAttrGroupReferences(
|
| @@ -20849,11 +20922,11 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
|
| }
|
| if (pctxt->nberrors != 0)
|
| goto exit_error;
|
| -
|
| +
|
| /*
|
| * Now that all references are resolved we
|
| * can check for circularity of...
|
| - * 1. the base axis of type definitions
|
| + * 1. the base axis of type definitions
|
| * 2. nested model group definitions
|
| * 3. nested attribute group definitions
|
| * TODO: check for circual substitution groups.
|
| @@ -20888,7 +20961,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
|
| break;
|
| default:
|
| break;
|
| - }
|
| + }
|
| }
|
| if (pctxt->nberrors != 0)
|
| goto exit_error;
|
| @@ -20904,7 +20977,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
|
| item = items[i];
|
| switch (item->type) {
|
| case XML_SCHEMA_TYPE_SEQUENCE:
|
| - case XML_SCHEMA_TYPE_CHOICE:
|
| + case XML_SCHEMA_TYPE_CHOICE:
|
| xmlSchemaModelGroupToModelGroupDefFixup(pctxt,
|
| WXS_MODEL_GROUP_CAST item);
|
| break;
|
| @@ -20935,7 +21008,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
|
| }
|
| if (pctxt->nberrors != 0)
|
| goto exit_error;
|
| - /*
|
| + /*
|
| * First compute the variety of simple types. This is needed as
|
| * a seperate step, since otherwise we won't be able to detect
|
| * circular union types in all cases.
|
| @@ -20965,7 +21038,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
|
| switch (item->type) {
|
| case XML_SCHEMA_TYPE_SIMPLE:
|
| if (((xmlSchemaTypePtr) item)->memberTypes != NULL) {
|
| - xmlSchemaCheckUnionTypeDefCircular(pctxt,
|
| + xmlSchemaCheckUnionTypeDefCircular(pctxt,
|
| (xmlSchemaTypePtr) item);
|
| FIXHFAILURE;
|
| }
|
| @@ -20976,7 +21049,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
|
| }
|
| if (pctxt->nberrors != 0)
|
| goto exit_error;
|
| -
|
| +
|
| /*
|
| * Do the complete type fixup for simple types.
|
| */
|
| @@ -21004,10 +21077,10 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
|
| for (i = 0; i < nbItems; i++) {
|
| item = items[i];
|
| switch (item->type) {
|
| - case XML_SCHEMA_TYPE_ATTRIBUTE:
|
| + case XML_SCHEMA_TYPE_ATTRIBUTE:
|
| xmlSchemaCheckAttrPropsCorrect(pctxt, WXS_ATTR_CAST item);
|
| FIXHFAILURE;
|
| - break;
|
| + break;
|
| default:
|
| break;
|
| }
|
| @@ -21016,7 +21089,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
|
| goto exit_error;
|
| /*
|
| * Apply constraints for attribute uses.
|
| - */
|
| + */
|
| for (i = 0; i < nbItems; i++) {
|
| item = items[i];
|
| switch (item->type) {
|
| @@ -21063,7 +21136,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
|
| if (pctxt->nberrors != 0)
|
| goto exit_error;
|
|
|
| - /*
|
| + /*
|
| * Complex types are builded and checked.
|
| */
|
| for (i = 0; i < nbItems; i++) {
|
| @@ -21087,8 +21160,8 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
|
| * will create particles and model groups in some cases.
|
| */
|
| items = (xmlSchemaTreeItemPtr *) con->pending->items;
|
| - nbItems = con->pending->nbItems;
|
| -
|
| + nbItems = con->pending->nbItems;
|
| +
|
| /*
|
| * Apply some constraints for element declarations.
|
| */
|
| @@ -21097,7 +21170,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
|
| switch (item->type) {
|
| case XML_SCHEMA_TYPE_ELEMENT:
|
| elemDecl = (xmlSchemaElementPtr) item;
|
| -
|
| +
|
| if ((elemDecl->flags & XML_SCHEMAS_ELEM_INTERNAL_CHECKED) == 0)
|
| {
|
| xmlSchemaCheckElementDeclComponent(
|
| @@ -21127,7 +21200,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
|
| }
|
| if (pctxt->nberrors != 0)
|
| goto exit_error;
|
| -
|
| +
|
| /*
|
| * Finally we can build the automaton from the content model of
|
| * complex types.
|
| @@ -21148,10 +21221,10 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
|
| goto exit_error;
|
| /*
|
| * URGENT TODO: cos-element-consistent
|
| - */
|
| - goto exit;
|
| + */
|
| + goto exit;
|
|
|
| -exit_error:
|
| +exit_error:
|
| ret = pctxt->err;
|
| goto exit;
|
|
|
| @@ -21165,12 +21238,12 @@ exit:
|
| * if not cleared here.
|
| */
|
| con->bucket = oldbucket;
|
| - con->pending->nbItems = 0;
|
| + con->pending->nbItems = 0;
|
| if (con->substGroups != NULL) {
|
| xmlHashFree(con->substGroups,
|
| (xmlHashDeallocator) xmlSchemaSubstGroupFree);
|
| con->substGroups = NULL;
|
| - }
|
| + }
|
| if (con->redefs != NULL) {
|
| xmlSchemaRedefListFree(con->redefs);
|
| con->redefs = NULL;
|
| @@ -21233,11 +21306,11 @@ xmlSchemaParse(xmlSchemaParserCtxtPtr ctxt)
|
| if (res == -1)
|
| goto exit_failure;
|
| if (res != 0)
|
| - goto exit;
|
| + goto exit;
|
|
|
| if (bucket == NULL) {
|
| /* TODO: Error code, actually we failed to *locate* the schema. */
|
| - if (ctxt->URL)
|
| + if (ctxt->URL)
|
| xmlSchemaCustomErr(ACTXT_CAST ctxt, XML_SCHEMAP_FAILED_LOAD,
|
| NULL, NULL,
|
| "Failed to locate the main schema resource at '%s'",
|
| @@ -21248,16 +21321,16 @@ xmlSchemaParse(xmlSchemaParserCtxtPtr ctxt)
|
| "Failed to locate the main schema resource",
|
| NULL, NULL);
|
| goto exit;
|
| - }
|
| + }
|
| /* Then do the parsing for good. */
|
| if (xmlSchemaParseNewDocWithContext(ctxt, mainSchema, bucket) == -1)
|
| goto exit_failure;
|
| if (ctxt->nberrors != 0)
|
| goto exit;
|
| -
|
| +
|
| mainSchema->doc = bucket->doc;
|
| mainSchema->preserve = ctxt->preserve;
|
| -
|
| +
|
| ctxt->schema = mainSchema;
|
|
|
| if (xmlSchemaFixupComponents(ctxt, WXS_CONSTRUCTOR(ctxt)->mainBucket) == -1)
|
| @@ -21267,8 +21340,8 @@ xmlSchemaParse(xmlSchemaParserCtxtPtr ctxt)
|
| * TODO: This is not nice, since we cannot distinguish from the
|
| * result if there was an internal error or not.
|
| */
|
| -exit:
|
| - if (ctxt->nberrors != 0) {
|
| +exit:
|
| + if (ctxt->nberrors != 0) {
|
| if (mainSchema) {
|
| xmlSchemaFree(mainSchema);
|
| mainSchema = NULL;
|
| @@ -21282,7 +21355,7 @@ exit:
|
| ctxt->schema = NULL;
|
| return(mainSchema);
|
| exit_failure:
|
| - /*
|
| + /*
|
| * Quite verbose, but should catch internal errors, which were
|
| * not communitated.
|
| */
|
| @@ -21296,7 +21369,7 @@ exit_failure:
|
| ctxt->ownsConstructor = 0;
|
| }
|
| PERROR_INT2("xmlSchemaParse",
|
| - "An internal error occured");
|
| + "An internal error occured");
|
| ctxt->schema = NULL;
|
| return(NULL);
|
| }
|
| @@ -21433,8 +21506,8 @@ xmlSchemaGetWhiteSpaceFacetValue(xmlSchemaTypePtr type)
|
| return(XML_SCHEMA_WHITESPACE_REPLACE);
|
| else {
|
| /*
|
| - * For all ·atomic· datatypes other than string (and types ·derived·
|
| - * by ·restriction· from it) the value of whiteSpace is fixed to
|
| + * For all �atomic� datatypes other than string (and types �derived�
|
| + * by �restriction� from it) the value of whiteSpace is fixed to
|
| * collapse
|
| * Note that this includes built-in list datatypes.
|
| */
|
| @@ -21521,11 +21594,11 @@ xmlSchemaAssembleByLocation(xmlSchemaValidCtxtPtr vctxt,
|
| * XML_SCHEMA_SCHEMA_MAIN if it is the first schema document.
|
| */
|
| ret = xmlSchemaAddSchemaDoc(pctxt, XML_SCHEMA_SCHEMA_IMPORT,
|
| - location, NULL, NULL, 0, node, NULL, nsName,
|
| + location, NULL, NULL, 0, node, NULL, nsName,
|
| &bucket);
|
| if (ret != 0)
|
| - return(ret);
|
| - if (bucket == NULL) {
|
| + return(ret);
|
| + if (bucket == NULL) {
|
| /*
|
| * Generate a warning that the document could not be located.
|
| */
|
| @@ -21555,17 +21628,17 @@ xmlSchemaAssembleByLocation(xmlSchemaValidCtxtPtr vctxt,
|
| pctxt->nberrors = 0;
|
| pctxt->err = 0;
|
| pctxt->doc = bucket->doc;
|
| -
|
| - ret = xmlSchemaParseNewDocWithContext(pctxt, schema, bucket);
|
| +
|
| + ret = xmlSchemaParseNewDocWithContext(pctxt, schema, bucket);
|
| if (ret == -1) {
|
| pctxt->doc = NULL;
|
| goto exit_failure;
|
| }
|
| /* Paranoid error channelling. */
|
| if ((ret == 0) && (pctxt->nberrors != 0))
|
| - ret = pctxt->err;
|
| - if (pctxt->nberrors == 0) {
|
| - /*
|
| + ret = pctxt->err;
|
| + if (pctxt->nberrors == 0) {
|
| + /*
|
| * Only bother to fixup pending components, if there was
|
| * no error yet.
|
| * For every XSI acquired schema (and its sub-schemata) we will
|
| @@ -21581,7 +21654,7 @@ xmlSchemaAssembleByLocation(xmlSchemaValidCtxtPtr vctxt,
|
| vctxt->err = ret;
|
| vctxt->nberrors += pctxt->nberrors;
|
| } else {
|
| - /* Add to validation error sum. */
|
| + /* Add to validation error sum. */
|
| vctxt->nberrors += pctxt->nberrors;
|
| }
|
| pctxt->doc = NULL;
|
| @@ -21592,7 +21665,7 @@ exit_failure:
|
| }
|
|
|
| static xmlSchemaAttrInfoPtr
|
| -xmlSchemaGetMetaAttrInfo(xmlSchemaValidCtxtPtr vctxt,
|
| +xmlSchemaGetMetaAttrInfo(xmlSchemaValidCtxtPtr vctxt,
|
| int metaType)
|
| {
|
| if (vctxt->nbAttrInfos == 0)
|
| @@ -21682,7 +21755,7 @@ xmlSchemaAssembleByXSI(xmlSchemaValidCtxtPtr vctxt)
|
| /*
|
| * If using @schemaLocation then tuples are expected.
|
| * I.e. the namespace name *and* the document's URI.
|
| - */
|
| + */
|
| xmlSchemaCustomWarning(ACTXT_CAST vctxt, XML_SCHEMAV_MISC,
|
| iattr->node, NULL,
|
| "The value must consist of tuples: the target namespace "
|
| @@ -21711,7 +21784,7 @@ xmlSchemaLookupNamespace(xmlSchemaValidCtxtPtr vctxt,
|
| if (vctxt->sax != NULL) {
|
| int i, j;
|
| xmlSchemaNodeInfoPtr inode;
|
| -
|
| +
|
| for (i = vctxt->depth; i >= 0; i--) {
|
| if (vctxt->elemInfos[i]->nbNsBindings != 0) {
|
| inode = vctxt->elemInfos[i];
|
| @@ -21725,16 +21798,16 @@ xmlSchemaLookupNamespace(xmlSchemaValidCtxtPtr vctxt,
|
| * Note that the namespace bindings are already
|
| * in a string dict.
|
| */
|
| - return (inode->nsBindings[j+1]);
|
| + return (inode->nsBindings[j+1]);
|
| }
|
| }
|
| }
|
| }
|
| return (NULL);
|
| -#ifdef LIBXML_WRITER_ENABLED
|
| +#ifdef LIBXML_READER_ENABLED
|
| } else if (vctxt->reader != NULL) {
|
| xmlChar *nsName;
|
| -
|
| +
|
| nsName = xmlTextReaderLookupNamespace(vctxt->reader, prefix);
|
| if (nsName != NULL) {
|
| const xmlChar *ret;
|
| @@ -21766,7 +21839,7 @@ xmlSchemaLookupNamespace(xmlSchemaValidCtxtPtr vctxt,
|
| * This one works on the schema of the validation context.
|
| */
|
| static int
|
| -xmlSchemaValidateNotation(xmlSchemaValidCtxtPtr vctxt,
|
| +xmlSchemaValidateNotation(xmlSchemaValidCtxtPtr vctxt,
|
| xmlSchemaPtr schema,
|
| xmlNodePtr node,
|
| const xmlChar *value,
|
| @@ -21791,7 +21864,7 @@ xmlSchemaValidateNotation(xmlSchemaValidCtxtPtr vctxt,
|
| if (prefix != NULL) {
|
| const xmlChar *nsName = NULL;
|
|
|
| - if (vctxt != NULL)
|
| + if (vctxt != NULL)
|
| nsName = xmlSchemaLookupNamespace(vctxt, BAD_CAST prefix);
|
| else if (node != NULL) {
|
| xmlNsPtr ns = xmlSearchNs(node->doc, node, prefix);
|
| @@ -22143,7 +22216,7 @@ xmlSchemaIDCFreeBinding(xmlSchemaPSVIIDCBindingPtr bind)
|
| if (bind->nodeTable != NULL)
|
| xmlFree(bind->nodeTable);
|
| if (bind->dupls != NULL)
|
| - xmlSchemaItemListFree(bind->dupls);
|
| + xmlSchemaItemListFree(bind->dupls);
|
| xmlFree(bind);
|
| }
|
|
|
| @@ -22178,12 +22251,12 @@ xmlSchemaIDCFreeMatcherList(xmlSchemaIDCMatcherPtr matcher)
|
|
|
| while (matcher != NULL) {
|
| next = matcher->next;
|
| - if (matcher->keySeqs != NULL) {
|
| + if (matcher->keySeqs != NULL) {
|
| int i;
|
| for (i = 0; i < matcher->sizeKeySeqs; i++)
|
| if (matcher->keySeqs[i] != NULL)
|
| xmlFree(matcher->keySeqs[i]);
|
| - xmlFree(matcher->keySeqs);
|
| + xmlFree(matcher->keySeqs);
|
| }
|
| if (matcher->targets != NULL) {
|
| if (matcher->idcType == XML_SCHEMA_TYPE_IDC_KEYREF) {
|
| @@ -22223,7 +22296,7 @@ xmlSchemaIDCReleaseMatcherList(xmlSchemaValidCtxtPtr vctxt,
|
|
|
| while (matcher != NULL) {
|
| next = matcher->next;
|
| - if (matcher->keySeqs != NULL) {
|
| + if (matcher->keySeqs != NULL) {
|
| int i;
|
| /*
|
| * Don't free the array, but only the content.
|
| @@ -22252,7 +22325,7 @@ xmlSchemaIDCReleaseMatcherList(xmlSchemaValidCtxtPtr vctxt,
|
| }
|
| xmlSchemaItemListFree(matcher->targets);
|
| matcher->targets = NULL;
|
| - }
|
| + }
|
| matcher->next = NULL;
|
| /*
|
| * Cache the matcher.
|
| @@ -22294,7 +22367,7 @@ xmlSchemaIDCAddStateObject(xmlSchemaValidCtxtPtr vctxt,
|
| sto = vctxt->xpathStatePool;
|
| vctxt->xpathStatePool = sto->next;
|
| sto->next = NULL;
|
| - } else {
|
| + } else {
|
| /*
|
| * Create a new state object.
|
| */
|
| @@ -22305,10 +22378,10 @@ xmlSchemaIDCAddStateObject(xmlSchemaValidCtxtPtr vctxt,
|
| return (-1);
|
| }
|
| memset(sto, 0, sizeof(xmlSchemaIDCStateObj));
|
| - }
|
| + }
|
| /*
|
| - * Add to global list.
|
| - */
|
| + * Add to global list.
|
| + */
|
| if (vctxt->xpathStates != NULL)
|
| sto->next = vctxt->xpathStates;
|
| vctxt->xpathStates = sto;
|
| @@ -22328,13 +22401,13 @@ xmlSchemaIDCAddStateObject(xmlSchemaValidCtxtPtr vctxt,
|
| VERROR_INT("xmlSchemaIDCAddStateObject",
|
| "failed to create an XPath validation context");
|
| return (-1);
|
| - }
|
| + }
|
| sto->type = type;
|
| sto->depth = vctxt->depth;
|
| sto->matcher = matcher;
|
| sto->sel = sel;
|
| sto->nbHistory = 0;
|
| -
|
| +
|
| #ifdef DEBUG_IDC
|
| xmlGenericError(xmlGenericErrorContext, "IDC: STO push '%s'\n",
|
| sto->sel->xpath);
|
| @@ -22358,7 +22431,7 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt,
|
| {
|
| xmlSchemaIDCStateObjPtr sto, head = NULL, first;
|
| int res, resolved = 0, depth = vctxt->depth;
|
| -
|
| +
|
| if (vctxt->xpathStates == NULL)
|
| return (0);
|
|
|
| @@ -22367,8 +22440,8 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt,
|
| #ifdef DEBUG_IDC
|
| {
|
| xmlChar *str = NULL;
|
| - xmlGenericError(xmlGenericErrorContext,
|
| - "IDC: EVAL on %s, depth %d, type %d\n",
|
| + xmlGenericError(xmlGenericErrorContext,
|
| + "IDC: EVAL on %s, depth %d, type %d\n",
|
| xmlSchemaFormatQName(&str, vctxt->inode->nsName,
|
| vctxt->inode->localName), depth, nodeType);
|
| FREE_AND_NULL(str)
|
| @@ -22382,10 +22455,10 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt,
|
| while (sto != head) {
|
| #ifdef DEBUG_IDC
|
| if (sto->type == XPATH_STATE_OBJ_TYPE_IDC_SELECTOR)
|
| - xmlGenericError(xmlGenericErrorContext, "IDC: ['%s'] selector '%s'\n",
|
| + xmlGenericError(xmlGenericErrorContext, "IDC: ['%s'] selector '%s'\n",
|
| sto->matcher->aidc->def->name, sto->sel->xpath);
|
| else
|
| - xmlGenericError(xmlGenericErrorContext, "IDC: ['%s'] field '%s'\n",
|
| + xmlGenericError(xmlGenericErrorContext, "IDC: ['%s'] field '%s'\n",
|
| sto->matcher->aidc->def->name, sto->sel->xpath);
|
| #endif
|
| if (nodeType == XML_ELEMENT_NODE)
|
| @@ -22415,7 +22488,7 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt,
|
| if (sto->history == NULL) {
|
| sto->history = (int *) xmlMalloc(5 * sizeof(int));
|
| if (sto->history == NULL) {
|
| - xmlSchemaVErrMemory(NULL,
|
| + xmlSchemaVErrMemory(NULL,
|
| "allocating the state object history", NULL);
|
| return(-1);
|
| }
|
| @@ -22425,11 +22498,11 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt,
|
| sto->history = (int *) xmlRealloc(sto->history,
|
| sto->sizeHistory * sizeof(int));
|
| if (sto->history == NULL) {
|
| - xmlSchemaVErrMemory(NULL,
|
| + xmlSchemaVErrMemory(NULL,
|
| "re-allocating the state object history", NULL);
|
| return(-1);
|
| }
|
| - }
|
| + }
|
| sto->history[sto->nbHistory++] = depth;
|
|
|
| #ifdef DEBUG_IDC
|
| @@ -22498,7 +22571,7 @@ xmlSchemaFormatIDCKeySequence(xmlSchemaValidCtxtPtr vctxt,
|
| *buf = xmlStrdup(BAD_CAST "[");
|
| for (i = 0; i < count; i++) {
|
| *buf = xmlStrcat(*buf, BAD_CAST "'");
|
| - res = xmlSchemaGetCanonValueWhtspExt(seq[i]->val,
|
| + res = xmlSchemaGetCanonValueWhtspExt(seq[i]->val,
|
| xmlSchemaGetWhiteSpaceFacetValue(seq[i]->type),
|
| &value);
|
| if (res == 0)
|
| @@ -22556,7 +22629,7 @@ xmlSchemaXPathPop(xmlSchemaValidCtxtPtr vctxt)
|
| *
|
| * Processes and pops the history items of the IDC state objects.
|
| * IDC key-sequences are validated/created on IDC bindings.
|
| - *
|
| + *
|
| * Returns 0 on success and -1 on internal errors.
|
| */
|
| static int
|
| @@ -22575,13 +22648,13 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
|
| #ifdef DEBUG_IDC
|
| {
|
| xmlChar *str = NULL;
|
| - xmlGenericError(xmlGenericErrorContext,
|
| + xmlGenericError(xmlGenericErrorContext,
|
| "IDC: BACK on %s, depth %d\n",
|
| xmlSchemaFormatQName(&str, vctxt->inode->nsName,
|
| vctxt->inode->localName), vctxt->depth);
|
| FREE_AND_NULL(str)
|
| }
|
| -#endif
|
| +#endif
|
| /*
|
| * Evaluate the state objects.
|
| */
|
| @@ -22607,14 +22680,14 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
|
| if (matchDepth != depth) {
|
| sto = sto->next;
|
| continue;
|
| - }
|
| + }
|
| if (sto->type == XPATH_STATE_OBJ_TYPE_IDC_FIELD) {
|
| /*
|
| * NOTE: According to
|
| * http://www.w3.org/Bugs/Public/show_bug.cgi?id=2198
|
| * ... the simple-content of complex types is also allowed.
|
| */
|
| -
|
| +
|
| if (WXS_IS_COMPLEX(type)) {
|
| if (WXS_HAS_SIMPLE_CONTENT(type)) {
|
| /*
|
| @@ -22629,17 +22702,17 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
|
| }
|
| } else
|
| simpleType = NULL;
|
| - } else
|
| + } else
|
| simpleType = type;
|
| if (simpleType == NULL) {
|
| xmlChar *str = NULL;
|
| -
|
| +
|
| /*
|
| * Not qualified if the field resolves to a node of non
|
| * simple type.
|
| - */
|
| + */
|
| xmlSchemaCustomErr(ACTXT_CAST vctxt,
|
| - XML_SCHEMAV_CVC_IDC, NULL,
|
| + XML_SCHEMAV_CVC_IDC, NULL,
|
| WXS_BASIC_CAST sto->matcher->aidc->def,
|
| "The XPath '%s' of a field of %s does evaluate to a node of "
|
| "non-simple type",
|
| @@ -22649,7 +22722,7 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
|
| sto->nbHistory--;
|
| goto deregister_check;
|
| }
|
| -
|
| +
|
| if ((key == NULL) && (vctxt->inode->val == NULL)) {
|
| /*
|
| * Failed to provide the normalized value; maybe
|
| @@ -22665,13 +22738,13 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
|
| xmlSchemaIDCMatcherPtr matcher = sto->matcher;
|
| xmlSchemaPSVIIDCKeyPtr *keySeq;
|
| int pos, idx;
|
| -
|
| +
|
| /*
|
| * The key will be anchored on the matcher's list of
|
| * key-sequences. The position in this list is determined
|
| * by the target node's depth relative to the matcher's
|
| * depth of creation (i.e. the depth of the scope element).
|
| - *
|
| + *
|
| * Element Depth Pos List-entries
|
| * <scope> 0 NULL
|
| * <bar> 1 NULL
|
| @@ -22682,23 +22755,23 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
|
| * The size of the list is only dependant on the depth of
|
| * the tree.
|
| * An entry will be NULLed in selector_leave, i.e. when
|
| - * we hit the target's
|
| - */
|
| + * we hit the target's
|
| + */
|
| pos = sto->depth - matcher->depth;
|
| idx = sto->sel->index;
|
| -
|
| +
|
| /*
|
| * Create/grow the array of key-sequences.
|
| */
|
| if (matcher->keySeqs == NULL) {
|
| - if (pos > 9)
|
| + if (pos > 9)
|
| matcher->sizeKeySeqs = pos * 2;
|
| else
|
| matcher->sizeKeySeqs = 10;
|
| - matcher->keySeqs = (xmlSchemaPSVIIDCKeyPtr **)
|
| + matcher->keySeqs = (xmlSchemaPSVIIDCKeyPtr **)
|
| xmlMalloc(matcher->sizeKeySeqs *
|
| - sizeof(xmlSchemaPSVIIDCKeyPtr *));
|
| - if (matcher->keySeqs == NULL) {
|
| + sizeof(xmlSchemaPSVIIDCKeyPtr *));
|
| + if (matcher->keySeqs == NULL) {
|
| xmlSchemaVErrMemory(NULL,
|
| "allocating an array of key-sequences",
|
| NULL);
|
| @@ -22707,9 +22780,9 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
|
| memset(matcher->keySeqs, 0,
|
| matcher->sizeKeySeqs *
|
| sizeof(xmlSchemaPSVIIDCKeyPtr *));
|
| - } else if (pos >= matcher->sizeKeySeqs) {
|
| + } else if (pos >= matcher->sizeKeySeqs) {
|
| int i = matcher->sizeKeySeqs;
|
| -
|
| +
|
| matcher->sizeKeySeqs *= 2;
|
| matcher->keySeqs = (xmlSchemaPSVIIDCKeyPtr **)
|
| xmlRealloc(matcher->keySeqs,
|
| @@ -22725,29 +22798,29 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
|
| * The array needs to be NULLed.
|
| * TODO: Use memset?
|
| */
|
| - for (; i < matcher->sizeKeySeqs; i++)
|
| - matcher->keySeqs[i] = NULL;
|
| + for (; i < matcher->sizeKeySeqs; i++)
|
| + matcher->keySeqs[i] = NULL;
|
| }
|
| -
|
| +
|
| /*
|
| * Get/create the key-sequence.
|
| */
|
| - keySeq = matcher->keySeqs[pos];
|
| - if (keySeq == NULL) {
|
| + keySeq = matcher->keySeqs[pos];
|
| + if (keySeq == NULL) {
|
| goto create_sequence;
|
| } else if (keySeq[idx] != NULL) {
|
| xmlChar *str = NULL;
|
| /*
|
| * cvc-identity-constraint:
|
| - * 3 For each node in the ·target node set· all
|
| + * 3 For each node in the �target node set� all
|
| * of the {fields}, with that node as the context
|
| * node, evaluate to either an empty node-set or
|
| * a node-set with exactly one member, which must
|
| * have a simple type.
|
| - *
|
| + *
|
| * The key was already set; report an error.
|
| */
|
| - xmlSchemaCustomErr(ACTXT_CAST vctxt,
|
| + xmlSchemaCustomErr(ACTXT_CAST vctxt,
|
| XML_SCHEMAV_CVC_IDC, NULL,
|
| WXS_BASIC_CAST matcher->aidc->def,
|
| "The XPath '%s' of a field of %s evaluates to a "
|
| @@ -22758,27 +22831,27 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
|
| sto->nbHistory--;
|
| goto deregister_check;
|
| } else
|
| - goto create_key;
|
| -
|
| + goto create_key;
|
| +
|
| create_sequence:
|
| /*
|
| * Create a key-sequence.
|
| */
|
| keySeq = (xmlSchemaPSVIIDCKeyPtr *) xmlMalloc(
|
| - matcher->aidc->def->nbFields *
|
| + matcher->aidc->def->nbFields *
|
| sizeof(xmlSchemaPSVIIDCKeyPtr));
|
| if (keySeq == NULL) {
|
| - xmlSchemaVErrMemory(NULL,
|
| + xmlSchemaVErrMemory(NULL,
|
| "allocating an IDC key-sequence", NULL);
|
| - return(-1);
|
| - }
|
| - memset(keySeq, 0, matcher->aidc->def->nbFields *
|
| + return(-1);
|
| + }
|
| + memset(keySeq, 0, matcher->aidc->def->nbFields *
|
| sizeof(xmlSchemaPSVIIDCKeyPtr));
|
| matcher->keySeqs[pos] = keySeq;
|
| create_key:
|
| /*
|
| * Create a key once per node only.
|
| - */
|
| + */
|
| if (key == NULL) {
|
| key = (xmlSchemaPSVIIDCKeyPtr) xmlMalloc(
|
| sizeof(xmlSchemaPSVIIDCKey));
|
| @@ -22787,7 +22860,7 @@ create_key:
|
| "allocating a IDC key", NULL);
|
| xmlFree(keySeq);
|
| matcher->keySeqs[pos] = NULL;
|
| - return(-1);
|
| + return(-1);
|
| }
|
| /*
|
| * Consume the compiled value.
|
| @@ -22803,10 +22876,10 @@ create_key:
|
| return (-1);
|
| }
|
| }
|
| - keySeq[idx] = key;
|
| + keySeq[idx] = key;
|
| }
|
| } else if (sto->type == XPATH_STATE_OBJ_TYPE_IDC_SELECTOR) {
|
| -
|
| +
|
| xmlSchemaPSVIIDCKeyPtr **keySeq = NULL;
|
| /* xmlSchemaPSVIIDCBindingPtr bind; */
|
| xmlSchemaPSVIIDCNodePtr ntItem;
|
| @@ -22817,22 +22890,22 @@ create_key:
|
| /*
|
| * Here we have the following scenario:
|
| * An IDC 'selector' state object resolved to a target node,
|
| - * during the time this target node was in the
|
| - * ancestor-or-self axis, the 'field' state object(s) looked
|
| - * out for matching nodes to create a key-sequence for this
|
| + * during the time this target node was in the
|
| + * ancestor-or-self axis, the 'field' state object(s) looked
|
| + * out for matching nodes to create a key-sequence for this
|
| * target node. Now we are back to this target node and need
|
| - * to put the key-sequence, together with the target node
|
| - * itself, into the node-table of the corresponding IDC
|
| + * to put the key-sequence, together with the target node
|
| + * itself, into the node-table of the corresponding IDC
|
| * binding.
|
| */
|
| matcher = sto->matcher;
|
| idc = matcher->aidc->def;
|
| nbKeys = idc->nbFields;
|
| - pos = depth - matcher->depth;
|
| + pos = depth - matcher->depth;
|
| /*
|
| * Check if the matcher has any key-sequences at all, plus
|
| * if it has a key-sequence for the current target node.
|
| - */
|
| + */
|
| if ((matcher->keySeqs == NULL) ||
|
| (matcher->sizeKeySeqs <= pos)) {
|
| if (idc->type == XML_SCHEMA_TYPE_IDC_KEY)
|
| @@ -22840,15 +22913,15 @@ create_key:
|
| else
|
| goto selector_leave;
|
| }
|
| -
|
| - keySeq = &(matcher->keySeqs[pos]);
|
| +
|
| + keySeq = &(matcher->keySeqs[pos]);
|
| if (*keySeq == NULL) {
|
| if (idc->type == XML_SCHEMA_TYPE_IDC_KEY)
|
| goto selector_key_error;
|
| else
|
| goto selector_leave;
|
| }
|
| -
|
| +
|
| for (i = 0; i < nbKeys; i++) {
|
| if ((*keySeq)[i] == NULL) {
|
| /*
|
| @@ -22859,18 +22932,18 @@ create_key:
|
| * All fields of a "key" IDC must resolve.
|
| */
|
| goto selector_key_error;
|
| - }
|
| + }
|
| goto selector_leave;
|
| }
|
| }
|
| /*
|
| * All fields did resolve.
|
| */
|
| -
|
| +
|
| /*
|
| * 4.1 If the {identity-constraint category} is unique(/key),
|
| - * then no two members of the ·qualified node set· have
|
| - * ·key-sequences· whose members are pairwise equal, as
|
| + * then no two members of the �qualified node set� have
|
| + * �key-sequences� whose members are pairwise equal, as
|
| * defined by Equal in [XML Schemas: Datatypes].
|
| *
|
| * Get the IDC binding from the matcher and check for
|
| @@ -22880,10 +22953,10 @@ create_key:
|
| bind = xmlSchemaIDCAcquireBinding(vctxt, matcher);
|
| #endif
|
| targets = xmlSchemaIDCAcquireTargetList(vctxt, matcher);
|
| - if ((idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) &&
|
| + if ((idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) &&
|
| (targets->nbItems != 0)) {
|
| xmlSchemaPSVIIDCKeyPtr ckey, bkey, *bkeySeq;
|
| -
|
| +
|
| i = 0;
|
| res = 0;
|
| /*
|
| @@ -22894,7 +22967,7 @@ create_key:
|
| ((xmlSchemaPSVIIDCNodePtr) targets->items[i])->keys;
|
| for (j = 0; j < nbKeys; j++) {
|
| ckey = (*keySeq)[j];
|
| - bkey = bkeySeq[j];
|
| + bkey = bkeySeq[j];
|
| res = xmlSchemaAreValuesEqual(ckey->val, bkey->val);
|
| if (res == -1) {
|
| return (-1);
|
| @@ -22916,10 +22989,10 @@ create_key:
|
| } while (i < targets->nbItems);
|
| if (i != targets->nbItems) {
|
| xmlChar *str = NULL, *strB = NULL;
|
| - /*
|
| + /*
|
| * TODO: Try to report the key-sequence.
|
| */
|
| - xmlSchemaCustomErr(ACTXT_CAST vctxt,
|
| + xmlSchemaCustomErr(ACTXT_CAST vctxt,
|
| XML_SCHEMAV_CVC_IDC, NULL,
|
| WXS_BASIC_CAST idc,
|
| "Duplicate key-sequence %s in %s",
|
| @@ -22937,15 +23010,15 @@ create_key:
|
| ntItem = (xmlSchemaPSVIIDCNodePtr) xmlMalloc(
|
| sizeof(xmlSchemaPSVIIDCNode));
|
| if (ntItem == NULL) {
|
| - xmlSchemaVErrMemory(NULL,
|
| + xmlSchemaVErrMemory(NULL,
|
| "allocating an IDC node-table item", NULL);
|
| xmlFree(*keySeq);
|
| *keySeq = NULL;
|
| return(-1);
|
| - }
|
| + }
|
| memset(ntItem, 0, sizeof(xmlSchemaPSVIIDCNode));
|
| -
|
| - /*
|
| +
|
| + /*
|
| * Store the node-table item in a global list.
|
| */
|
| if (idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) {
|
| @@ -22967,7 +23040,7 @@ create_key:
|
| xmlFree(ntItem);
|
| xmlFree(*keySeq);
|
| *keySeq = NULL;
|
| - return (-1);
|
| + return (-1);
|
| }
|
| }
|
| /*
|
| @@ -22979,11 +23052,11 @@ create_key:
|
| ntItem->keys = *keySeq;
|
| *keySeq = NULL;
|
| #if 0
|
| - if (xmlSchemaIDCAppendNodeTableItem(bind, ntItem) == -1) {
|
| + if (xmlSchemaIDCAppendNodeTableItem(bind, ntItem) == -1)
|
| #endif
|
| if (xmlSchemaItemListAdd(targets, ntItem) == -1) {
|
| if (idc->type == XML_SCHEMA_TYPE_IDC_KEYREF) {
|
| - /*
|
| + /*
|
| * Free the item, since keyref items won't be
|
| * put on a global list.
|
| */
|
| @@ -22992,18 +23065,18 @@ create_key:
|
| }
|
| return (-1);
|
| }
|
| -
|
| +
|
| goto selector_leave;
|
| selector_key_error:
|
| {
|
| xmlChar *str = NULL;
|
| /*
|
| - * 4.2.1 (KEY) The ·target node set· and the
|
| - * ·qualified node set· are equal, that is, every
|
| - * member of the ·target node set· is also a member
|
| - * of the ·qualified node set· and vice versa.
|
| + * 4.2.1 (KEY) The �target node set� and the
|
| + * �qualified node set� are equal, that is, every
|
| + * member of the �target node set� is also a member
|
| + * of the �qualified node set� and vice versa.
|
| */
|
| - xmlSchemaCustomErr(ACTXT_CAST vctxt,
|
| + xmlSchemaCustomErr(ACTXT_CAST vctxt,
|
| XML_SCHEMAV_CVC_IDC, NULL,
|
| WXS_BASIC_CAST idc,
|
| "Not all fields of %s evaluate to a node",
|
| @@ -23019,7 +23092,7 @@ selector_leave:
|
| *keySeq = NULL;
|
| }
|
| } /* if selector */
|
| -
|
| +
|
| sto->nbHistory--;
|
|
|
| deregister_check:
|
| @@ -23070,15 +23143,15 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt,
|
| xmlSchemaIDCMatcherPtr matcher, last = NULL;
|
| xmlSchemaIDCPtr idc, refIdc;
|
| xmlSchemaIDCAugPtr aidc;
|
| -
|
| +
|
| idc = (xmlSchemaIDCPtr) elemDecl->idcs;
|
| if (idc == NULL)
|
| return (0);
|
| -
|
| +
|
| #ifdef DEBUG_IDC
|
| {
|
| xmlChar *str = NULL;
|
| - xmlGenericError(xmlGenericErrorContext,
|
| + xmlGenericError(xmlGenericErrorContext,
|
| "IDC: REGISTER on %s, depth %d\n",
|
| (char *) xmlSchemaFormatQName(&str, vctxt->inode->nsName,
|
| vctxt->inode->localName), vctxt->depth);
|
| @@ -23119,7 +23192,7 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt,
|
| "Could not find an augmented IDC item for an IDC "
|
| "definition");
|
| return (-1);
|
| - }
|
| + }
|
| if ((aidc->keyrefDepth == -1) ||
|
| (vctxt->depth < aidc->keyrefDepth))
|
| aidc->keyrefDepth = vctxt->depth;
|
| @@ -23150,10 +23223,10 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt,
|
| vctxt->idcMatcherCache = matcher->nextCached;
|
| matcher->nextCached = NULL;
|
| } else {
|
| - matcher = (xmlSchemaIDCMatcherPtr)
|
| + matcher = (xmlSchemaIDCMatcherPtr)
|
| xmlMalloc(sizeof(xmlSchemaIDCMatcher));
|
| if (matcher == NULL) {
|
| - xmlSchemaVErrMemory(vctxt,
|
| + xmlSchemaVErrMemory(vctxt,
|
| "allocating an IDC matcher", NULL);
|
| return (-1);
|
| }
|
| @@ -23166,16 +23239,16 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt,
|
| last = matcher;
|
|
|
| matcher->type = IDC_MATCHER;
|
| - matcher->depth = vctxt->depth;
|
| + matcher->depth = vctxt->depth;
|
| matcher->aidc = aidc;
|
| matcher->idcType = aidc->def->type;
|
| -#ifdef DEBUG_IDC
|
| +#ifdef DEBUG_IDC
|
| xmlGenericError(xmlGenericErrorContext, "IDC: register matcher\n");
|
| -#endif
|
| +#endif
|
| /*
|
| - * Init the automaton state object.
|
| + * Init the automaton state object.
|
| */
|
| - if (xmlSchemaIDCAddStateObject(vctxt, matcher,
|
| + if (xmlSchemaIDCAddStateObject(vctxt, matcher,
|
| idc->selector, XPATH_STATE_OBJ_TYPE_IDC_SELECTOR) == -1)
|
| return (-1);
|
|
|
| @@ -23192,7 +23265,7 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
|
| int res, i, j, k, nbTargets, nbFields, nbDupls, nbNodeTable;
|
| xmlSchemaPSVIIDCKeyPtr *keys, *ntkeys;
|
| xmlSchemaPSVIIDCNodePtr *targets, *dupls;
|
| -
|
| +
|
| xmlSchemaIDCMatcherPtr matcher = ielem->idcMatchers;
|
| /* vctxt->createIDCNodeTables */
|
| while (matcher != NULL) {
|
| @@ -23226,7 +23299,7 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
|
| nbDupls = bind->dupls->nbItems;
|
| } else {
|
| dupls = NULL;
|
| - nbDupls = 0;
|
| + nbDupls = 0;
|
| }
|
| if (bind->nodeTable != NULL) {
|
| nbNodeTable = bind->nbNodes;
|
| @@ -23239,29 +23312,29 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
|
| * Transfer all IDC target-nodes to the IDC node-table.
|
| */
|
| bind->nodeTable =
|
| - (xmlSchemaPSVIIDCNodePtr *) matcher->targets->items;
|
| + (xmlSchemaPSVIIDCNodePtr *) matcher->targets->items;
|
| bind->sizeNodes = matcher->targets->sizeItems;
|
| bind->nbNodes = matcher->targets->nbItems;
|
|
|
| matcher->targets->items = NULL;
|
| matcher->targets->sizeItems = 0;
|
| - matcher->targets->nbItems = 0;
|
| + matcher->targets->nbItems = 0;
|
| } else {
|
| /*
|
| * Compare the key-sequences and add to the IDC node-table.
|
| */
|
| nbTargets = matcher->targets->nbItems;
|
| - targets = (xmlSchemaPSVIIDCNodePtr *) matcher->targets->items;
|
| + targets = (xmlSchemaPSVIIDCNodePtr *) matcher->targets->items;
|
| nbFields = matcher->aidc->def->nbFields;
|
| i = 0;
|
| do {
|
| keys = targets[i]->keys;
|
| - if (nbDupls) {
|
| + if (nbDupls) {
|
| /*
|
| * Search in already found duplicates first.
|
| */
|
| j = 0;
|
| - do {
|
| + do {
|
| if (nbFields == 1) {
|
| res = xmlSchemaAreValuesEqual(keys[0]->val,
|
| dupls[j]->keys[0]->val);
|
| @@ -23296,11 +23369,11 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
|
| }
|
| }
|
| j++;
|
| - } while (j < nbDupls);
|
| + } while (j < nbDupls);
|
| }
|
| if (nbNodeTable) {
|
| j = 0;
|
| - do {
|
| + do {
|
| if (nbFields == 1) {
|
| res = xmlSchemaAreValuesEqual(keys[0]->val,
|
| bind->nodeTable[j]->keys[0]->val);
|
| @@ -23327,7 +23400,7 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
|
| goto next_node_table_entry;
|
| }
|
| }
|
| - }
|
| + }
|
| /*
|
| * Add the duplicate to the list of duplicates.
|
| */
|
| @@ -23335,7 +23408,7 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
|
| bind->dupls = xmlSchemaItemListCreate();
|
| if (bind->dupls == NULL)
|
| goto internal_error;
|
| - }
|
| + }
|
| if (xmlSchemaItemListAdd(bind->dupls, bind->nodeTable[j]) == -1)
|
| goto internal_error;
|
| /*
|
| @@ -23370,12 +23443,12 @@ internal_error:
|
| }
|
|
|
| /**
|
| - * xmlSchemaBubbleIDCNodeTables:
|
| + * xmlSchemaBubbleIDCNodeTables:
|
| * @depth: the current tree depth
|
| *
|
| - * Merges IDC bindings of an element at @depth into the corresponding IDC
|
| - * bindings of its parent element. If a duplicate note-table entry is found,
|
| - * both, the parent node-table entry and child entry are discarded from the
|
| + * Merges IDC bindings of an element at @depth into the corresponding IDC
|
| + * bindings of its parent element. If a duplicate note-table entry is found,
|
| + * both, the parent node-table entry and child entry are discarded from the
|
| * node-table of the parent.
|
| *
|
| * Returns 0 if OK and -1 on internal errors.
|
| @@ -23389,19 +23462,19 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
|
| xmlSchemaIDCAugPtr aidc;
|
| int i, j, k, ret = 0, nbFields, oldNum, oldDupls;
|
|
|
| - bind = vctxt->inode->idcTable;
|
| + bind = vctxt->inode->idcTable;
|
| if (bind == NULL) {
|
| /* Fine, no table, no bubbles. */
|
| return (0);
|
| }
|
| -
|
| +
|
| parTable = &(vctxt->elemInfos[vctxt->depth -1]->idcTable);
|
| /*
|
| * Walk all bindings; create new or add to existing bindings.
|
| * Remove duplicate key-sequences.
|
| */
|
| while (bind != NULL) {
|
| -
|
| +
|
| if ((bind->nbNodes == 0) && WXS_ILIST_IS_EMPTY(bind->dupls))
|
| goto next_binding;
|
| /*
|
| @@ -23411,7 +23484,7 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
|
| aidc = vctxt->aidcs;
|
| do {
|
| if (aidc->def == bind->definition) {
|
| - if ((aidc->keyrefDepth == -1) ||
|
| + if ((aidc->keyrefDepth == -1) ||
|
| (aidc->keyrefDepth >= vctxt->depth)) {
|
| goto next_binding;
|
| }
|
| @@ -23427,7 +23500,7 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
|
| * Search a matching parent binding for the
|
| * IDC definition.
|
| */
|
| - while (parBind != NULL) {
|
| + while (parBind != NULL) {
|
| if (parBind->definition == bind->definition)
|
| break;
|
| parBind = parBind->next;
|
| @@ -23435,7 +23508,7 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
|
|
|
| if (parBind != NULL) {
|
| /*
|
| - * Compare every node-table entry of the child node,
|
| + * Compare every node-table entry of the child node,
|
| * i.e. the key-sequence within, ...
|
| */
|
| oldNum = parBind->nbNodes; /* Skip newly added items. */
|
| @@ -23445,12 +23518,12 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
|
| dupls = (xmlSchemaPSVIIDCNodePtr *) parBind->dupls->items;
|
| } else {
|
| dupls = NULL;
|
| - oldDupls = 0;
|
| + oldDupls = 0;
|
| }
|
| -
|
| +
|
| parNodes = parBind->nodeTable;
|
| nbFields = bind->definition->nbFields;
|
| -
|
| +
|
| for (i = 0; i < bind->nbNodes; i++) {
|
| node = bind->nodeTable[i];
|
| if (node == NULL)
|
| @@ -23460,7 +23533,7 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
|
| * evaluated to be a duplicate key-sequence.
|
| */
|
| if (oldDupls) {
|
| - j = 0;
|
| + j = 0;
|
| while (j < oldDupls) {
|
| if (nbFields == 1) {
|
| ret = xmlSchemaAreValuesEqual(
|
| @@ -23493,12 +23566,12 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
|
| /* Duplicate found. Skip this entry. */
|
| continue;
|
| }
|
| - }
|
| + }
|
| /*
|
| * ... and with every key-sequence of the parent node.
|
| */
|
| if (oldNum) {
|
| - j = 0;
|
| + j = 0;
|
| while (j < oldNum) {
|
| parNode = parNodes[j];
|
| if (nbFields == 1) {
|
| @@ -23511,7 +23584,7 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
|
| j++;
|
| continue;
|
| }
|
| - } else {
|
| + } else {
|
| for (k = 0; k < nbFields; k++) {
|
| ret = xmlSchemaAreValuesEqual(
|
| node->keys[k]->val,
|
| @@ -23532,20 +23605,20 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
|
| * Handle duplicates. Move the duplicate in
|
| * the parent's node-table to the list of
|
| * duplicates.
|
| - */
|
| + */
|
| oldNum--;
|
| parBind->nbNodes--;
|
| /*
|
| * Move last old item to pos of duplicate.
|
| */
|
| parNodes[j] = parNodes[oldNum];
|
| -
|
| +
|
| if (parBind->nbNodes != oldNum) {
|
| /*
|
| - * If new items exist, move last new item to
|
| + * If new items exist, move last new item to
|
| * last of old items.
|
| */
|
| - parNodes[oldNum] =
|
| + parNodes[oldNum] =
|
| parNodes[parBind->nbNodes];
|
| }
|
| if (parBind->dupls == NULL) {
|
| @@ -23553,31 +23626,31 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
|
| if (parBind->dupls == NULL)
|
| goto internal_error;
|
| }
|
| - xmlSchemaItemListAdd(parBind->dupls, parNode);
|
| + xmlSchemaItemListAdd(parBind->dupls, parNode);
|
| } else {
|
| /*
|
| - * Add the node-table entry (node and key-sequence) of
|
| + * Add the node-table entry (node and key-sequence) of
|
| * the child node to the node table of the parent node.
|
| */
|
| - if (parBind->nodeTable == NULL) {
|
| - parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *)
|
| + if (parBind->nodeTable == NULL) {
|
| + parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *)
|
| xmlMalloc(10 * sizeof(xmlSchemaPSVIIDCNodePtr));
|
| if (parBind->nodeTable == NULL) {
|
| - xmlSchemaVErrMemory(NULL,
|
| + xmlSchemaVErrMemory(NULL,
|
| "allocating IDC list of node-table items", NULL);
|
| goto internal_error;
|
| }
|
| parBind->sizeNodes = 1;
|
| } else if (parBind->nbNodes >= parBind->sizeNodes) {
|
| parBind->sizeNodes *= 2;
|
| - parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *)
|
| - xmlRealloc(parBind->nodeTable, parBind->sizeNodes *
|
| + parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *)
|
| + xmlRealloc(parBind->nodeTable, parBind->sizeNodes *
|
| sizeof(xmlSchemaPSVIIDCNodePtr));
|
| if (parBind->nodeTable == NULL) {
|
| - xmlSchemaVErrMemory(NULL,
|
| + xmlSchemaVErrMemory(NULL,
|
| "re-allocating IDC list of node-table items", NULL);
|
| goto internal_error;
|
| - }
|
| + }
|
| }
|
| parNodes = parBind->nodeTable;
|
| /*
|
| @@ -23587,9 +23660,9 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
|
| parNodes[parBind->nbNodes++] = node;
|
| }
|
|
|
| - }
|
| -
|
| - }
|
| + }
|
| +
|
| + }
|
| } else {
|
| /*
|
| * No binding for the IDC was found: create a new one and
|
| @@ -23598,7 +23671,7 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
|
| parBind = xmlSchemaIDCNewBinding(bind->definition);
|
| if (parBind == NULL)
|
| goto internal_error;
|
| -
|
| +
|
| /*
|
| * TODO: Hmm, how to optimize the initial number of
|
| * allocated entries?
|
| @@ -23624,11 +23697,11 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
|
| /*
|
| * Copy the entries.
|
| */
|
| - parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *)
|
| + parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *)
|
| xmlMalloc(bind->nbNodes *
|
| sizeof(xmlSchemaPSVIIDCNodePtr));
|
| if (parBind->nodeTable == NULL) {
|
| - xmlSchemaVErrMemory(NULL,
|
| + xmlSchemaVErrMemory(NULL,
|
| "allocating an array of IDC node-table "
|
| "items", NULL);
|
| xmlSchemaIDCFreeBinding(parBind);
|
| @@ -23647,15 +23720,17 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
|
| if (parBind->dupls != NULL)
|
| xmlSchemaItemListFree(parBind->dupls);
|
| parBind->dupls = bind->dupls;
|
| - bind->dupls = NULL;
|
| - }
|
| - if (*parTable == NULL)
|
| - *parTable = parBind;
|
| - else {
|
| - parBind->next = *parTable;
|
| - *parTable = parBind;
|
| - }
|
| - }
|
| + bind->dupls = NULL;
|
| + }
|
| + if (parTable != NULL) {
|
| + if (*parTable == NULL)
|
| + *parTable = parBind;
|
| + else {
|
| + parBind->next = *parTable;
|
| + *parTable = parBind;
|
| + }
|
| + }
|
| + }
|
|
|
| next_binding:
|
| bind = bind->next;
|
| @@ -23678,7 +23753,7 @@ xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt)
|
| {
|
| xmlSchemaIDCMatcherPtr matcher;
|
| xmlSchemaPSVIIDCBindingPtr bind;
|
| -
|
| +
|
| matcher = vctxt->inode->idcMatchers;
|
| /*
|
| * Find a keyref.
|
| @@ -23699,7 +23774,7 @@ xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt)
|
| */
|
| bind = vctxt->inode->idcTable;
|
| while (bind != NULL) {
|
| - if ((xmlSchemaIDCPtr) matcher->aidc->def->ref->item ==
|
| + if ((xmlSchemaIDCPtr) matcher->aidc->def->ref->item ==
|
| bind->definition)
|
| break;
|
| bind = bind->next;
|
| @@ -23768,7 +23843,7 @@ xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt)
|
| }
|
| }
|
| }
|
| -
|
| +
|
| if (res == 0) {
|
| xmlChar *str = NULL, *strB = NULL;
|
| xmlSchemaKeyrefErr(vctxt,
|
| @@ -23852,7 +23927,7 @@ xmlSchemaValidatorPushAttribute(xmlSchemaValidCtxtPtr vctxt,
|
| xmlNodePtr attrNode,
|
| int nodeLine,
|
| const xmlChar *localName,
|
| - const xmlChar *nsName,
|
| + const xmlChar *nsName,
|
| int ownedNames,
|
| xmlChar *value,
|
| int ownedValue)
|
| @@ -23878,7 +23953,7 @@ xmlSchemaValidatorPushAttribute(xmlSchemaValidCtxtPtr vctxt,
|
| if (nsName != NULL) {
|
| if (xmlStrEqual(localName, BAD_CAST "nil")) {
|
| if (xmlStrEqual(attr->nsName, xmlSchemaInstanceNs)) {
|
| - attr->metaType = XML_SCHEMA_ATTR_INFO_META_XSI_NIL;
|
| + attr->metaType = XML_SCHEMA_ATTR_INFO_META_XSI_NIL;
|
| }
|
| } else if (xmlStrEqual(localName, BAD_CAST "type")) {
|
| if (xmlStrEqual(attr->nsName, xmlSchemaInstanceNs)) {
|
| @@ -24099,7 +24174,7 @@ xmlSchemaValidateFacets(xmlSchemaAbstractCtxtPtr actxt,
|
| valType = valType;
|
| else
|
| valType = xmlSchemaGetValType(val);
|
| -
|
| +
|
| ret = 0;
|
| for (facetLink = type->facetSet; facetLink != NULL;
|
| facetLink = facetLink->next) {
|
| @@ -24148,11 +24223,11 @@ WXS_IS_LIST:
|
| ret = 0;
|
| for (facetLink = type->facetSet; facetLink != NULL;
|
| facetLink = facetLink->next) {
|
| -
|
| +
|
| switch (facetLink->facet->type) {
|
| case XML_SCHEMA_FACET_LENGTH:
|
| case XML_SCHEMA_FACET_MINLENGTH:
|
| - case XML_SCHEMA_FACET_MAXLENGTH:
|
| + case XML_SCHEMA_FACET_MAXLENGTH:
|
| ret = xmlSchemaValidateListSimpleTypeFacet(facetLink->facet,
|
| value, length, NULL);
|
| break;
|
| @@ -24164,7 +24239,7 @@ WXS_IS_LIST:
|
| "validating against a list type facet");
|
| return (-1);
|
| } else if (ret > 0) {
|
| - if (fireErrors)
|
| + if (fireErrors)
|
| xmlSchemaFacetErr(actxt, ret, node,
|
| value, length, type, facetLink->facet, NULL, NULL, NULL);
|
| else
|
| @@ -24241,7 +24316,7 @@ pattern_and_enum:
|
| if (facetLink->facet->type != XML_SCHEMA_FACET_PATTERN)
|
| continue;
|
| found = 1;
|
| - /*
|
| + /*
|
| * NOTE that for patterns, @value needs to be the
|
| * normalized vaule.
|
| */
|
| @@ -24253,7 +24328,7 @@ pattern_and_enum:
|
| "validating against a pattern facet");
|
| return (-1);
|
| } else {
|
| - /*
|
| + /*
|
| * Save the last non-validating facet.
|
| */
|
| facet = facetLink->facet;
|
| @@ -24276,12 +24351,12 @@ pattern_and_enum:
|
|
|
| return (error);
|
| }
|
| -
|
| +
|
| static xmlChar *
|
| xmlSchemaNormalizeValue(xmlSchemaTypePtr type,
|
| const xmlChar *value)
|
| {
|
| - switch (xmlSchemaGetWhiteSpaceFacetValue(type)) {
|
| + switch (xmlSchemaGetWhiteSpaceFacetValue(type)) {
|
| case XML_SCHEMA_WHITESPACE_COLLAPSE:
|
| return (xmlSchemaCollapseString(value));
|
| case XML_SCHEMA_WHITESPACE_REPLACE:
|
| @@ -24300,7 +24375,7 @@ xmlSchemaValidateQName(xmlSchemaValidCtxtPtr vctxt,
|
| int ret;
|
| const xmlChar *nsName;
|
| xmlChar *local, *prefix = NULL;
|
| -
|
| +
|
| ret = xmlValidateQName(value, 1);
|
| if (ret != 0) {
|
| if (ret == -1) {
|
| @@ -24323,7 +24398,7 @@ xmlSchemaValidateQName(xmlSchemaValidCtxtPtr vctxt,
|
| * - is there a default namespace?
|
| */
|
| nsName = xmlSchemaLookupNamespace(vctxt, prefix);
|
| -
|
| +
|
| if (prefix != NULL) {
|
| xmlFree(prefix);
|
| /*
|
| @@ -24380,7 +24455,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| value = normValue; \
|
| isNormalized = 1; \
|
| }
|
| -
|
| +
|
| if ((retVal != NULL) && (*retVal != NULL)) {
|
| xmlSchemaFreeValue(*retVal);
|
| *retVal = NULL;
|
| @@ -24395,14 +24470,14 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| */
|
| /*
|
| * 2.1 If The definition is ENTITY or is validly derived from ENTITY given
|
| - * the empty set, as defined in Type Derivation OK (Simple) (§3.14.6), then
|
| - * the string must be a ·declared entity name·.
|
| + * the empty set, as defined in Type Derivation OK (Simple) (�3.14.6), then
|
| + * the string must be a �declared entity name�.
|
| */
|
| /*
|
| * 2.2 If The definition is ENTITIES or is validly derived from ENTITIES
|
| - * given the empty set, as defined in Type Derivation OK (Simple) (§3.14.6),
|
| - * then every whitespace-delimited substring of the string must be a ·declared
|
| - * entity name·.
|
| + * given the empty set, as defined in Type Derivation OK (Simple) (�3.14.6),
|
| + * then every whitespace-delimited substring of the string must be a �declared
|
| + * entity name�.
|
| */
|
| /*
|
| * 2.3 otherwise no further condition applies.
|
| @@ -24414,8 +24489,8 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| if (WXS_IS_ANY_SIMPLE_TYPE(type) || WXS_IS_ATOMIC(type)) {
|
| xmlSchemaTypePtr biType; /* The built-in type. */
|
| /*
|
| - * SPEC (1.2.1) "if {variety} is ·atomic· then the string must ·match·
|
| - * a literal in the ·lexical space· of {base type definition}"
|
| + * SPEC (1.2.1) "if {variety} is �atomic� then the string must �match�
|
| + * a literal in the �lexical space� of {base type definition}"
|
| */
|
| /*
|
| * Whitespace-normalize.
|
| @@ -24441,9 +24516,9 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| * NOTATIONs need to be processed here, since they need
|
| * to lookup in the hashtable of NOTATION declarations of the schema.
|
| */
|
| - if (actxt->type == XML_SCHEMA_CTXT_VALIDATOR) {
|
| - switch (biType->builtInType) {
|
| - case XML_SCHEMAS_NOTATION:
|
| + if (actxt->type == XML_SCHEMA_CTXT_VALIDATOR) {
|
| + switch (biType->builtInType) {
|
| + case XML_SCHEMAS_NOTATION:
|
| ret = xmlSchemaValidateNotation(
|
| (xmlSchemaValidCtxtPtr) actxt,
|
| ((xmlSchemaValidCtxtPtr) actxt)->schema,
|
| @@ -24457,14 +24532,14 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| /* ws = xmlSchemaGetWhiteSpaceFacetValue(type); */
|
| if (valNeeded)
|
| ret = xmlSchemaValPredefTypeNodeNoNorm(biType,
|
| - value, &val, NULL);
|
| + value, &val, node);
|
| else
|
| ret = xmlSchemaValPredefTypeNodeNoNorm(biType,
|
| - value, NULL, NULL);
|
| + value, NULL, node);
|
| break;
|
| }
|
| - } else if (actxt->type == XML_SCHEMA_CTXT_PARSER) {
|
| - switch (biType->builtInType) {
|
| + } else if (actxt->type == XML_SCHEMA_CTXT_PARSER) {
|
| + switch (biType->builtInType) {
|
| case XML_SCHEMAS_NOTATION:
|
| ret = xmlSchemaValidateNotation(NULL,
|
| ((xmlSchemaParserCtxtPtr) actxt)->schema, node,
|
| @@ -24479,7 +24554,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| ret = xmlSchemaValPredefTypeNodeNoNorm(biType,
|
| value, NULL, node);
|
| break;
|
| - }
|
| + }
|
| } else {
|
| /*
|
| * Validation via a public API is not implemented yet.
|
| @@ -24496,7 +24571,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| if (WXS_IS_LIST(type))
|
| ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2;
|
| else
|
| - ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1;
|
| + ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1;
|
| }
|
| if ((ret == 0) && (type->flags & XML_SCHEMAS_TYPE_HAS_FACETS)) {
|
| /*
|
| @@ -24511,10 +24586,10 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| "validating facets of atomic simple type");
|
| goto internal_error;
|
| }
|
| - if (WXS_IS_LIST(type))
|
| + if (WXS_IS_LIST(type))
|
| ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2;
|
| else
|
| - ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1;
|
| + ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1;
|
| }
|
| }
|
| if (fireErrors && (ret > 0))
|
| @@ -24526,9 +24601,9 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| xmlChar *tmpValue = NULL;
|
| unsigned long len = 0;
|
| xmlSchemaValPtr prevVal = NULL, curVal = NULL;
|
| - /* 1.2.2 if {variety} is ·list· then the string must be a sequence
|
| - * of white space separated tokens, each of which ·match·es a literal
|
| - * in the ·lexical space· of {item type definition}
|
| + /* 1.2.2 if {variety} is �list� then the string must be a sequence
|
| + * of white space separated tokens, each of which �match�es a literal
|
| + * in the �lexical space� of {item type definition}
|
| */
|
| /*
|
| * Note that XML_SCHEMAS_TYPE_NORMVALUENEEDED will be set if
|
| @@ -24539,7 +24614,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| * VAL TODO: Optimize validation of empty values.
|
| * VAL TODO: We do not have computed values for lists.
|
| */
|
| - itemType = WXS_LIST_ITEMTYPE(type);
|
| + itemType = WXS_LIST_ITEMTYPE(type);
|
| cur = value;
|
| do {
|
| while (IS_BLANK_CH(*cur))
|
| @@ -24578,7 +24653,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| }
|
| ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2;
|
| break;
|
| - }
|
| + }
|
| cur = end;
|
| } while (*cur != 0);
|
| FREE_AND_NULL(tmpValue);
|
| @@ -24599,7 +24674,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| }
|
| }
|
| if (fireErrors && (ret > 0)) {
|
| - /*
|
| + /*
|
| * Report the normalized value.
|
| */
|
| normalize = 1;
|
| @@ -24609,10 +24684,10 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| } else if (WXS_IS_UNION(type)) {
|
| xmlSchemaTypeLinkPtr memberLink;
|
| /*
|
| - * TODO: For all datatypes ·derived· by ·union· whiteSpace does
|
| - * not apply directly; however, the normalization behavior of ·union·
|
| + * TODO: For all datatypes �derived� by �union� whiteSpace does
|
| + * not apply directly; however, the normalization behavior of �union�
|
| * types is controlled by the value of whiteSpace on that one of the
|
| - * ·memberTypes· against which the ·union· is successfully validated.
|
| + * �memberTypes� against which the �union� is successfully validated.
|
| *
|
| * This means that the value is normalized by the first validating
|
| * member type, then the facets of the union type are applied. This
|
| @@ -24620,8 +24695,8 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| */
|
|
|
| /*
|
| - * 1.2.3 if {variety} is ·union· then the string must ·match· a
|
| - * literal in the ·lexical space· of at least one member of
|
| + * 1.2.3 if {variety} is �union� then the string must �match� a
|
| + * literal in the �lexical space� of at least one member of
|
| * {member type definitions}
|
| */
|
| memberLink = xmlSchemaGetUnionSimpleTypeMemberTypes(type);
|
| @@ -24629,7 +24704,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| AERROR_INT("xmlSchemaVCheckCVCSimpleType",
|
| "union simple type has no member types");
|
| goto internal_error;
|
| - }
|
| + }
|
| /*
|
| * Always normalize union type values, since we currently
|
| * cannot store the whitespace information with the value
|
| @@ -24637,7 +24712,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| * not possible.
|
| */
|
| while (memberLink != NULL) {
|
| - if (valNeeded)
|
| + if (valNeeded)
|
| ret = xmlSchemaVCheckCVCSimpleType(actxt, node,
|
| memberLink->type, value, &val, 0, 1, 0);
|
| else
|
| @@ -24660,9 +24735,9 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| */
|
| if ((ret == 0) && (type->flags & XML_SCHEMAS_TYPE_HAS_FACETS)) {
|
| /*
|
| - * The normalization behavior of ·union· types is controlled by
|
| - * the value of whiteSpace on that one of the ·memberTypes·
|
| - * against which the ·union· is successfully validated.
|
| + * The normalization behavior of �union� types is controlled by
|
| + * the value of whiteSpace on that one of the �memberTypes�
|
| + * against which the �union� is successfully validated.
|
| */
|
| NORMALIZE(memberLink->type);
|
| ret = xmlSchemaValidateFacets(actxt, node, type,
|
| @@ -24674,7 +24749,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
|
| "validating facets of union simple type");
|
| goto internal_error;
|
| }
|
| - ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3;
|
| + ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3;
|
| }
|
| }
|
| if (fireErrors && (ret > 0))
|
| @@ -24822,14 +24897,14 @@ xmlSchemaProcessXSIType(xmlSchemaValidCtxtPtr vctxt,
|
|
|
| /*
|
| * SPEC cvc-elt (3.3.4) : (4.3) (Type Derivation OK)
|
| - * "The ·local type definition· must be validly
|
| + * "The �local type definition� must be validly
|
| * derived from the {type definition} given the union of
|
| * the {disallowed substitutions} and the {type definition}'s
|
| * {prohibited substitutions}, as defined in
|
| - * Type Derivation OK (Complex) (§3.4.6)
|
| + * Type Derivation OK (Complex) (�3.4.6)
|
| * (if it is a complex type definition),
|
| * or given {disallowed substitutions} as defined in Type
|
| - * Derivation OK (Simple) (§3.14.6) (if it is a simple type
|
| + * Derivation OK (Simple) (�3.14.6) (if it is a simple type
|
| * definition)."
|
| *
|
| * {disallowed substitutions}: the "block" on the element decl.
|
| @@ -25089,19 +25164,19 @@ xmlSchemaClearAttrInfos(xmlSchemaValidCtxtPtr vctxt)
|
| static int
|
| xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
|
| {
|
| - xmlSchemaTypePtr type = vctxt->inode->typeDef;
|
| + xmlSchemaTypePtr type = vctxt->inode->typeDef;
|
| xmlSchemaItemListPtr attrUseList;
|
| xmlSchemaAttributeUsePtr attrUse = NULL;
|
| xmlSchemaAttributePtr attrDecl = NULL;
|
| - xmlSchemaAttrInfoPtr iattr, tmpiattr;
|
| + xmlSchemaAttrInfoPtr iattr, tmpiattr;
|
| int i, j, found, nbAttrs, nbUses;
|
| int xpathRes = 0, res, wildIDs = 0, fixed;
|
| xmlNodePtr defAttrOwnerElem = NULL;
|
|
|
| /*
|
| * SPEC (cvc-attribute)
|
| - * (1) "The declaration must not be ·absent· (see Missing
|
| - * Sub-components (§5.3) for how this can fail to be
|
| + * (1) "The declaration must not be �absent� (see Missing
|
| + * Sub-components (�5.3) for how this can fail to be
|
| * the case)."
|
| * (2) "Its {type definition} must not be absent."
|
| *
|
| @@ -25151,15 +25226,15 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
|
| * use with an {attribute declaration} whose {name} matches
|
| * the attribute information item's [local name] and whose
|
| * {target namespace} is identical to the attribute information
|
| - * item's [namespace name] (where an ·absent· {target namespace}
|
| + * item's [namespace name] (where an �absent� {target namespace}
|
| * is taken to be identical to a [namespace name] with no value),
|
| - * then the attribute information must be ·valid· with respect
|
| + * then the attribute information must be �valid� with respect
|
| * to that attribute use as per Attribute Locally Valid (Use)
|
| - * (§3.5.4). In this case the {attribute declaration} of that
|
| - * attribute use is the ·context-determined declaration· for the
|
| + * (�3.5.4). In this case the {attribute declaration} of that
|
| + * attribute use is the �context-determined declaration� for the
|
| * attribute information item with respect to Schema-Validity
|
| - * Assessment (Attribute) (§3.2.4) and
|
| - * Assessment Outcome (Attribute) (§3.2.5).
|
| + * Assessment (Attribute) (�3.2.4) and
|
| + * Assessment Outcome (Attribute) (�3.2.5).
|
| */
|
| iattr->state = XML_SCHEMAS_ATTR_ASSESSED;
|
| iattr->use = attrUse;
|
| @@ -25193,7 +25268,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
|
| }
|
| tmpiattr->state = XML_SCHEMAS_ATTR_ERR_MISSING;
|
| tmpiattr->use = attrUse;
|
| - tmpiattr->decl = attrDecl;
|
| + tmpiattr->decl = attrDecl;
|
| } else if ((attrUse->occurs == XML_SCHEMAS_ATTR_USE_OPTIONAL) &&
|
| ((attrUse->defValue != NULL) ||
|
| (attrDecl->defValue != NULL))) {
|
| @@ -25218,7 +25293,6 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
|
|
|
| if (vctxt->nbAttrInfos == 0)
|
| return (0);
|
| - nbUses = vctxt->nbAttrInfos;
|
| /*
|
| * Validate against the wildcard.
|
| */
|
| @@ -25237,13 +25311,13 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
|
| continue;
|
| /*
|
| * SPEC (cvc-complex-type)
|
| - * (3.2.2) "The attribute information item must be ·valid· with
|
| - * respect to it as defined in Item Valid (Wildcard) (§3.10.4)."
|
| + * (3.2.2) "The attribute information item must be �valid� with
|
| + * respect to it as defined in Item Valid (Wildcard) (�3.10.4)."
|
| *
|
| * SPEC Item Valid (Wildcard) (cvc-wildcard)
|
| - * "... its [namespace name] must be ·valid· with respect to
|
| + * "... its [namespace name] must be �valid� with respect to
|
| * the wildcard constraint, as defined in Wildcard allows
|
| - * Namespace Name (§3.10.4)."
|
| + * Namespace Name (�3.10.4)."
|
| */
|
| if (xmlSchemaCheckCVCWildcardNamespace(type->attributeWildcard,
|
| iattr->nsName) == 0) {
|
| @@ -25279,11 +25353,11 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
|
| * SPEC (cvc-complex-type)
|
| * (5) "Let [Definition:] the wild IDs be the set of
|
| * all attribute information item to which clause 3.2
|
| - * applied and whose ·validation· resulted in a
|
| - * ·context-determined declaration· of mustFind or no
|
| - * ·context-determined declaration· at all, and whose
|
| + * applied and whose �validation� resulted in a
|
| + * �context-determined declaration� of mustFind or no
|
| + * �context-determined declaration� at all, and whose
|
| * [local name] and [namespace name] resolve (as
|
| - * defined by QName resolution (Instance) (§3.15.4)) to
|
| + * defined by QName resolution (Instance) (�3.15.4)) to
|
| * an attribute declaration whose {type definition} is
|
| * or is derived from ID. Then all of the following
|
| * must be true:"
|
| @@ -25293,7 +25367,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
|
| iattr->typeDef, XML_SCHEMAS_ID)) {
|
| /*
|
| * SPEC (5.1) "There must be no more than one
|
| - * item in ·wild IDs·."
|
| + * item in �wild IDs�."
|
| */
|
| if (wildIDs != 0) {
|
| /* VAL TODO */
|
| @@ -25304,21 +25378,23 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
|
| wildIDs++;
|
| /*
|
| * SPEC (cvc-complex-type)
|
| - * (5.2) "If ·wild IDs· is non-empty, there must not
|
| + * (5.2) "If �wild IDs� is non-empty, there must not
|
| * be any attribute uses among the {attribute uses}
|
| * whose {attribute declaration}'s {type definition}
|
| * is or is derived from ID."
|
| */
|
| - for (j = 0; j < attrUseList->nbItems; j++) {
|
| - if (xmlSchemaIsDerivedFromBuiltInType(
|
| - WXS_ATTRUSE_TYPEDEF(attrUseList->items[j]),
|
| - XML_SCHEMAS_ID)) {
|
| - /* URGENT VAL TODO: implement */
|
| - iattr->state = XML_SCHEMAS_ATTR_ERR_WILD_AND_USE_ID;
|
| - TODO
|
| - break;
|
| - }
|
| - }
|
| + if (attrUseList != NULL) {
|
| + for (j = 0; j < attrUseList->nbItems; j++) {
|
| + if (xmlSchemaIsDerivedFromBuiltInType(
|
| + WXS_ATTRUSE_TYPEDEF(attrUseList->items[j]),
|
| + XML_SCHEMAS_ID)) {
|
| + /* URGENT VAL TODO: implement */
|
| + iattr->state = XML_SCHEMAS_ATTR_ERR_WILD_AND_USE_ID;
|
| + TODO
|
| + break;
|
| + }
|
| + }
|
| + }
|
| }
|
| } else if (type->attributeWildcard->processContents ==
|
| XML_SCHEMAS_ANY_LAX) {
|
| @@ -25421,7 +25497,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
|
| * VAL TODO: Should we use the *normalized* value? This currently
|
| * uses the *initial* value.
|
| */
|
| -
|
| +
|
| if (defAttrOwnerElem) {
|
| xmlChar *normValue;
|
| const xmlChar *value;
|
| @@ -25512,9 +25588,9 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
|
| fixed = 0;
|
| /*
|
| * SPEC (cvc-attribute)
|
| - * (3) "The item's ·normalized value· must be locally ·valid·
|
| - * with respect to that {type definition} as per
|
| - * String Valid (§3.14.4)."
|
| + * (3) "The item's �normalized value� must be locally �valid�
|
| + * with respect to that {type definition} as per
|
| + * String Valid (�3.14.4)."
|
| *
|
| * VAL TODO: Do we already have the
|
| * "normalized attribute value" here?
|
| @@ -25534,7 +25610,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
|
| iattr->node, iattr->typeDef, iattr->value, NULL,
|
| 1, 0, 0);
|
| }
|
| -
|
| +
|
| if (res != 0) {
|
| if (res == -1) {
|
| VERROR_INT("xmlSchemaVAttributesComplex",
|
| @@ -25549,12 +25625,12 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
|
| goto eval_idcs;
|
| }
|
|
|
| - if (fixed) {
|
| + if (fixed) {
|
| /*
|
| * SPEC Attribute Locally Valid (Use) (cvc-au)
|
| - * "For an attribute information item to be·valid·
|
| + * "For an attribute information item to be�valid�
|
| * with respect to an attribute use its *normalized*
|
| - * value· must match the *canonical* lexical
|
| + * value� must match the *canonical* lexical
|
| * representation of the attribute use's {value
|
| * constraint}value, if it is present and fixed."
|
| *
|
| @@ -25563,7 +25639,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
|
| */
|
| /*
|
| * SPEC Attribute Locally Valid (cvc-attribute)
|
| - * (4) "The item's *actual* value· must match the *value* of
|
| + * (4) "The item's *actual* value� must match the *value* of
|
| * the {value constraint}, if it is present and fixed."
|
| */
|
| if (iattr->val == NULL) {
|
| @@ -25655,8 +25731,8 @@ eval_idcs:
|
| xmlSchemaCustomErr(ACTXT_CAST vctxt,
|
| XML_SCHEMAV_CVC_AU, NULL, NULL,
|
| "The value '%s' does not match the fixed "
|
| - "value constraint '%s'",
|
| - iattr->value, iattr->vcValue);
|
| + "value constraint '%s'",
|
| + iattr->value, iattr->vcValue);
|
| break;
|
| case XML_SCHEMAS_ATTR_ERR_WILD_STRICT_NO_DECL:
|
| VERROR(XML_SCHEMAV_CVC_WILDCARD, NULL,
|
| @@ -25718,7 +25794,7 @@ xmlSchemaValidateElemWildcard(xmlSchemaValidCtxtPtr vctxt,
|
| xmlSchemaElementPtr decl = NULL;
|
|
|
| decl = xmlSchemaGetElem(vctxt->schema,
|
| - vctxt->inode->localName, vctxt->inode->nsName);
|
| + vctxt->inode->localName, vctxt->inode->nsName);
|
| if (decl != NULL) {
|
| vctxt->inode->decl = decl;
|
| return (0);
|
| @@ -25776,16 +25852,16 @@ static int
|
| xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt,
|
| const xmlChar *value,
|
| xmlSchemaValPtr *val)
|
| -{
|
| +{
|
| int ret = 0;
|
| xmlSchemaNodeInfoPtr inode = vctxt->inode;
|
|
|
| /*
|
| * cos-valid-default:
|
| * Schema Component Constraint: Element Default Valid (Immediate)
|
| - * For a string to be a valid default with respect to a type
|
| + * For a string to be a valid default with respect to a type
|
| * definition the appropriate case among the following must be true:
|
| - */
|
| + */
|
| if WXS_IS_COMPLEX(inode->typeDef) {
|
| /*
|
| * Complex type.
|
| @@ -25793,8 +25869,8 @@ xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt,
|
| * SPEC (2.1) "its {content type} must be a simple type definition
|
| * or mixed."
|
| * SPEC (2.2.2) "If the {content type} is mixed, then the {content
|
| - * type}'s particle must be ·emptiable· as defined by
|
| - * Particle Emptiable (§3.9.6)."
|
| + * type}'s particle must be �emptiable� as defined by
|
| + * Particle Emptiable (�3.9.6)."
|
| */
|
| if ((! WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) &&
|
| ((! WXS_HAS_MIXED_CONTENT(inode->typeDef)) ||
|
| @@ -25807,18 +25883,18 @@ xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt,
|
| "or mixed content and a particle emptiable");
|
| return(ret);
|
| }
|
| - }
|
| + }
|
| /*
|
| - * 1 If the type definition is a simple type definition, then the string
|
| - * must be ·valid· with respect to that definition as defined by String
|
| - * Valid (§3.14.4).
|
| + * 1 If the type definition is a simple type definition, then the string
|
| + * must be �valid� with respect to that definition as defined by String
|
| + * Valid (�3.14.4).
|
| *
|
| * AND
|
| *
|
| - * 2.2.1 If the {content type} is a simple type definition, then the
|
| - * string must be ·valid· with respect to that simple type definition
|
| - * as defined by String Valid (§3.14.4).
|
| - */
|
| + * 2.2.1 If the {content type} is a simple type definition, then the
|
| + * string must be �valid� with respect to that simple type definition
|
| + * as defined by String Valid (�3.14.4).
|
| + */
|
| if (WXS_IS_SIMPLE(inode->typeDef)) {
|
|
|
| ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST vctxt,
|
| @@ -25832,7 +25908,7 @@ xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt,
|
| if (ret < 0) {
|
| VERROR_INT("xmlSchemaCheckCOSValidDefault",
|
| "calling xmlSchemaVCheckCVCSimpleType()");
|
| - }
|
| + }
|
| return (ret);
|
| }
|
|
|
| @@ -25866,13 +25942,13 @@ xmlSchemaVContentModelCallback(xmlSchemaValidCtxtPtr vctxt ATTRIBUTE_UNUSED,
|
|
|
| static int
|
| xmlSchemaValidatorPushElem(xmlSchemaValidCtxtPtr vctxt)
|
| -{
|
| +{
|
| vctxt->inode = xmlSchemaGetFreshElemInfo(vctxt);
|
| if (vctxt->inode == NULL) {
|
| VERROR_INT("xmlSchemaValidatorPushElem",
|
| "calling xmlSchemaGetFreshElemInfo()");
|
| return (-1);
|
| - }
|
| + }
|
| vctxt->nbAttrInfos = 0;
|
| return (0);
|
| }
|
| @@ -25895,7 +25971,7 @@ xmlSchemaVCheckINodeDataType(xmlSchemaValidCtxtPtr vctxt,
|
|
|
|
|
|
|
| -/*
|
| +/*
|
| * Process END of element.
|
| */
|
| static int
|
| @@ -25914,7 +25990,7 @@ xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt)
|
| */
|
| vctxt->skipDepth = vctxt->depth -1;
|
| goto end_elem;
|
| - }
|
| + }
|
| if ((inode->typeDef == NULL) ||
|
| (inode->flags & XML_SCHEMA_NODE_INFO_ERR_BAD_TYPE)) {
|
| /*
|
| @@ -25934,8 +26010,8 @@ xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt)
|
| * Workaround for "anyType".
|
| */
|
| if (inode->typeDef->builtInType == XML_SCHEMAS_ANYTYPE)
|
| - goto character_content;
|
| -
|
| + goto character_content;
|
| +
|
| if ((inode->flags & XML_SCHEMA_ELEM_INFO_ERR_BAD_CONTENT) == 0) {
|
| xmlChar *values[10];
|
| int terminal, nbval = 10, nbneg;
|
| @@ -25956,12 +26032,12 @@ xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt)
|
| #ifdef DEBUG_AUTOMATA
|
| xmlGenericError(xmlGenericErrorContext,
|
| "AUTOMATON create on '%s'\n", inode->localName);
|
| -#endif
|
| +#endif
|
| }
|
| /*
|
| * Get hold of the still expected content, since a further
|
| * call to xmlRegExecPushString() will loose this information.
|
| - */
|
| + */
|
| xmlRegExecNextValues(inode->regexCtxt,
|
| &nbval, &nbneg, &values[0], &terminal);
|
| ret = xmlRegExecPushString(inode->regexCtxt, NULL, NULL);
|
| @@ -26011,14 +26087,14 @@ character_content:
|
| /*
|
| * Speedup if no declaration exists.
|
| */
|
| - if (WXS_IS_SIMPLE(inode->typeDef)) {
|
| + if (WXS_IS_SIMPLE(inode->typeDef)) {
|
| ret = xmlSchemaVCheckINodeDataType(vctxt,
|
| inode, inode->typeDef, inode->value);
|
| } else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) {
|
| ret = xmlSchemaVCheckINodeDataType(vctxt,
|
| inode, inode->typeDef->contentTypeDef,
|
| inode->value);
|
| - }
|
| + }
|
| if (ret < 0) {
|
| VERROR_INT("xmlSchemaValidatorPopElem",
|
| "calling xmlSchemaVCheckCVCSimpleType()");
|
| @@ -26027,26 +26103,26 @@ character_content:
|
| goto end_elem;
|
| }
|
| /*
|
| - * cvc-elt (3.3.4) : 5
|
| + * cvc-elt (3.3.4) : 5
|
| * The appropriate case among the following must be true:
|
| */
|
| /*
|
| - * cvc-elt (3.3.4) : 5.1
|
| - * If the declaration has a {value constraint},
|
| - * the item has neither element nor character [children] and
|
| + * cvc-elt (3.3.4) : 5.1
|
| + * If the declaration has a {value constraint},
|
| + * the item has neither element nor character [children] and
|
| * clause 3.2 has not applied, then all of the following must be true:
|
| */
|
| if ((inode->decl->value != NULL) &&
|
| - (inode->flags & XML_SCHEMA_ELEM_INFO_EMPTY) &&
|
| + (inode->flags & XML_SCHEMA_ELEM_INFO_EMPTY) &&
|
| (! INODE_NILLED(inode))) {
|
| /*
|
| - * cvc-elt (3.3.4) : 5.1.1
|
| - * If the ·actual type definition· is a ·local type definition·
|
| + * cvc-elt (3.3.4) : 5.1.1
|
| + * If the �actual type definition� is a �local type definition�
|
| * then the canonical lexical representation of the {value constraint}
|
| - * value must be a valid default for the ·actual type definition· as
|
| - * defined in Element Default Valid (Immediate) (§3.3.6).
|
| + * value must be a valid default for the �actual type definition� as
|
| + * defined in Element Default Valid (Immediate) (�3.3.6).
|
| */
|
| - /*
|
| + /*
|
| * NOTE: 'local' above means types acquired by xsi:type.
|
| * NOTE: Although the *canonical* value is stated, it is not
|
| * relevant if canonical or not. Additionally XML Schema 1.1
|
| @@ -26069,22 +26145,22 @@ character_content:
|
| * (see following).
|
| */
|
| goto default_psvi;
|
| - }
|
| - /*
|
| - * cvc-elt (3.3.4) : 5.1.2
|
| - * The element information item with the canonical lexical
|
| - * representation of the {value constraint} value used as its
|
| - * ·normalized value· must be ·valid· with respect to the
|
| - * ·actual type definition· as defined by Element Locally Valid (Type)
|
| - * (§3.3.4).
|
| - */
|
| + }
|
| + /*
|
| + * cvc-elt (3.3.4) : 5.1.2
|
| + * The element information item with the canonical lexical
|
| + * representation of the {value constraint} value used as its
|
| + * �normalized value� must be �valid� with respect to the
|
| + * �actual type definition� as defined by Element Locally Valid (Type)
|
| + * (�3.3.4).
|
| + */
|
| if (WXS_IS_SIMPLE(inode->typeDef)) {
|
| ret = xmlSchemaVCheckINodeDataType(vctxt,
|
| inode, inode->typeDef, inode->decl->value);
|
| } else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) {
|
| ret = xmlSchemaVCheckINodeDataType(vctxt,
|
| inode, inode->typeDef->contentTypeDef,
|
| - inode->decl->value);
|
| + inode->decl->value);
|
| }
|
| if (ret != 0) {
|
| if (ret < 0) {
|
| @@ -26105,7 +26181,7 @@ default_psvi:
|
| xmlChar *normValue;
|
| /*
|
| * VAL TODO: Normalize the value.
|
| - */
|
| + */
|
| normValue = xmlSchemaNormalizeValue(inode->typeDef,
|
| inode->decl->value);
|
| if (normValue != NULL) {
|
| @@ -26118,42 +26194,42 @@ default_psvi:
|
| "calling xmlNewText()");
|
| goto internal_error;
|
| } else
|
| - xmlAddChild(inode->node, textChild);
|
| + xmlAddChild(inode->node, textChild);
|
| }
|
| -
|
| - } else if (! INODE_NILLED(inode)) {
|
| +
|
| + } else if (! INODE_NILLED(inode)) {
|
| /*
|
| - * 5.2.1 The element information item must be ·valid· with respect
|
| - * to the ·actual type definition· as defined by Element Locally
|
| - * Valid (Type) (§3.3.4).
|
| - */
|
| + * 5.2.1 The element information item must be �valid� with respect
|
| + * to the �actual type definition� as defined by Element Locally
|
| + * Valid (Type) (�3.3.4).
|
| + */
|
| if (WXS_IS_SIMPLE(inode->typeDef)) {
|
| /*
|
| * SPEC (cvc-type) (3.1)
|
| * "If the type definition is a simple type definition, ..."
|
| * (3.1.3) "If clause 3.2 of Element Locally Valid
|
| - * (Element) (§3.3.4) did not apply, then the ·normalized value·
|
| - * must be ·valid· with respect to the type definition as defined
|
| - * by String Valid (§3.14.4).
|
| - */
|
| + * (Element) (�3.3.4) did not apply, then the �normalized value�
|
| + * must be �valid� with respect to the type definition as defined
|
| + * by String Valid (�3.14.4).
|
| + */
|
| ret = xmlSchemaVCheckINodeDataType(vctxt,
|
| inode, inode->typeDef, inode->value);
|
| } else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) {
|
| /*
|
| * SPEC (cvc-type) (3.2) "If the type definition is a complex type
|
| * definition, then the element information item must be
|
| - * ·valid· with respect to the type definition as per
|
| - * Element Locally Valid (Complex Type) (§3.4.4);"
|
| + * �valid� with respect to the type definition as per
|
| + * Element Locally Valid (Complex Type) (�3.4.4);"
|
| *
|
| * SPEC (cvc-complex-type) (2.2)
|
| - * "If the {content type} is a simple type definition, ...
|
| - * the ·normalized value· of the element information item is
|
| - * ·valid· with respect to that simple type definition as
|
| - * defined by String Valid (§3.14.4)."
|
| + * "If the {content type} is a simple type definition, ...
|
| + * the �normalized value� of the element information item is
|
| + * �valid� with respect to that simple type definition as
|
| + * defined by String Valid (�3.14.4)."
|
| */
|
| ret = xmlSchemaVCheckINodeDataType(vctxt,
|
| inode, inode->typeDef->contentTypeDef, inode->value);
|
| - }
|
| + }
|
| if (ret != 0) {
|
| if (ret < 0) {
|
| VERROR_INT("xmlSchemaValidatorPopElem",
|
| @@ -26163,7 +26239,7 @@ default_psvi:
|
| goto end_elem;
|
| }
|
| /*
|
| - * 5.2.2 If there is a fixed {value constraint} and clause 3.2 has
|
| + * 5.2.2 If there is a fixed {value constraint} and clause 3.2 has
|
| * not applied, all of the following must be true:
|
| */
|
| if ((inode->decl->value != NULL) &&
|
| @@ -26174,7 +26250,7 @@ default_psvi:
|
| * done on computed values.
|
| */
|
| /*
|
| - * 5.2.2.1 The element information item must have no element
|
| + * 5.2.2.1 The element information item must have no element
|
| * information item [children].
|
| */
|
| if (inode->flags &
|
| @@ -26186,28 +26262,28 @@ default_psvi:
|
| goto end_elem;
|
| } else {
|
| /*
|
| - * 5.2.2.2 The appropriate case among the following must
|
| + * 5.2.2.2 The appropriate case among the following must
|
| * be true:
|
| - */
|
| + */
|
| if (WXS_HAS_MIXED_CONTENT(inode->typeDef)) {
|
| /*
|
| - * 5.2.2.2.1 If the {content type} of the ·actual type
|
| - * definition· is mixed, then the *initial value* of the
|
| - * item must match the canonical lexical representation
|
| + * 5.2.2.2.1 If the {content type} of the �actual type
|
| + * definition� is mixed, then the *initial value* of the
|
| + * item must match the canonical lexical representation
|
| * of the {value constraint} value.
|
| *
|
| - * ... the *initial value* of an element information
|
| - * item is the string composed of, in order, the
|
| - * [character code] of each character information item in
|
| + * ... the *initial value* of an element information
|
| + * item is the string composed of, in order, the
|
| + * [character code] of each character information item in
|
| * the [children] of that element information item.
|
| - */
|
| + */
|
| if (! xmlStrEqual(inode->value, inode->decl->value)){
|
| - /*
|
| + /*
|
| * VAL TODO: Report invalid & expected values as well.
|
| * VAL TODO: Implement the canonical stuff.
|
| */
|
| ret = XML_SCHEMAV_CVC_ELT_5_2_2_2_1;
|
| - xmlSchemaCustomErr(ACTXT_CAST vctxt,
|
| + xmlSchemaCustomErr(ACTXT_CAST vctxt,
|
| ret, NULL, NULL,
|
| "The initial value '%s' does not match the fixed "
|
| "value constraint '%s'",
|
| @@ -26216,9 +26292,9 @@ default_psvi:
|
| }
|
| } else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) {
|
| /*
|
| - * 5.2.2.2.2 If the {content type} of the ·actual type
|
| - * definition· is a simple type definition, then the
|
| - * *actual value* of the item must match the canonical
|
| + * 5.2.2.2.2 If the {content type} of the �actual type
|
| + * definition� is a simple type definition, then the
|
| + * *actual value* of the item must match the canonical
|
| * lexical representation of the {value constraint} value.
|
| */
|
| /*
|
| @@ -26233,16 +26309,16 @@ default_psvi:
|
| xmlSchemaCustomErr(ACTXT_CAST vctxt,
|
| ret, NULL, NULL,
|
| "The actual value '%s' does not match the fixed "
|
| - "value constraint '%s'",
|
| + "value constraint '%s'",
|
| inode->value,
|
| inode->decl->value);
|
| goto end_elem;
|
| - }
|
| + }
|
| }
|
| - }
|
| + }
|
| }
|
| }
|
| -
|
| +
|
| end_elem:
|
| if (vctxt->depth < 0) {
|
| /* TODO: raise error? */
|
| @@ -26252,15 +26328,15 @@ end_elem:
|
| vctxt->skipDepth = -1;
|
| /*
|
| * Evaluate the history of XPath state objects.
|
| - */
|
| + */
|
| if (inode->appliedXPath &&
|
| (xmlSchemaXPathProcessHistory(vctxt, vctxt->depth) == -1))
|
| goto internal_error;
|
| /*
|
| * MAYBE TODO:
|
| - * SPEC (6) "The element information item must be ·valid· with
|
| + * SPEC (6) "The element information item must be �valid� with
|
| * respect to each of the {identity-constraint definitions} as per
|
| - * Identity-constraint Satisfied (§3.11.4)."
|
| + * Identity-constraint Satisfied (�3.11.4)."
|
| */
|
| /*
|
| * PSVI TODO: If we expose IDC node-tables via PSVI then the tables
|
| @@ -26268,7 +26344,7 @@ end_elem:
|
| * We will currently build IDC node-tables and bubble them only if
|
| * keyrefs do exist.
|
| */
|
| -
|
| +
|
| /*
|
| * Add the current IDC target-nodes to the IDC node-tables.
|
| */
|
| @@ -26302,7 +26378,7 @@ end_elem:
|
| */
|
| if (xmlSchemaBubbleIDCNodeTables(vctxt) == -1)
|
| goto internal_error;
|
| - }
|
| + }
|
| }
|
| /*
|
| * Clear the current ielem.
|
| @@ -26335,11 +26411,11 @@ end_elem:
|
| aidc = aidc->next;
|
| } while (aidc != NULL);
|
| }
|
| - vctxt->depth--;
|
| + vctxt->depth--;
|
| vctxt->inode = vctxt->elemInfos[vctxt->depth];
|
| /*
|
| - * VAL TODO: 7 If the element information item is the ·validation root·, it must be
|
| - * ·valid· per Validation Root Valid (ID/IDREF) (§3.3.4).
|
| + * VAL TODO: 7 If the element information item is the �validation root�, it must be
|
| + * �valid� per Validation Root Valid (ID/IDREF) (�3.3.4).
|
| */
|
| return (ret);
|
|
|
| @@ -26420,11 +26496,11 @@ xmlSchemaValidateChildElem(xmlSchemaValidCtxtPtr vctxt)
|
| * Fallback to "anyType".
|
| *
|
| * SPEC (cvc-assess-elt)
|
| - * "If the item cannot be ·strictly assessed·, [...]
|
| + * "If the item cannot be �strictly assessed�, [...]
|
| * an element information item's schema validity may be laxly
|
| - * assessed if its ·context-determined declaration· is not
|
| - * skip by ·validating· with respect to the ·ur-type
|
| - * definition· as per Element Locally Valid (Type) (§3.3.4)."
|
| + * assessed if its �context-determined declaration� is not
|
| + * skip by �validating� with respect to the �ur-type
|
| + * definition� as per Element Locally Valid (Type) (�3.3.4)."
|
| */
|
| vctxt->inode->typeDef =
|
| xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYTYPE);
|
| @@ -26496,9 +26572,9 @@ xmlSchemaValidateChildElem(xmlSchemaValidCtxtPtr vctxt)
|
| * SPEC (2.4) "If the {content type} is element-only or mixed,
|
| * then the sequence of the element information item's
|
| * element information item [children], if any, taken in
|
| - * order, is ·valid· with respect to the {content type}'s
|
| + * order, is �valid� with respect to the {content type}'s
|
| * particle, as defined in Element Sequence Locally Valid
|
| - * (Particle) (§3.9.4)."
|
| + * (Particle) (�3.9.4)."
|
| */
|
| ret = xmlRegExecPushString2(regexCtxt,
|
| vctxt->inode->localName,
|
| @@ -26595,7 +26671,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt,
|
| if (consumed != NULL)
|
| *consumed = 0;
|
| if (INODE_NILLED(vctxt->inode)) {
|
| - /*
|
| + /*
|
| * SPEC cvc-elt (3.3.4 - 3.2.1)
|
| * "The element information item must have no character or
|
| * element information item [children]."
|
| @@ -26611,7 +26687,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt,
|
| * information item [children]."
|
| */
|
| if (vctxt->inode->typeDef->contentType ==
|
| - XML_SCHEMA_CONTENT_EMPTY) {
|
| + XML_SCHEMA_CONTENT_EMPTY) {
|
| VERROR(XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1, NULL,
|
| "Character content is not allowed, "
|
| "because the content type is empty");
|
| @@ -26622,12 +26698,12 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt,
|
| XML_SCHEMA_CONTENT_ELEMENTS) {
|
| if ((nodeType != XML_TEXT_NODE) ||
|
| (! xmlSchemaIsBlank((xmlChar *) value, len))) {
|
| - /*
|
| - * SPEC cvc-complex-type (2.3)
|
| - * "If the {content type} is element-only, then the
|
| - * element information item has no character information
|
| - * item [children] other than those whose [character
|
| - * code] is defined as a white space in [XML 1.0 (Second
|
| + /*
|
| + * SPEC cvc-complex-type (2.3)
|
| + * "If the {content type} is element-only, then the
|
| + * element information item has no character information
|
| + * item [children] other than those whose [character
|
| + * code] is defined as a white space in [XML 1.0 (Second
|
| * Edition)]."
|
| */
|
| VERROR(XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3, NULL,
|
| @@ -26637,7 +26713,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt,
|
| }
|
| return (0);
|
| }
|
| -
|
| +
|
| if ((value == NULL) || (value[0] == 0))
|
| return (0);
|
| /*
|
| @@ -26649,7 +26725,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt,
|
| ((vctxt->inode->decl == NULL) ||
|
| (vctxt->inode->decl->value == NULL)))
|
| return (0);
|
| -
|
| +
|
| if (vctxt->inode->value == NULL) {
|
| /*
|
| * Set the value.
|
| @@ -26692,7 +26768,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt,
|
| len = xmlStrlen(value);
|
| /*
|
| * Concat the value.
|
| - */
|
| + */
|
| if (vctxt->inode->flags & XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES) {
|
| vctxt->inode->value = BAD_CAST xmlStrncat(
|
| (xmlChar *) vctxt->inode->value, value, len);
|
| @@ -26701,7 +26777,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt,
|
| BAD_CAST xmlStrncatNew(vctxt->inode->value, value, len);
|
| vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES;
|
| }
|
| - }
|
| + }
|
|
|
| return (0);
|
| }
|
| @@ -26718,7 +26794,7 @@ xmlSchemaValidateElem(xmlSchemaValidCtxtPtr vctxt)
|
| goto internal_error;
|
| }
|
| if (vctxt->xsiAssemble) {
|
| - /*
|
| + /*
|
| * We will stop validation if there was an error during
|
| * dynamic schema construction.
|
| * Note that we simply set @skipDepth to 0, this could
|
| @@ -26831,12 +26907,12 @@ type_validation:
|
| VERROR(ret, NULL,
|
| "The type definition is absent");
|
| goto exit;
|
| - }
|
| + }
|
| if (vctxt->inode->typeDef->flags & XML_SCHEMAS_TYPE_ABSTRACT) {
|
| vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_ERR_BAD_TYPE;
|
| ret = XML_SCHEMAV_CVC_TYPE_2;
|
| VERROR(ret, NULL,
|
| - "The type definition is abstract");
|
| + "The type definition is abstract");
|
| goto exit;
|
| }
|
| /*
|
| @@ -26917,7 +26993,7 @@ root_found:
|
| nodeType = xmlTextReaderNodeType(vctxt->reader);
|
|
|
| if (nodeType == XML_ELEMENT_NODE) {
|
| -
|
| +
|
| vctxt->depth++;
|
| if (xmlSchemaValidatorPushElem(vctxt) == -1) {
|
| VERROR_INT("xmlSchemaVReaderWalk",
|
| @@ -27092,8 +27168,8 @@ internal_error:
|
| * Process text content.
|
| */
|
| static void
|
| -xmlSchemaSAXHandleText(void *ctx,
|
| - const xmlChar * ch,
|
| +xmlSchemaSAXHandleText(void *ctx,
|
| + const xmlChar * ch,
|
| int len)
|
| {
|
| xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
|
| @@ -27117,10 +27193,10 @@ xmlSchemaSAXHandleText(void *ctx,
|
| * Process CDATA content.
|
| */
|
| static void
|
| -xmlSchemaSAXHandleCDataSection(void *ctx,
|
| - const xmlChar * ch,
|
| +xmlSchemaSAXHandleCDataSection(void *ctx,
|
| + const xmlChar * ch,
|
| int len)
|
| -{
|
| +{
|
| xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
|
|
|
| if (vctxt->depth < 0)
|
| @@ -27154,20 +27230,20 @@ xmlSchemaSAXHandleReference(void *ctx ATTRIBUTE_UNUSED,
|
|
|
| static void
|
| xmlSchemaSAXHandleStartElementNs(void *ctx,
|
| - const xmlChar * localname,
|
| - const xmlChar * prefix ATTRIBUTE_UNUSED,
|
| - const xmlChar * URI,
|
| - int nb_namespaces,
|
| - const xmlChar ** namespaces,
|
| - int nb_attributes,
|
| - int nb_defaulted ATTRIBUTE_UNUSED,
|
| + const xmlChar * localname,
|
| + const xmlChar * prefix ATTRIBUTE_UNUSED,
|
| + const xmlChar * URI,
|
| + int nb_namespaces,
|
| + const xmlChar ** namespaces,
|
| + int nb_attributes,
|
| + int nb_defaulted ATTRIBUTE_UNUSED,
|
| const xmlChar ** attributes)
|
| -{
|
| +{
|
| xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
|
| int ret;
|
| xmlSchemaNodeInfoPtr ielem;
|
| int i, j;
|
| -
|
| +
|
| /*
|
| * SAX VAL TODO: What to do with nb_defaulted?
|
| */
|
| @@ -27195,16 +27271,16 @@ xmlSchemaSAXHandleStartElementNs(void *ctx,
|
| ielem->flags |= XML_SCHEMA_ELEM_INFO_EMPTY;
|
| /*
|
| * Register namespaces on the elem info.
|
| - */
|
| + */
|
| if (nb_namespaces != 0) {
|
| /*
|
| * Although the parser builds its own namespace list,
|
| * we have no access to it, so we'll use an own one.
|
| */
|
| - for (i = 0, j = 0; i < nb_namespaces; i++, j += 2) {
|
| + for (i = 0, j = 0; i < nb_namespaces; i++, j += 2) {
|
| /*
|
| * Store prefix and namespace name.
|
| - */
|
| + */
|
| if (ielem->nsBindings == NULL) {
|
| ielem->nsBindings =
|
| (const xmlChar **) xmlMalloc(10 *
|
| @@ -27240,7 +27316,7 @@ xmlSchemaSAXHandleStartElementNs(void *ctx,
|
| } else
|
| ielem->nsBindings[ielem->nbNsBindings * 2 + 1] =
|
| namespaces[j+1];
|
| - ielem->nbNsBindings++;
|
| + ielem->nbNsBindings++;
|
| }
|
| }
|
| /*
|
| @@ -27254,7 +27330,7 @@ xmlSchemaSAXHandleStartElementNs(void *ctx,
|
| for (j = 0, i = 0; i < nb_attributes; i++, j += 5) {
|
| /*
|
| * Duplicate the value.
|
| - */
|
| + */
|
| value = xmlStrndup(attributes[j+3],
|
| attributes[j+4] - attributes[j+3]);
|
| /*
|
| @@ -27281,7 +27357,7 @@ xmlSchemaSAXHandleStartElementNs(void *ctx,
|
| goto internal_error;
|
| }
|
| goto exit;
|
| - }
|
| + }
|
|
|
| exit:
|
| return;
|
| @@ -27391,7 +27467,7 @@ xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt)
|
| #ifdef LIBXML_READER_ENABLED
|
| vctxt->reader = NULL;
|
| #endif
|
| - vctxt->hasKeyrefs = 0;
|
| + vctxt->hasKeyrefs = 0;
|
|
|
| if (vctxt->value != NULL) {
|
| xmlSchemaFreeValue(vctxt->value);
|
| @@ -27461,7 +27537,7 @@ xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt)
|
| break;
|
| xmlSchemaClearElemInfo(vctxt, ei);
|
| }
|
| - }
|
| + }
|
| xmlSchemaItemListClear(vctxt->nodeQNames);
|
| /* Recreate the dict. */
|
| xmlDictFree(vctxt->dict);
|
| @@ -27563,7 +27639,7 @@ xmlSchemaFreeValidCtxt(xmlSchemaValidCtxtPtr ctxt)
|
| * @ctxt: the schema validation context
|
| *
|
| * Check if any error was detected during validation.
|
| - *
|
| + *
|
| * Returns 1 if valid so far, 0 if errors were detected, and -1 in case
|
| * of internal error.
|
| */
|
| @@ -27622,7 +27698,7 @@ xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt,
|
|
|
| /**
|
| * xmlSchemaGetValidErrors:
|
| - * @ctxt: a XML-Schema validation context
|
| + * @ctxt: a XML-Schema validation context
|
| * @err: the error function result
|
| * @warn: the warning function result
|
| * @ctx: the functions context result
|
| @@ -27683,7 +27759,7 @@ xmlSchemaSetValidOptions(xmlSchemaValidCtxtPtr ctxt,
|
|
|
| /**
|
| * xmlSchemaValidCtxtGetOptions:
|
| - * @ctxt: a schema validation context
|
| + * @ctxt: a schema validation context
|
| *
|
| * Get the validation context options.
|
| *
|
| @@ -27751,7 +27827,7 @@ xmlSchemaVDocWalk(xmlSchemaValidCtxtPtr vctxt)
|
| nsName = NULL;
|
| ret = xmlSchemaValidatorPushAttribute(vctxt,
|
| (xmlNodePtr) attr,
|
| - /*
|
| + /*
|
| * Note that we give it the line number of the
|
| * parent element.
|
| */
|
| @@ -27807,7 +27883,7 @@ xmlSchemaVDocWalk(xmlSchemaValidCtxtPtr vctxt)
|
| (node->type == XML_ENTITY_REF_NODE)) {
|
| /*
|
| * DOC VAL TODO: What to do with entities?
|
| - */
|
| + */
|
| VERROR_INT("xmlSchemaVDocWalk",
|
| "there is at least one entity reference in the node-tree "
|
| "currently being validated. Processing of entities with "
|
| @@ -27867,7 +27943,7 @@ static int
|
| xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) {
|
| /*
|
| * Some initialization.
|
| - */
|
| + */
|
| vctxt->err = 0;
|
| vctxt->nberrors = 0;
|
| vctxt->depth = -1;
|
| @@ -27884,9 +27960,9 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) {
|
| */
|
| if (vctxt->schema == NULL) {
|
| xmlSchemaParserCtxtPtr pctxt;
|
| -
|
| +
|
| vctxt->xsiAssemble = 1;
|
| - /*
|
| + /*
|
| * If not schema was given then we will create a schema
|
| * dynamically using XSI schema locations.
|
| *
|
| @@ -27902,8 +27978,8 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) {
|
| */
|
| vctxt->schema = xmlSchemaNewSchema(pctxt);
|
| if (vctxt->schema == NULL)
|
| - return (-1);
|
| - /*
|
| + return (-1);
|
| + /*
|
| * Create the schema construction context.
|
| */
|
| pctxt->constructor = xmlSchemaConstructionCtxtCreate(pctxt->dict);
|
| @@ -27914,13 +27990,13 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) {
|
| * Take ownership of the constructor to be able to free it.
|
| */
|
| pctxt->ownsConstructor = 1;
|
| - }
|
| - /*
|
| - * Augment the IDC definitions for the main schema and all imported ones
|
| + }
|
| + /*
|
| + * Augment the IDC definitions for the main schema and all imported ones
|
| * NOTE: main schema if the first in the imported list
|
| */
|
| xmlHashScan(vctxt->schema->schemasImports,(xmlHashScanner)xmlSchemaAugmentImportedIDC, vctxt);
|
| -
|
| +
|
| return(0);
|
| }
|
|
|
| @@ -28335,10 +28411,10 @@ referenceSplit(void *ctx, const xmlChar *name)
|
| }
|
|
|
| static void
|
| -startElementNsSplit(void *ctx, const xmlChar * localname,
|
| - const xmlChar * prefix, const xmlChar * URI,
|
| - int nb_namespaces, const xmlChar ** namespaces,
|
| - int nb_attributes, int nb_defaulted,
|
| +startElementNsSplit(void *ctx, const xmlChar * localname,
|
| + const xmlChar * prefix, const xmlChar * URI,
|
| + int nb_namespaces, const xmlChar ** namespaces,
|
| + int nb_attributes, int nb_defaulted,
|
| const xmlChar ** attributes) {
|
| xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
|
| if (ctxt == NULL)
|
| @@ -28357,7 +28433,7 @@ startElementNsSplit(void *ctx, const xmlChar * localname,
|
| }
|
|
|
| static void
|
| -endElementNsSplit(void *ctx, const xmlChar * localname,
|
| +endElementNsSplit(void *ctx, const xmlChar * localname,
|
| const xmlChar * prefix, const xmlChar * URI) {
|
| xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
|
| if (ctxt == NULL)
|
| @@ -28398,7 +28474,7 @@ xmlSchemaSAXPlug(xmlSchemaValidCtxtPtr ctxt,
|
| old_sax = *sax;
|
| if ((old_sax != NULL) && (old_sax->initialized != XML_SAX2_MAGIC))
|
| return(NULL);
|
| - if ((old_sax != NULL) &&
|
| + if ((old_sax != NULL) &&
|
| (old_sax->startElementNs == NULL) && (old_sax->endElementNs == NULL) &&
|
| ((old_sax->startElement != NULL) || (old_sax->endElement != NULL)))
|
| return(NULL);
|
| @@ -28416,7 +28492,7 @@ xmlSchemaSAXPlug(xmlSchemaValidCtxtPtr ctxt,
|
| ret->ctxt = ctxt;
|
| ret->user_sax_ptr = sax;
|
| ret->user_sax = old_sax;
|
| - if (old_sax == NULL) {
|
| + if (old_sax == NULL) {
|
| /*
|
| * go direct, no need for the split block and functions.
|
| */
|
| @@ -28437,7 +28513,7 @@ xmlSchemaSAXPlug(xmlSchemaValidCtxtPtr ctxt,
|
| } else {
|
| /*
|
| * for each callback unused by Schemas initialize it to the Split
|
| - * routine only if non NULL in the user block, this can speed up
|
| + * routine only if non NULL in the user block, this can speed up
|
| * things at the SAX level.
|
| */
|
| if (old_sax->internalSubset != NULL)
|
| @@ -28590,7 +28666,7 @@ xmlSchemaValidateStream(xmlSchemaValidCtxtPtr ctxt,
|
| if (options)
|
| xmlCtxtUseOptions(pctxt, options);
|
| #endif
|
| - pctxt->linenumbers = 1;
|
| + pctxt->linenumbers = 1;
|
|
|
| inputStream = xmlNewIOInputStream(pctxt, input, enc);;
|
| if (inputStream == NULL) {
|
| @@ -28619,7 +28695,7 @@ xmlSchemaValidateStream(xmlSchemaValidCtxtPtr ctxt,
|
| ret = ctxt->parserCtxt->errNo;
|
| if (ret == 0)
|
| ret = 1;
|
| - }
|
| + }
|
|
|
| done:
|
| ctxt->parserCtxt = NULL;
|
| @@ -28658,16 +28734,33 @@ xmlSchemaValidateFile(xmlSchemaValidCtxtPtr ctxt,
|
|
|
| if ((ctxt == NULL) || (filename == NULL))
|
| return (-1);
|
| -
|
| +
|
| input = xmlParserInputBufferCreateFilename(filename,
|
| XML_CHAR_ENCODING_NONE);
|
| if (input == NULL)
|
| return (-1);
|
| ret = xmlSchemaValidateStream(ctxt, input, XML_CHAR_ENCODING_NONE,
|
| - NULL, NULL);
|
| + NULL, NULL);
|
| return (ret);
|
| }
|
|
|
| +/**
|
| + * xmlSchemaValidCtxtGetParserCtxt:
|
| + * @ctxt: a schema validation context
|
| + *
|
| + * allow access to the parser context of the schema validation context
|
| + *
|
| + * Returns the parser context of the schema validation context or NULL
|
| + * in case of error.
|
| + */
|
| +xmlParserCtxtPtr
|
| +xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt)
|
| +{
|
| + if (ctxt == NULL)
|
| + return(NULL);
|
| + return (ctxt->parserCtxt);
|
| +}
|
| +
|
| #define bottom_xmlschemas
|
| #include "elfgcchack.h"
|
| #endif /* LIBXML_SCHEMAS_ENABLED */
|
|
|