Lines Matching defs:ctxt
1051 static int xmlSchemaParseInclude(xmlSchemaParserCtxtPtr ctxt,
1054 static int xmlSchemaParseRedefine(xmlSchemaParserCtxtPtr ctxt,
1059 xmlSchemaAbstractCtxtPtr ctxt);
1063 xmlSchemaParseImport(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
1067 xmlSchemaParserCtxtPtr ctxt);
1073 xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
1085 xmlSchemaCheckCOSSTDerivedOK(xmlSchemaAbstractCtxtPtr ctxt,
1091 xmlSchemaParserCtxtPtr ctxt);
1867 xmlSchemaPErrMemory(xmlSchemaParserCtxtPtr ctxt,
1870 if (ctxt != NULL)
1871 ctxt->nberrors++;
1878 * @ctxt: the parsing context
1888 xmlSchemaPErr(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error,
1895 if (ctxt != NULL) {
1896 ctxt->nberrors++;
1897 ctxt->err = error;
1898 channel = ctxt->error;
1899 data = ctxt->errCtxt;
1900 schannel = ctxt->serror;
1902 __xmlRaiseError(schannel, channel, data, ctxt, node, XML_FROM_SCHEMASP,
1910 * @ctxt: the parsing context
1921 xmlSchemaPErr2(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
1926 xmlSchemaPErr(ctxt, child, error, msg, str1, str2);
1928 xmlSchemaPErr(ctxt, node, error, msg, str1, str2);
1934 * @ctxt: the parsing context
1950 xmlSchemaPErrExt(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error,
1961 if (ctxt != NULL) {
1962 ctxt->nberrors++;
1963 ctxt->err = error;
1964 channel = ctxt->error;
1965 data = ctxt->errCtxt;
1966 schannel = ctxt->serror;
1968 __xmlRaiseError(schannel, channel, data, ctxt, node, XML_FROM_SCHEMASP,
1989 xmlSchemaVErrMemory(xmlSchemaValidCtxtPtr ctxt,
1992 if (ctxt != NULL) {
1993 ctxt->nberrors++;
1994 ctxt->err = XML_SCHEMAV_INTERNAL;
2012 * @ctxt: the validation context
2023 xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt,
2033 if (ctxt != NULL) {
2034 if (ctxt->type == XML_SCHEMA_CTXT_VALIDATOR) {
2035 xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctxt;
2081 __xmlRaiseError(schannel, channel, data, ctxt,
2087 } else if (ctxt->type == XML_SCHEMA_CTXT_PARSER) {
2088 xmlSchemaParserCtxtPtr pctxt = (xmlSchemaParserCtxtPtr) ctxt;
2098 __xmlRaiseError(schannel, channel, data, ctxt,
2111 * @ctxt: the validation context
2736 #define PERROR_INT2(func, msg) xmlSchemaInternalErr(ACTXT_CAST ctxt, func, msg);
2743 * @ctxt: the schema validation context
2754 xmlSchemaPMissingAttrErr(xmlSchemaParserCtxtPtr ctxt,
2766 xmlSchemaPErr(ctxt, ownerElem, error, "%s: %s.\n", BAD_CAST des, BAD_CAST message);
2768 ctxt, ownerElem, error,
2777 * @ctxt: the schema validation context
2791 xmlSchemaPResCompAttrErr(xmlSchemaParserCtxtPtr ctxt,
2806 xmlSchemaPErrExt(ctxt, ownerElem, error,
2818 * @ctxt: the schema parser context
2827 xmlSchemaPCustomAttrErr(xmlSchemaParserCtxtPtr ctxt,
2844 xmlSchemaPErrExt(ctxt, NULL, error, NULL, NULL, NULL,
2849 xmlSchemaPErrExt(ctxt, (xmlNodePtr) attr, error, NULL, NULL, NULL,
2859 * @ctxt: the schema parser context
2868 xmlSchemaPIllegalAttrErr(xmlSchemaParserCtxtPtr ctxt,
2875 xmlSchemaFormatNodeForError(&strA, ACTXT_CAST ctxt, attr->parent);
2876 xmlSchemaErr4(ACTXT_CAST ctxt, error, (xmlNodePtr) attr,
2886 * @ctxt: the schema parser context
2899 xmlSchemaPCustomErrExt(xmlSchemaParserCtxtPtr ctxt,
2916 xmlSchemaPErrExt(ctxt, itemElem, error, NULL, NULL, NULL,
2924 * @ctxt: the schema parser context
2935 xmlSchemaPCustomErr(xmlSchemaParserCtxtPtr ctxt,
2942 xmlSchemaPCustomErrExt(ctxt, error, item, itemElem, message,
2948 * @ctxt: the schema parser context
2960 xmlSchemaPAttrUseErr4(xmlSchemaParserCtxtPtr ctxt,
2980 xmlSchemaErr4(ACTXT_CAST ctxt, error, node,
2987 * @ctxt: the schema parser context
2996 xmlSchemaPIllegalFacetAtomicErr(xmlSchemaParserCtxtPtr ctxt,
3005 xmlSchemaPErrExt(ctxt, type->node, error, NULL, NULL, NULL,
3017 * @ctxt: the schema parser context
3026 xmlSchemaPIllegalFacetListUnionErr(xmlSchemaParserCtxtPtr ctxt,
3035 xmlSchemaPErr(ctxt, type->node, error,
3043 * @ctxt: the schema validation context
3052 xmlSchemaPMutualExclAttrErr(xmlSchemaParserCtxtPtr ctxt,
3062 xmlSchemaPErrExt(ctxt, (xmlNodePtr) attr, error, NULL, NULL, NULL,
3070 * @ctxt: the schema validation context
3082 xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt,
3095 xmlSchemaFormatNodeForError(&msg, ACTXT_CAST ctxt, node);
3145 xmlSchemaPErr(ctxt, node, error, (const char *) msg, value, NULL);
3147 xmlSchemaPErr(ctxt, node, error, (const char *) msg, NULL, NULL);
3151 xmlSchemaPErrExt(ctxt, node, error, NULL, NULL, NULL,
3160 * @ctxt: the schema parser context
3172 xmlSchemaPContentErr(xmlSchemaParserCtxtPtr ctxt,
3184 xmlSchemaPErr2(ctxt, ownerElem, child, error,
3189 xmlSchemaPErr2(ctxt, ownerElem, child, error,
3193 xmlSchemaPErr2(ctxt, ownerElem, child, error,
3225 * @ctxt: a schema validation context
3232 xmlSchemaNewSchema(xmlSchemaParserCtxtPtr ctxt)
3238 xmlSchemaPErrMemory(ctxt, "allocating schema", NULL);
3242 ret->dict = ctxt->dict;
3271 * @ctxt: a schema validation context
3279 xmlSchemaNewAnnot(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node)
3285 xmlSchemaPErrMemory(ctxt, "allocating annotation", node);
4650 xmlSchemaGetNodeContent(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node)
4658 ret = xmlDictLookup(ctxt->dict, val, -1);
4671 * @ctxt: the parser context
4680 xmlSchemaGetProp(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
4689 ret = xmlDictLookup(ctxt->dict, val, -1);
5096 * @ctxt: a schema parser context
5106 xmlSchemaAddNotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
5112 if ((ctxt == NULL) || (schema == NULL) || (name == NULL))
5117 xmlSchemaPErrMemory(ctxt, "add annotation", NULL);
5126 WXS_ADD_GLOBAL(ctxt, ret);
5132 * @ctxt: a schema parser context
5143 xmlSchemaAddAttribute(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
5149 if ((ctxt == NULL) || (schema == NULL))
5154 xmlSchemaPErrMemory(ctxt, "allocating attribute", NULL);
5164 WXS_ADD_GLOBAL(ctxt, ret);
5166 WXS_ADD_LOCAL(ctxt, ret);
5167 WXS_ADD_PENDING(ctxt, ret);
5173 * @ctxt: a schema parser context
5243 * @ctxt: a schema parser context
5295 * @ctxt: a schema parser context
5306 xmlSchemaAddElement(xmlSchemaParserCtxtPtr ctxt,
5312 if ((ctxt == NULL) || (name == NULL))
5317 xmlSchemaPErrMemory(ctxt, "allocating element", NULL);
5327 WXS_ADD_GLOBAL(ctxt, ret);
5329 WXS_ADD_LOCAL(ctxt, ret);
5330 WXS_ADD_PENDING(ctxt, ret);
5336 * @ctxt: a schema parser context
5347 xmlSchemaAddType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
5354 if ((ctxt == NULL) || (schema == NULL))
5359 xmlSchemaPErrMemory(ctxt, "allocating type", NULL);
5368 if (ctxt->isRedefine) {
5369 ctxt->redef = xmlSchemaAddRedef(ctxt, ctxt->redefined,
5371 if (ctxt->redef == NULL) {
5375 ctxt->redefCounter = 0;
5377 WXS_ADD_GLOBAL(ctxt, ret);
5379 WXS_ADD_LOCAL(ctxt, ret);
5380 WXS_ADD_PENDING(ctxt, ret);
5433 * @ctxt: a schema parser context
5444 xmlSchemaAddModelGroup(xmlSchemaParserCtxtPtr ctxt,
5451 if ((ctxt == NULL) || (schema == NULL))
5457 xmlSchemaPErrMemory(ctxt, "allocating model group component",
5464 WXS_ADD_LOCAL(ctxt, ret);
5467 WXS_ADD_PENDING(ctxt, ret);
5474 * @ctxt: a schema parser context
5486 xmlSchemaAddParticle(xmlSchemaParserCtxtPtr ctxt,
5490 if (ctxt == NULL)
5499 xmlSchemaPErrMemory(ctxt, "allocating particle component",
5511 WXS_ADD_LOCAL(ctxt, ret);
5516 * REMOVED: WXS_ADD_PENDING(ctxt, ret);
5523 * @ctxt: a schema validation context
5532 xmlSchemaAddModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt,
5540 if ((ctxt == NULL) || (schema == NULL) || (name == NULL))
5546 xmlSchemaPErrMemory(ctxt, "adding group", NULL);
5555 if (ctxt->isRedefine) {
5556 ctxt->redef = xmlSchemaAddRedef(ctxt, ctxt->redefined,
5558 if (ctxt->redef == NULL) {
5562 ctxt->redefCounter = 0;
5564 WXS_ADD_GLOBAL(ctxt, ret);
5565 WXS_ADD_PENDING(ctxt, ret);
5571 * @ctxt: a schema validation context
5578 xmlSchemaNewWildcardNsConstraint(xmlSchemaParserCtxtPtr ctxt)
5585 xmlSchemaPErrMemory(ctxt, "creating wildcard namespace constraint", NULL);
5594 xmlSchemaAddIDC(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
5600 if ((ctxt == NULL) || (schema == NULL) || (name == NULL))
5605 xmlSchemaPErrMemory(ctxt,
5616 WXS_ADD_GLOBAL(ctxt, ret);
5621 WXS_ADD_PENDING(ctxt, ret);
5627 * @ctxt: a schema validation context
5636 xmlSchemaAddWildcard(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
5641 if ((ctxt == NULL) || (schema == NULL))
5646 xmlSchemaPErrMemory(ctxt, "adding wildcard", NULL);
5652 WXS_ADD_LOCAL(ctxt, ret);
5753 * @ctxt: a schema parser context
5769 xmlSchemaPValAttrNodeQNameValue(xmlSchemaParserCtxtPtr ctxt,
5785 xmlSchemaPSimpleTypeErr(ctxt,
5791 return (ctxt->err);
5798 *uri = xmlDictLookup(ctxt->dict, ns->href, -1);
5806 *uri = ctxt->targetNamespace;
5808 *local = xmlDictLookup(ctxt->dict, value, -1);
5815 *local = xmlDictLookup(ctxt->dict, *local, -1);
5816 pref = xmlDictLookup(ctxt->dict, value, len);
5819 xmlSchemaPSimpleTypeErr(ctxt,
5825 return (ctxt->err);
5827 *uri = xmlDictLookup(ctxt->dict, ns->href, -1);
5834 * @ctxt: a schema parser context
5850 xmlSchemaPValAttrNodeQName(xmlSchemaParserCtxtPtr ctxt,
5859 ctxt, (xmlNodePtr) attr);
5860 return (xmlSchemaPValAttrNodeQNameValue(ctxt, schema,
5866 * @ctxt: a schema parser context
5881 xmlSchemaPValAttrQName(xmlSchemaParserCtxtPtr ctxt,
5897 return (xmlSchemaPValAttrNodeQName(ctxt, schema,
5903 * @ctxt: a schema parser context
5916 xmlSchemaPValAttrNodeID(xmlSchemaParserCtxtPtr ctxt, xmlAttrPtr attr)
5945 xmlSchemaPSimpleTypeErr(ctxt,
5956 xmlSchemaPSimpleTypeErr(ctxt,
5971 xmlSchemaPValAttrID(xmlSchemaParserCtxtPtr ctxt,
5980 return(xmlSchemaPValAttrNodeID(ctxt, attr));
5986 * @ctxt: a schema validation context
5994 xmlGetMaxOccurs(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
6004 val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
6008 xmlSchemaPSimpleTypeErr(ctxt,
6022 xmlSchemaPSimpleTypeErr(ctxt,
6039 xmlSchemaPSimpleTypeErr(ctxt,
6051 * @ctxt: a schema validation context
6059 xmlGetMinOccurs(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
6069 val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
6074 xmlSchemaPSimpleTypeErr(ctxt,
6091 xmlSchemaPSimpleTypeErr(ctxt,
6103 * @ctxt: a schema validation context
6113 xmlSchemaPGetBoolNodeValue(xmlSchemaParserCtxtPtr ctxt,
6135 xmlSchemaPSimpleTypeErr(ctxt,
6149 * @ctxt: a schema validation context
6160 xmlGetBooleanProp(xmlSchemaParserCtxtPtr ctxt,
6166 val = xmlSchemaGetProp(ctxt, node, name);
6183 xmlSchemaPSimpleTypeErr(ctxt,
6199 ctxt, xmlSchemaPtr schema,
6203 ctxt,
6208 ctxt,
6218 static xmlSchemaTypePtr xmlSchemaParseList(xmlSchemaParserCtxtPtr ctxt,
6222 xmlSchemaParseAnyAttribute(xmlSchemaParserCtxtPtr ctxt,
6228 * @ctxt: a schema parser context
6301 * @ctxt: a schema parser context
6316 xmlSchemaPValAttrNode(xmlSchemaParserCtxtPtr ctxt,
6324 if ((ctxt == NULL) || (type == NULL) || (attr == NULL))
6327 val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
6331 return (xmlSchemaPValAttrNodeValue(ctxt, ownerItem, attr,
6338 * @ctxt: a schema parser context
6355 xmlSchemaPValAttr(xmlSchemaParserCtxtPtr ctxt,
6364 if ((ctxt == NULL) || (type == NULL)) {
6372 xmlSchemaPErr(ctxt, ownerElem,
6385 return (xmlSchemaPValAttrNode(ctxt, ownerItem, attr,
6439 * @ctxt: a schema validation context
6448 xmlSchemaParseLocalAttributes(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
6457 item = xmlSchemaParseLocalAttribute(ctxt, schema, *child,
6460 item = xmlSchemaParseAttributeGroupRef(ctxt, schema, *child);
6481 * @ctxt: a schema validation context
6492 xmlSchemaParseAnnotation(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int needed)
6507 if ((ctxt == NULL) || (node == NULL))
6510 ret = xmlSchemaNewAnnot(ctxt, node);
6520 xmlSchemaPIllegalAttrErr(ctxt,
6525 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
6545 xmlSchemaPIllegalAttrErr(ctxt,
6550 xmlSchemaPValAttr(ctxt, NULL, child, "source",
6564 xmlSchemaPIllegalAttrErr(ctxt,
6572 xmlSchemaPIllegalAttrErr(ctxt,
6583 xmlSchemaPValAttrNode(ctxt, NULL, attr,
6588 xmlSchemaPContentErr(ctxt,
6601 * @ctxt: a schema validation context
6611 xmlSchemaParseFacet(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
6618 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
6623 xmlSchemaPErrMemory(ctxt, "allocating facet", node);
6627 value = xmlSchemaGetProp(ctxt, node, "value");
6629 xmlSchemaPErr2(ctxt, node, child, XML_SCHEMAP_FACET_NO_VALUE,
6659 xmlSchemaPErr2(ctxt, node, child, XML_SCHEMAP_UNKNOWN_FACET_TYPE,
6664 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
6670 fixed = xmlSchemaGetProp(ctxt, node, "fixed");
6679 facet->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
6683 xmlSchemaPErr2(ctxt, node, child, XML_SCHEMAP_UNKNOWN_FACET_CHILD,
6692 * @ctxt: a schema parser context
6704 xmlSchemaParseWildcardNs(xmlSchemaParserCtxtPtr ctxt,
6715 pc = xmlSchemaGetProp(ctxt, node, "processContents");
6724 xmlSchemaPSimpleTypeErr(ctxt,
6736 ns = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
6740 wildc->negNsSet = xmlSchemaNewWildcardNsConstraint(ctxt);
6744 wildc->negNsSet->value = ctxt->targetNamespace;
6760 xmlSchemaPSimpleTypeErr(ctxt,
6770 dictnsItem = ctxt->targetNamespace;
6777 xmlSchemaPValAttrNodeValue(ctxt, NULL, attr,
6779 dictnsItem = xmlDictLookup(ctxt->dict, nsItem, -1);
6791 tmp = xmlSchemaNewWildcardNsConstraint(ctxt);
6814 xmlSchemaPCheckParticleCorrect_2(xmlSchemaParserCtxtPtr ctxt,
6836 xmlSchemaPCustomAttrErr(ctxt,
6846 xmlSchemaPCustomAttrErr(ctxt,
6859 * @ctxt: a schema validation context
6871 xmlSchemaParseAny(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
6881 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
6894 xmlSchemaPIllegalAttrErr(ctxt,
6898 xmlSchemaPIllegalAttrErr(ctxt,
6903 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
6907 max = xmlGetMaxOccurs(ctxt, node, 0, UNBOUNDED, 1,
6909 min = xmlGetMinOccurs(ctxt, node, 0, -1, 1,
6911 xmlSchemaPCheckParticleCorrect_2(ctxt, NULL, node, min, max);
6915 wild = xmlSchemaAddWildcard(ctxt, schema, XML_SCHEMA_TYPE_ANY, node);
6918 xmlSchemaParseWildcardNs(ctxt, schema, wild, node);
6924 annot = xmlSchemaParseAnnotation(ctxt, child, 1);
6928 xmlSchemaPContentErr(ctxt,
6943 particle = xmlSchemaAddParticle(ctxt, node, min, max);
6954 * @ctxt: a schema validation context
6963 xmlSchemaParseNotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
6970 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
6972 name = xmlSchemaGetProp(ctxt, node, "name");
6974 xmlSchemaPErr2(ctxt, node, child, XML_SCHEMAP_NOTATION_NO_NAME,
6978 ret = xmlSchemaAddNotation(ctxt, schema, name,
6979 ctxt->targetNamespace, node);
6982 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
6986 ret->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
6990 xmlSchemaPContentErr(ctxt,
7001 * @ctxt: a schema validation context
7011 xmlSchemaParseAnyAttribute(xmlSchemaParserCtxtPtr ctxt,
7018 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
7021 ret = xmlSchemaAddWildcard(ctxt, schema, XML_SCHEMA_TYPE_ANY_ATTRIBUTE,
7035 xmlSchemaPIllegalAttrErr(ctxt,
7039 xmlSchemaPIllegalAttrErr(ctxt,
7044 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
7048 if (xmlSchemaParseWildcardNs(ctxt, schema, ret, node) != 0)
7055 ret->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
7059 xmlSchemaPContentErr(ctxt,
7071 * @ctxt: a schema validation context
7614 * @ctxt: a schema validation context
7971 xmlSchemaCheckCSelectorXPath(xmlSchemaParserCtxtPtr ctxt,
7987 xmlSchemaPErr(ctxt, idc->node,
7998 xmlSchemaPCustomErr(ctxt,
8031 xmlSchemaPErrMemory(ctxt, "allocating a namespace array",
8056 xmlSchemaPCustomErr(ctxt,
8178 * @ctxt: a schema validation context
8188 xmlSchemaParseIDCSelectorAndField(xmlSchemaParserCtxtPtr ctxt,
8205 xmlSchemaPIllegalAttrErr(ctxt,
8209 xmlSchemaPIllegalAttrErr(ctxt,
8219 xmlSchemaPErrMemory(ctxt,
8230 xmlSchemaPMissingAttrErr(ctxt,
8235 item->xpath = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
8240 if (xmlSchemaCheckCSelectorXPath(ctxt, idc, item, attr,
8242 xmlSchemaPErr(ctxt,
8251 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
8261 xmlSchemaParseAnnotation(ctxt, child, 1));
8265 xmlSchemaPContentErr(ctxt,
8276 * @ctxt: a schema validation context
8285 xmlSchemaParseIDC(xmlSchemaParserCtxtPtr ctxt,
8307 xmlSchemaPIllegalAttrErr(ctxt,
8311 xmlSchemaPIllegalAttrErr(ctxt,
8321 xmlSchemaPMissingAttrErr(ctxt,
8326 } else if (xmlSchemaPValAttrNode(ctxt,
8332 item = xmlSchemaAddIDC(ctxt, schema, name, targetNamespace,
8337 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
8344 xmlSchemaPMissingAttrErr(ctxt,
8352 item->ref = xmlSchemaNewQNameRef(ctxt, XML_SCHEMA_TYPE_IDC_KEY,
8356 xmlSchemaPValAttrNodeQName(ctxt, schema,
8360 xmlSchemaCheckReference(ctxt, schema, node, attr,
8369 item->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
8373 xmlSchemaPContentErr(ctxt,
8383 item->selector = xmlSchemaParseIDCSelectorAndField(ctxt,
8391 field = xmlSchemaParseIDCSelectorAndField(ctxt,
8405 xmlSchemaPContentErr(ctxt,
8412 xmlSchemaPContentErr(ctxt,
8423 * @ctxt: a schema validation context
8435 xmlSchemaParseElement(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
8449 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
8463 xmlSchemaPMissingAttrErr(ctxt,
8471 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
8474 annot = xmlSchemaParseAnnotation(ctxt, child, 1);
8485 min = xmlGetMinOccurs(ctxt, node, 0, -1, 1, "xs:nonNegativeInteger");
8486 max = xmlGetMaxOccurs(ctxt, node, 0, UNBOUNDED, 1, "(xs:nonNegativeInteger | unbounded)");
8487 xmlSchemaPCheckParticleCorrect_2(ctxt, NULL, node, min, max);
8488 particle = xmlSchemaAddParticle(ctxt, node, min, max);
8503 xmlSchemaPValAttrNodeQName(ctxt, schema,
8505 xmlSchemaCheckReference(ctxt, schema, node, attr, refNs);
8510 xmlSchemaPMutualExclAttrErr(ctxt,
8529 xmlSchemaPCustomAttrErr(ctxt,
8537 xmlSchemaPIllegalAttrErr(ctxt,
8546 xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED,
8554 refer = xmlSchemaNewQNameRef(ctxt, XML_SCHEMA_TYPE_ELEMENT,
8564 WXS_ADD_PENDING(ctxt, particle);
8575 if (xmlSchemaPValAttrNode(ctxt, NULL, nameAttr,
8582 ns = ctxt->targetNamespace;
8586 attrValue = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
8588 ns = ctxt->targetNamespace;
8590 xmlSchemaPSimpleTypeErr(ctxt,
8597 ns = ctxt->targetNamespace;
8599 decl = xmlSchemaAddElement(ctxt, name, ns, node, topLevel);
8622 xmlSchemaPIllegalAttrErr(ctxt,
8629 xmlSchemaPIllegalAttrErr(ctxt,
8635 xmlSchemaPIllegalAttrErr(ctxt,
8649 xmlSchemaPValAttrQName(ctxt, schema,
8652 if (xmlGetBooleanProp(ctxt, node, "abstract", 0))
8664 attrValue = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
8669 xmlSchemaPSimpleTypeErr(ctxt,
8692 attrValue = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
8698 xmlSchemaPSimpleTypeErr(ctxt,
8706 if (xmlGetBooleanProp(ctxt, node, "nillable", 0))
8711 xmlSchemaPValAttrNodeQName(ctxt, schema,
8714 xmlSchemaCheckReference(ctxt, schema, node,
8717 decl->value = xmlSchemaGetProp(ctxt, node, "default");
8720 fixed = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
8726 xmlSchemaPMutualExclAttrErr(ctxt,
8744 xmlSchemaPContentErr(ctxt,
8750 WXS_ELEM_TYPEDEF(decl) = xmlSchemaParseComplexType(ctxt, schema, child, 0);
8759 xmlSchemaPContentErr(ctxt,
8765 WXS_ELEM_TYPEDEF(decl) = xmlSchemaParseSimpleType(ctxt, schema, child, 0);
8771 curIDC = xmlSchemaParseIDC(ctxt, schema, child,
8774 curIDC = xmlSchemaParseIDC(ctxt, schema, child,
8777 curIDC = xmlSchemaParseIDC(ctxt, schema, child,
8788 xmlSchemaPContentErr(ctxt,
8822 * @ctxt: a schema validation context
8833 xmlSchemaParseUnion(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
8841 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
8844 type = ctxt->ctxtType;
8862 xmlSchemaPIllegalAttrErr(ctxt,
8866 xmlSchemaPIllegalAttrErr(ctxt,
8871 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
8884 cur = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
8895 if (xmlSchemaPValAttrNodeQNameValue(ctxt, schema,
8903 xmlSchemaPErrMemory(ctxt, "xmlSchemaParseUnion, "
8917 ref = xmlSchemaNewQNameRef(ctxt, XML_SCHEMA_TYPE_SIMPLE,
8943 xmlSchemaParseAnnotation(ctxt, child, 1));
8955 xmlSchemaParseSimpleType(ctxt, schema, child, 0);
8970 xmlSchemaPContentErr(ctxt,
8980 xmlSchemaPCustomErr(ctxt,
8991 * @ctxt: a schema validation context
9002 xmlSchemaParseList(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
9009 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
9012 type = ctxt->ctxtType;
9030 xmlSchemaPIllegalAttrErr(ctxt,
9034 xmlSchemaPIllegalAttrErr(ctxt,
9040 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
9049 xmlSchemaPValAttrQName(ctxt, schema, NULL,
9057 xmlSchemaParseAnnotation(ctxt, child, 1));
9067 xmlSchemaPCustomErr(ctxt,
9073 type->subtypes = xmlSchemaParseSimpleType(ctxt, schema, child, 0);
9077 xmlSchemaPCustomErr(ctxt,
9084 xmlSchemaPContentErr(ctxt,
9091 xmlSchemaPCustomErr(ctxt,
9102 * @ctxt: a schema validation context
9113 xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
9122 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
9128 xmlSchemaPMissingAttrErr(ctxt,
9134 if (xmlSchemaPValAttrNode(ctxt,
9141 if (ctxt->isS4S) {
9144 if (ctxt->isRedefine) {
9150 xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_REDEFINE,
9176 snprintf(buf, 39, "#ST%d", ctxt->counter++ + 1);
9177 type = xmlSchemaAddType(ctxt, schema,
9179 xmlDictLookup(ctxt->dict, (const xmlChar *)buf, -1),
9180 ctxt->targetNamespace, node, 0);
9182 type = xmlSchemaAddType(ctxt, schema,
9184 NULL, ctxt->targetNamespace, node, 0);
9197 xmlSchemaPIllegalAttrErr(ctxt,
9201 xmlSchemaPIllegalAttrErr(ctxt,
9212 type = xmlSchemaAddType(ctxt, schema, XML_SCHEMA_TYPE_SIMPLE,
9213 attrValue, ctxt->targetNamespace, node, 1);
9228 xmlSchemaPIllegalAttrErr(ctxt,
9232 xmlSchemaPIllegalAttrErr(ctxt,
9249 attrValue = xmlSchemaGetProp(ctxt, node, "final");
9255 xmlSchemaPSimpleTypeErr(ctxt,
9263 type->targetNamespace = ctxt->targetNamespace;
9264 xmlSchemaPValAttrID(ctxt
9268 oldCtxtType = ctxt->ctxtType;
9270 ctxt->ctxtType = type;
9274 type->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
9278 xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_MISSING,
9282 xmlSchemaParseRestriction(ctxt, schema, child,
9287 xmlSchemaParseList(ctxt, schema, child);
9290 xmlSchemaParseUnion(ctxt, schema, child);
9294 xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED,
9305 if (topLevel && ctxt->isRedefine && (! hasRestriction)) {
9306 xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_REDEFINE,
9311 ctxt->ctxtType = oldCtxtType;
9317 * @ctxt: the parser context
9327 xmlSchemaParseModelGroupDefRef(xmlSchemaParserCtxtPtr ctxt,
9337 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
9342 xmlSchemaPMissingAttrErr(ctxt,
9346 } else if (xmlSchemaPValAttrNodeQName(ctxt, schema, NULL,
9350 xmlSchemaCheckReference(ctxt, schema, node, attr, refNs);
9351 min = xmlGetMinOccurs(ctxt, node, 0, -1, 1, "xs:nonNegativeInteger");
9352 max = xmlGetMaxOccurs(ctxt, node, 0, UNBOUNDED, 1,
9364 xmlSchemaPIllegalAttrErr(ctxt,
9368 xmlSchemaPIllegalAttrErr(ctxt,
9373 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
9374 item = xmlSchemaAddParticle(ctxt, node, min, max);
9382 xmlSchemaNewQNameRef(ctxt, XML_SCHEMA_TYPE_GROUP, ref, refNs);
9383 xmlSchemaPCheckParticleCorrect_2(ctxt, item, node, min, max);
9393 item->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
9397 xmlSchemaPContentErr(ctxt,
9413 * @ctxt: a schema validation context
9429 xmlSchemaParseModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt,
9438 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
9443 xmlSchemaPMissingAttrErr(ctxt,
9448 } else if (xmlSchemaPValAttrNode(ctxt, NULL, attr,
9452 item = xmlSchemaAddModelGroupDefinition(ctxt, schema, name,
9453 ctxt->targetNamespace, node);
9464 xmlSchemaPIllegalAttrErr(ctxt,
9468 xmlSchemaPIllegalAttrErr(ctxt,
9473 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
9479 item->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
9483 item->children = xmlSchemaParseModelGroup(ctxt, schema, child,
9487 item->children = xmlSchemaParseModelGroup(ctxt, schema, child,
9491 item->children = xmlSchemaParseModelGroup(ctxt, schema, child,
9499 xmlSchemaPContentErr(ctxt,
9509 * @ctxt: a schema validation context
9515 xmlSchemaCleanupDoc(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr root)
9519 if ((ctxt == NULL) || (root == NULL)) return;
9610 xmlSchemaParseSchemaElement(xmlSchemaParserCtxtPtr ctxt,
9616 int res = 0, oldErrs = ctxt->nberrors;
9623 res = xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
9633 res = xmlSchemaPValAttrNode(ctxt, NULL, NULL, attr,
9640 res = xmlSchemaPValAttrNode(ctxt, NULL, attr,
9644 ctxt->stop = XML_SCHEMAP_S4S_ATTR_INVALID_VALUE;
9650 val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
9655 xmlSchemaPSimpleTypeErr(ctxt,
9663 val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
9668 xmlSchemaPSimpleTypeErr(ctxt,
9676 val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
9685 xmlSchemaPSimpleTypeErr(ctxt,
9694 val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
9701 xmlSchemaPSimpleTypeErr(ctxt,
9710 if (oldErrs != ctxt->nberrors)
9711 res = ctxt->err;
9719 * @ctxt: a schema validation context
9727 xmlSchemaParseSchemaTopLevel(xmlSchemaParserCtxtPtr ctxt,
9734 if ((ctxt == NULL) || (schema == NULL) || (nodes == NULL))
9737 oldErrs = ctxt->nberrors;
9744 annot = xmlSchemaParseAnnotation(ctxt, child, 1);
9750 tmpOldErrs = ctxt->nberrors;
9751 res = xmlSchemaParseImport(ctxt, schema, child);
9753 HSTOP(ctxt);
9754 if (tmpOldErrs != ctxt->nberrors)
9757 tmpOldErrs = ctxt->nberrors;
9758 res = xmlSchemaParseInclude(ctxt, schema, child);
9760 HSTOP(ctxt);
9761 if (tmpOldErrs != ctxt->nberrors)
9764 tmpOldErrs = ctxt->nberrors;
9765 res = xmlSchemaParseRedefine(ctxt, schema, child);
9767 HSTOP(ctxt);
9768 if (tmpOldErrs != ctxt->nberrors)
9779 xmlSchemaParseComplexType(ctxt, schema, child, 1);
9782 xmlSchemaParseSimpleType(ctxt, schema, child, 1);
9785 xmlSchemaParseElement(ctxt, schema, child, NULL, 1);
9788 xmlSchemaParseGlobalAttribute(ctxt, schema, child);
9791 xmlSchemaParseAttributeGroupDefinition(ctxt, schema, child);
9794 xmlSchemaParseModelGroupDefinition(ctxt, schema, child);
9797 xmlSchemaParseNotation(ctxt, schema, child);
9800 xmlSchemaPContentErr(ctxt,
9812 annot = xmlSchemaParseAnnotation(ctxt, child, 1);
9821 ctxt->ctxtType = NULL;
9822 if (oldErrs != ctxt->nberrors)
9823 res = ctxt->err;
10676 * @ctxt: a schema validation context
11168 * @ctxt: a schema validation context
11192 xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
11202 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
11207 item = xmlSchemaAddModelGroup(ctxt, schema, type, node);
11213 min = xmlGetMinOccurs(ctxt, node, 0, 1, 1, "(0 | 1)");
11214 max = xmlGetMaxOccurs(ctxt, node, 1, 1, 1, "1");
11217 min = xmlGetMinOccurs(ctxt, node, 0, -1, 1, "xs:nonNegativeInteger");
11218 max = xmlGetMaxOccurs(ctxt, node, 0, UNBOUNDED, 1,
11221 xmlSchemaPCheckParticleCorrect_2(ctxt, NULL, node, min, max);
11225 particle = xmlSchemaAddParticle(ctxt, node, min, max);
11238 xmlSchemaPIllegalAttrErr(ctxt,
11242 xmlSchemaPIllegalAttrErr(ctxt,
11255 xmlSchemaPIllegalAttrErr(ctxt,
11259 xmlSchemaPIllegalAttrErr(ctxt,
11269 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
11275 item->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
11282 part = (xmlSchemaParticlePtr) xmlSchemaParseElement(ctxt,
11293 xmlSchemaPCustomErr(ctxt,
11302 xmlSchemaPCustomErr(ctxt,
11319 xmlSchemaPContentErr(ctxt,
11336 xmlSchemaParseElement(ctxt, schema, child, &isElemRef, 0);
11341 xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
11347 if (ctxt->isRedefine && ctxt->redef &&
11348 (ctxt->redef->item->type == XML_SCHEMA_TYPE_GROUP) &&
11352 ctxt->redef->refName) &&
11354 ctxt->redef->refTargetNs))
11365 if (ctxt->redefCounter != 0) {
11368 xmlSchemaCustomErr(ACTXT_CAST ctxt,
11374 ctxt->redef->refTargetNs,
11375 ctxt->redef->refName),
11389 xmlSchemaCustomErr(ACTXT_CAST ctxt,
11396 ctxt->redef->refTargetNs,
11397 ctxt->redef->refName),
11402 ctxt->redef->reference = WXS_BASIC_CAST part;
11403 ctxt->redefCounter++;
11408 xmlSchemaParseAny(ctxt, schema, child);
11410 part = xmlSchemaParseModelGroup(ctxt, schema, child,
11413 part = xmlSchemaParseModelGroup(ctxt, schema, child,
11426 xmlSchemaPContentErr(ctxt,
11438 WXS_ADD_PENDING(ctxt, item);
11448 * @ctxt: a schema validation context
11458 xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
11465 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
11468 type = ctxt->ctxtType;
11479 xmlSchemaPIllegalAttrErr(ctxt,
11483 xmlSchemaPIllegalAttrErr(ctxt,
11491 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
11504 if (xmlSchemaPValAttrQName(ctxt, schema, NULL, node, "base",
11508 xmlSchemaPMissingAttrErr(ctxt,
11511 } else if ((ctxt->isRedefine) &&
11515 xmlSchemaPMissingAttrErr(ctxt,
11529 xmlSchemaPCustomErrExt(ctxt, XML_SCHEMAP_SRC_REDEFINE,
11553 xmlSchemaParseAnnotation(ctxt, child, 1));
11567 xmlSchemaPContentErr(ctxt,
11574 xmlSchemaParseSimpleType(ctxt, schema, child, 0);
11578 xmlSchemaPContentErr(ctxt,
11593 xmlSchemaParseModelGroup(ctxt, schema, child,
11598 xmlSchemaParseModelGroup(ctxt,
11603 xmlSchemaParseModelGroup(ctxt, schema, child,
11611 xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
11631 xmlSchemaParseSimpleType(ctxt, schema, child, 0);
11666 facet = xmlSchemaParseFacet(ctxt, schema, child);
11688 xmlSchemaPErrMemory(ctxt, "allocating a facet link", NULL);
11707 if (xmlSchemaParseLocalAttributes(ctxt, schema, &child,
11716 xmlSchemaParseAnyAttribute(ctxt, schema, child);
11722 xmlSchemaPContentErr(ctxt,
11728 xmlSchemaPContentErr(ctxt,
11737 xmlSchemaPContentErr(ctxt,
11751 * @ctxt: a schema validation context
11762 xmlSchemaParseExtension(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
11769 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
11772 type = ctxt->ctxtType;
11783 xmlSchemaPIllegalAttrErr(ctxt,
11787 xmlSchemaPIllegalAttrErr(ctxt,
11793 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
11798 if ((xmlSchemaPValAttrQName(ctxt, schema, NULL, node,
11801 xmlSchemaPMissingAttrErr(ctxt,
11814 xmlSchemaParseAnnotation(ctxt, child, 1));
11825 xmlSchemaParseModelGroup(ctxt, schema,
11830 xmlSchemaParseModelGroup(ctxt, schema,
11835 xmlSchemaParseModelGroup(ctxt, schema,
11840 xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
11852 if (xmlSchemaParseLocalAttributes(ctxt, schema, &child,
11860 ctxt->ctxtType->attributeWildcard =
11861 xmlSchemaParseAnyAttribute(ctxt, schema, child);
11868 xmlSchemaPContentErr(ctxt,
11875 xmlSchemaPContentErr(ctxt,
11887 * @ctxt: a schema validation context
11897 xmlSchemaParseSimpleContent(xmlSchemaParserCtxtPtr ctxt,
11905 if ((ctxt == NULL) || (schema == NULL) || (node == NULL) ||
11910 type = ctxt->ctxtType;
11919 xmlSchemaPIllegalAttrErr(ctxt,
11923 xmlSchemaPIllegalAttrErr(ctxt,
11929 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
11940 xmlSchemaParseAnnotation(ctxt, child, 1));
11944 xmlSchemaPContentErr(ctxt,
11950 xmlSchemaPContentErr(ctxt,
11956 xmlSchemaParseRestriction(ctxt, schema, child,
11961 xmlSchemaParseExtension(ctxt, schema, child,
11967 xmlSchemaPContentErr(ctxt,
11977 * @ctxt: a schema validation context
11987 xmlSchemaParseComplexContent(xmlSchemaParserCtxtPtr ctxt,
11995 if ((ctxt == NULL) || (schema == NULL) || (node == NULL) ||
12000 type = ctxt->ctxtType;
12010 xmlSchemaPIllegalAttrErr(ctxt,
12014 xmlSchemaPIllegalAttrErr(ctxt,
12020 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
12025 if (xmlGetBooleanProp(ctxt, node, "mixed", 0)) {
12035 xmlSchemaParseAnnotation(ctxt, child, 1));
12039 xmlSchemaPContentErr(ctxt,
12045 xmlSchemaPContentErr(ctxt,
12051 xmlSchemaParseRestriction(ctxt, schema, child,
12056 xmlSchemaParseExtension(ctxt, schema, child,
12062 xmlSchemaPContentErr(ctxt,
12072 * @ctxt: a schema validation context
12082 xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
12096 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
12099 ctxtType = ctxt->ctxtType;
12104 xmlSchemaPMissingAttrErr(ctxt,
12107 } else if (xmlSchemaPValAttrNode(ctxt, NULL, attr,
12118 snprintf(buf, 39, "#CT%d", ctxt->counter++ + 1);
12119 type = xmlSchemaAddType(ctxt, schema,
12121 xmlDictLookup(ctxt->dict, (const xmlChar *)buf, -1),
12122 ctxt->targetNamespace, node, 0);
12124 type = xmlSchemaAddType(ctxt, schema,
12126 NULL, ctxt->targetNamespace, node, 0);
12140 type = xmlSchemaAddType(ctxt, schema,
12142 name, ctxt->targetNamespace, node, 1);
12149 type->targetNamespace = ctxt->targetNamespace;
12160 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
12165 if (xmlSchemaPGetBoolNodeValue(ctxt,
12178 if (xmlSchemaPGetBoolNodeValue(ctxt,
12185 attrValue = xmlSchemaGetNodeContent(ctxt,
12194 xmlSchemaPSimpleTypeErr(ctxt,
12205 attrValue = xmlSchemaGetNodeContent(ctxt,
12212 xmlSchemaPSimpleTypeErr(ctxt,
12220 xmlSchemaPIllegalAttrErr(ctxt,
12224 xmlSchemaPIllegalAttrErr(ctxt,
12228 xmlSchemaPIllegalAttrErr(ctxt,
12256 type->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
12259 ctxt->ctxtType = type;
12269 xmlSchemaParseSimpleContent(ctxt, schema, child,
12277 xmlSchemaParseComplexContent(ctxt, schema, child,
12297 xmlSchemaParseModelGroup(ctxt, schema, child,
12302 xmlSchemaParseModelGroup(ctxt, schema, child,
12307 xmlSchemaParseModelGroup(ctxt, schema, child,
12312 xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
12322 if (xmlSchemaParseLocalAttributes(ctxt, schema, &child,
12330 type->attributeWildcard = xmlSchemaParseAnyAttribute(ctxt, schema, child);
12335 xmlSchemaPContentErr(ctxt,
12345 if (topLevel && ctxt->isRedefine && (! hasRestrictionOrExtension)) {
12346 xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_REDEFINE,
12351 ctxt->ctxtType = ctxtType;
12370 * @ctxt: a schema parser context
12379 xmlSchemaParserCtxtSetOptions(xmlSchemaParserCtxtPtr ctxt,
12385 if (ctxt == NULL)
12396 ctxt->options = options;
12402 * @ctxt: a schema parser context
12407 xmlSchemaParserCtxtGetOptions(xmlSchemaParserCtxtPtr ctxt)
12410 if (ctxt == NULL)
12413 return (ctxt->options);
12497 * @ctxt: the schema parser context
12502 xmlSchemaFreeParserCtxt(xmlSchemaParserCtxtPtr ctxt)
12504 if (ctxt == NULL)
12506 if (ctxt->doc != NULL && !ctxt->preserve)
12507 xmlFreeDoc(ctxt->doc);
12508 if (ctxt->vctxt != NULL) {
12509 xmlSchemaFreeValidCtxt(ctxt->vctxt);
12511 if (ctxt->ownsConstructor && (ctxt->constructor != NULL)) {
12512 xmlSchemaConstructionCtxtFree(ctxt->constructor);
12513 ctxt->constructor = NULL;
12514 ctxt->ownsConstructor = 0;
12516 if (ctxt->attrProhibs != NULL)
12517 xmlSchemaItemListFree(ctxt->attrProhibs);
12518 xmlDictFree(ctxt->dict);
12519 xmlFree(ctxt);
12651 xmlSchemaBuildContentModelForElement(xmlSchemaParserCtxtPtr ctxt,
12661 ret = xmlSchemaBuildContentModelForSubstGroup(ctxt, particle, -1, NULL);
12671 start = ctxt->state;
12672 ctxt->state = xmlAutomataNewTransition2(ctxt->am, start, NULL,
12677 start = ctxt->state;
12678 ctxt->state = xmlAutomataNewTransition2(ctxt->am, start, NULL,
12680 ctxt->state = xmlAutomataNewTransition2(ctxt->am, ctxt->state, ctxt->state,
12689 start = xmlAutomataNewEpsilon(ctxt->am, ctxt->state, NULL);
12690 counter = xmlAutomataNewCounter(ctxt->am, minOccurs, maxOccurs);
12691 ctxt->state = xmlAutomataNewTransition2(ctxt->am, start, NULL,
12693 xmlAutomataNewCountedTrans(ctxt->am, ctxt->state, start, counter);
12694 ctxt->state = xmlAutomataNewCounterTrans(ctxt->am, ctxt->state,
12698 xmlAutomataNewEpsilon(ctxt->am, start, ctxt->state);
12707 * @ctxt: the schema parser context
13107 * @ctxt: the schema parser context
13115 xmlSchemaParserCtxtPtr ctxt)
13127 ctxt->am = NULL;
13128 ctxt->am = xmlNewAutomata();
13129 if (ctxt->am == NULL) {
13134 ctxt->state = xmlAutomataGetInitState(ctxt->am);
13138 xmlSchemaBuildAContentModel(ctxt, WXS_TYPE_PARTICLE(type));
13139 xmlAutomataSetFinalState(ctxt->am, ctxt->state);
13140 type->contModel = xmlAutomataCompile(ctxt->am);
13142 xmlSchemaPCustomErr(ctxt,
13147 xmlSchemaPCustomErr(ctxt,
13159 ctxt->state = NULL;
13160 xmlFreeAutomata(ctxt->am);
13161 ctxt->am = NULL;
13167 * @ctxt: the schema parser context
13175 xmlSchemaParserCtxtPtr ctxt)
13177 if ((ctxt == NULL) || (elemDecl == NULL) ||
13189 type = xmlSchemaGetType(ctxt->schema, elemDecl->namedType,
13192 xmlSchemaPResCompAttrErr(ctxt,
13207 substHead = xmlSchemaGetElem(ctxt->schema, elemDecl->substGroup,
13210 xmlSchemaPResCompAttrErr(ctxt,
13216 xmlSchemaResolveElementReferences(substHead, ctxt);
13244 * @ctxt: the schema parser context
13254 xmlSchemaResolveUnionMemberTypes(xmlSchemaParserCtxtPtr ctxt,
13279 memberType = xmlSchemaGetType(ctxt->schema, name, nsName);
13281 xmlSchemaPResCompAttrErr(ctxt, XML_SCHEMAP_SRC_RESOLVE,
13307 xmlSchemaPErrMemory(ctxt, "allocating a type link", NULL);
13324 * @ctxt: the schema parser context
13353 * @ctxt: the schema parser context
13441 * @ctxt: the schema parser context
13450 xmlSchemaCloneWildcardNsConstraints(xmlSchemaParserCtxtPtr ctxt,
13462 tmp = xmlSchemaNewWildcardNsConstraint(ctxt);
13476 dest->negNsSet = xmlSchemaNewWildcardNsConstraint(ctxt);
13487 * @ctxt: the schema parser context
13497 xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
13579 tmp = xmlSchemaNewWildcardNsConstraint(ctxt);
13657 completeWild->negNsSet = xmlSchemaNewWildcardNsConstraint(ctxt);
13667 xmlSchemaPErr(ctxt, completeWild->node,
13683 completeWild->negNsSet = xmlSchemaNewWildcardNsConstraint(ctxt);
13734 completeWild->negNsSet = xmlSchemaNewWildcardNsConstraint(ctxt);
13747 * @ctxt: the schema parser context
13757 xmlSchemaIntersectWildcards(xmlSchemaParserCtxtPtr ctxt,
13805 if (xmlSchemaCloneWildcardNsConstraints(ctxt, completeWild, curWild) == -1)
13821 if (xmlSchemaCloneWildcardNsConstraints(ctxt, completeWild, curWild) == -1)
13905 xmlSchemaPErr(ctxt, completeWild->node, XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE,
13925 * @ctxt: the schema parser context
14370 * @ctxt: the schema parser context
14904 * @ctxt: the parser context
14911 xmlSchemaParserCtxtPtr ctxt)
14917 xmlSchemaCheckTypeDefCircularInternal(ctxt, item,
14986 * @ctxt: the parser context
14993 xmlSchemaParserCtxtPtr ctxt)
15002 typeDef->baseType = xmlSchemaGetType(ctxt->schema,
15005 xmlSchemaPResCompAttrErr(ctxt,
15018 xmlSchemaResolveUnionMemberTypes(ctxt, typeDef);
15026 typeDef->subtypes = xmlSchemaGetType(ctxt->schema,
15033 xmlSchemaPResCompAttrErr(ctxt,
15067 WXS_MODEL_GROUPDEF_CAST xmlSchemaGetNamedComponent(ctxt->schema,
15070 xmlSchemaPResCompAttrErr(ctxt, XML_SCHEMAP_SRC_RESOLVE,
15094 xmlSchemaCustomErr(ACTXT_CAST ctxt,
15111 * @ctxt: the schema parser context
15121 xmlSchemaCheckSTPropsCorrect(xmlSchemaParserCtxtPtr ctxt,
15143 xmlSchemaPCustomErr(ctxt,
15151 xmlSchemaPCustomErr(ctxt,
15163 xmlSchemaPCustomErr(ctxt,
15177 xmlSchemaPCustomErr(ctxt,
15190 xmlSchemaPCustomErr(ctxt,
15213 * @ctxt: the schema parser context
15681 * @ctxt: the schema parser context
15692 xmlSchemaCheckSRCSimpleType(xmlSchemaParserCtxtPtr ctxt,
15727 xmlSchemaCreateVCtxtOnPCtxt(xmlSchemaParserCtxtPtr ctxt)
15729 if (ctxt->vctxt == NULL) {
15730 ctxt->vctxt = xmlSchemaNewValidCtxt(NULL);
15731 if (ctxt->vctxt == NULL) {
15732 xmlSchemaPErr(ctxt, NULL,
15740 xmlSchemaSetValidErrors(ctxt->vctxt,
15741 ctxt->error, ctxt->warning, ctxt->errCtxt);
15742 xmlSchemaSetValidStructuredErrors(ctxt->vctxt,
15743 ctxt->serror, ctxt->errCtxt);
15841 * @ctxt: the schema parser context
15986 * @ctxt: the schema parser context
16084 * @ctxt: the schema parser context
16100 xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt,
16118 xmlSchemaPCustomErr(ctxt,
16170 xmlSchemaCustomErr(ACTXT_CAST ctxt,
16253 xmlSchemaPCustomErr(ctxt,
16279 xmlSchemaPCustomErr(ctxt,
16313 xmlSchemaPCustomErr(ctxt,
16325 xmlSchemaPCustomErr(ctxt,
16338 * @ctxt: the schema parser context
16357 xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
16368 xmlSchemaCustomErr(ACTXT_CAST ctxt,
16372 return(ctxt->err);
16379 xmlSchemaCustomErr(ACTXT_CAST ctxt,
16384 return (ctxt->err);
16392 if (xmlSchemaCheckDerivationOKRestriction2to4(ctxt,
16432 err = xmlSchemaCheckCOSSTDerivedOK(ACTXT_CAST ctxt,
16439 xmlSchemaCustomErr(ACTXT_CAST ctxt,
16450 return(ctxt->err);
16462 xmlSchemaPCustomErr(ctxt,
16467 return (ctxt->err);
16491 xmlSchemaPCustomErr(ctxt,
16497 return (ctxt->err);
16511 xmlSchemaPCustomErr(ctxt,
16516 return (ctxt->err);
16527 xmlSchemaPCustomErr(ctxt,
16531 return (ctxt->err);
16538 * @ctxt: the schema parser context
16547 xmlSchemaCheckCTComponent(xmlSchemaParserCtxtPtr ctxt,
16554 ret = xmlSchemaCheckCTPropsCorrect(ctxt, type);
16558 ret = xmlSchemaCheckCOSCTExtends(ctxt, type);
16560 ret = xmlSchemaCheckDerivationOKRestriction(ctxt, type);
16566 * @ctxt: the schema parser context
16577 xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt,
16596 xmlSchemaPCustomErr(ctxt,
16622 xmlSchemaPCustomErr(ctxt,
16643 xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_INTERNAL,
16674 xmlSchemaPCustomErr(ctxt,
16692 xmlSchemaPCustomErr(ctxt,
16702 xmlSchemaPCustomErr(ctxt,
16733 * @ctxt: the schema parser context
16759 * @ctxt: the schema parser context
16776 xmlSchemaCheckRCaseNameAndTypeOK(xmlSchemaParserCtxtPtr ctxt,
16857 if (xmlSchemaCheckCOSDerivedOK(ACTXT_CAST ctxt, elemR->subtypes,
16866 * @ctxt: the schema parser context
16881 xmlSchemaCheckRCaseNSCompat(xmlSchemaParserCtxtPtr ctxt,
16910 * @ctxt: the schema parser context
16925 xmlSchemaCheckRCaseRecurseAsIfGroup(xmlSchemaParserCtxtPtr ctxt,
16936 * @ctxt: the schema parser context
16951 xmlSchemaCheckRCaseNSSubset(xmlSchemaParserCtxtPtr ctxt,
16988 ctxt: the schema parser context
17001 xmlSchemaCheckCOSParticleRestrict(xmlSchemaParserCtxtPtr ctxt,
17026 * @ctxt: the schema parser context
17042 xmlSchemaCheckRCaseNSRecurseCheckCardinality(xmlSchemaParserCtxtPtr ctxt,
17060 if (xmlSchemaCheckCOSParticleRestrict(ctxt, part, b))
17080 * @ctxt: the schema parser context
17097 xmlSchemaCheckRCaseRecurse(xmlSchemaParserCtxtPtr ctxt,
18078 * xmlSchemaPErr(ctxt, type->node,
18562 * @ctxt: the schema parser context
18803 * @ctxt: the schema parser context
18904 * @ctxt: the parser context
18911 xmlSchemaParserCtxtPtr ctxt)
18936 xmlSchemaPCustomErr(ctxt,
18954 * @ctxt: the parser context
18968 xmlSchemaParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
19054 * @ctxt: the parser context
19061 xmlSchemaParserCtxtPtr ctxt)
19091 xmlSchemaPCustomErr(ctxt,
19103 return(ctxt->err);
19415 * @ctxt: the schema parser context
19422 xmlSchemaParserCtxtPtr ctxt)
19428 group = xmlSchemaGetAttributeGroup(ctxt->schema,
19432 xmlSchemaPResCompAttrErr(ctxt,
19437 return(ctxt->err);
19446 * @ctxt: a schema parser context
19545 * @ctxt: a schema parser context
19720 * @ctxt: a schema parser context
19738 xmlSchemaCheckElemSubstGroup(xmlSchemaParserCtxtPtr ctxt,
19829 xmlSchemaAddElementSubstitutionMember(ctxt, head, elemDecl);
19956 * @ctxt: a schema parser context
19964 xmlSchemaParserCtxtPtr ctxt)
19971 if (xmlSchemaCheckElemPropsCorrect(ctxt, elemDecl) == 0) {
19975 xmlSchemaCheckElemSubstGroup(ctxt, elemDecl);
19982 * @ctxt: a parser context
19989 xmlSchemaParserCtxtPtr ctxt,
20013 refItem = xmlSchemaGetNamedComponent(ctxt->schema,
20016 xmlSchemaPResCompAttrErr(ctxt, XML_SCHEMAP_SRC_RESOLVE,
20045 xmlSchemaCustomErr(ACTXT_CAST ctxt,
20131 * @ctxt: a parser context
20137 xmlSchemaParserCtxtPtr ctxt)
20139 if ((ctxt == NULL) || (ause == NULL))
20152 ause->attrDecl = xmlSchemaGetAttributeDecl(ctxt->schema,
20155 xmlSchemaPResCompAttrErr(ctxt,
20160 return(ctxt->err);;
20168 * @ctxt: a parser context
20176 xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt,
20179 if ((ctxt == NULL) || (use == NULL))
20197 xmlSchemaPCustomErr(ctxt,
20204 return(ctxt->err);
20221 xmlSchemaCustomErr(ACTXT_CAST ctxt,
20227 return(ctxt->err);
20230 ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST ctxt,
20240 xmlSchemaCustomErr(ACTXT_CAST ctxt,
20245 return(ctxt->err);
20261 xmlSchemaPCustomErr(ctxt,
20269 return(ctxt->err);
20280 * @ctxt: a parser context
20286 xmlSchemaParserCtxtPtr ctxt)
20302 type = xmlSchemaGetType(ctxt->schema, item->typeName,
20305 xmlSchemaPResCompAttrErr(ctxt,
20310 return(ctxt->err);
20326 * @ctxt: the schema parser context
21256 * @ctxt: a schema validation context
21265 xmlSchemaParse(xmlSchemaParserCtxtPtr ctxt)
21278 if (ctxt == NULL)
21282 ctxt->nberrors = 0;
21283 ctxt->err = 0;
21284 ctxt->counter = 0;
21287 mainSchema = xmlSchemaNewSchema(ctxt);
21293 if (ctxt->constructor == NULL) {
21294 ctxt->constructor = xmlSchemaConstructionCtxtCreate(ctxt->dict);
21295 if (ctxt->constructor == NULL)
21298 ctxt->ownsConstructor = 1;
21300 ctxt->constructor->mainSchema = mainSchema;
21304 res = xmlSchemaAddSchemaDoc(ctxt, XML_SCHEMA_SCHEMA_MAIN,
21305 ctxt->URL, ctxt->doc, ctxt->buffer, ctxt->size, NULL,
21314 if (ctxt->URL)
21315 xmlSchemaCustomErr(ACTXT_CAST ctxt, XML_SCHEMAP_FAILED_LOAD,
21318 ctxt->URL, NULL);
21320 xmlSchemaCustomErr(ACTXT_CAST ctxt, XML_SCHEMAP_FAILED_LOAD,
21327 if (xmlSchemaParseNewDocWithContext(ctxt, mainSchema, bucket) == -1)
21329 if (ctxt->nberrors != 0)
21333 mainSchema->preserve = ctxt->preserve;
21335 ctxt->schema = mainSchema;
21337 if (xmlSchemaFixupComponents(ctxt, WXS_CONSTRUCTOR(ctxt)->mainBucket) == -1)
21345 if (ctxt->nberrors != 0) {
21350 if (ctxt->constructor) {
21351 xmlSchemaConstructionCtxtFree(ctxt->constructor);
21352 ctxt->constructor = NULL;
21353 ctxt->ownsConstructor = 0;
21356 ctxt->schema = NULL;
21367 if (ctxt->constructor) {
21368 xmlSchemaConstructionCtxtFree(ctxt->constructor);
21369 ctxt->constructor = NULL;
21370 ctxt->ownsConstructor = 0;
21374 ctxt->schema = NULL;
21380 * @ctxt: a schema validation context
21388 xmlSchemaSetParserErrors(xmlSchemaParserCtxtPtr ctxt,
21392 if (ctxt == NULL)
21394 ctxt->error = err;
21395 ctxt->warning = warn;
21396 ctxt->errCtxt = ctx;
21397 if (ctxt->vctxt != NULL)
21398 xmlSchemaSetValidErrors(ctxt->vctxt, err, warn, ctx);
21403 * @ctxt: a schema parser context
21410 xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt,
21414 if (ctxt == NULL)
21416 ctxt->serror = serror;
21417 ctxt->errCtxt = ctx;
21418 if (ctxt->vctxt != NULL)
21419 xmlSchemaSetValidStructuredErrors(ctxt->vctxt, serror, ctx);
21424 * @ctxt: a XMl-Schema parser context
21434 xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt,
21438 if (ctxt == NULL)
21441 *err = ctxt->error;
21443 *warn = ctxt->warning;
21445 *ctx = ctxt->errCtxt;
27454 * @ctxt: the schema validation context
27559 * @ctxt: the schema validation context
27564 xmlSchemaFreeValidCtxt(xmlSchemaValidCtxtPtr ctxt)
27566 if (ctxt == NULL)
27568 if (ctxt->value != NULL)
27569 xmlSchemaFreeValue(ctxt->value);
27570 if (ctxt->pctxt != NULL)
27571 xmlSchemaFreeParserCtxt(ctxt->pctxt);
27572 if (ctxt->idcNodes != NULL) {
27576 for (i = 0; i < ctxt->nbIdcNodes; i++) {
27577 item = ctxt->idcNodes[i];
27581 xmlFree(ctxt->idcNodes);
27583 if (ctxt->idcKeys != NULL) {
27585 for (i = 0; i < ctxt->nbIdcKeys; i++)
27586 xmlSchemaIDCFreeKey(ctxt->idcKeys[i]);
27587 xmlFree(ctxt->idcKeys);
27590 if (ctxt->xpathStates != NULL) {
27591 xmlSchemaFreeIDCStateObjList(ctxt->xpathStates);
27592 ctxt->xpathStates = NULL;
27594 if (ctxt->xpathStatePool != NULL) {
27595 xmlSchemaFreeIDCStateObjList(ctxt->xpathStatePool);
27596 ctxt->xpathStatePool = NULL;
27602 if (ctxt
27603 xmlSchemaIDCAugPtr cur = ctxt->aidcs, next;
27610 if (ctxt->attrInfos != NULL) {
27615 if (ctxt->nbAttrInfos != 0)
27616 xmlSchemaClearAttrInfos(ctxt);
27617 for (i = 0; i < ctxt->sizeAttrInfos; i++) {
27618 attr = ctxt->attrInfos[i];
27621 xmlFree(ctxt->attrInfos);
27623 if (ctxt->elemInfos != NULL) {
27627 for (i = 0; i < ctxt->sizeElemInfos; i++) {
27628 ei = ctxt->elemInfos[i];
27631 xmlSchemaClearElemInfo(ctxt, ei);
27634 xmlFree(ctxt->elemInfos);
27636 if (ctxt->nodeQNames != NULL)
27637 xmlSchemaItemListFree(ctxt->nodeQNames);
27638 if (ctxt->dict != NULL)
27639 xmlDictFree(ctxt->dict);
27640 xmlFree(ctxt);
27645 * @ctxt: the schema validation context
27653 xmlSchemaIsValid(xmlSchemaValidCtxtPtr ctxt)
27655 if (ctxt == NULL)
27657 return(ctxt->err == 0);
27662 * @ctxt: a schema validation context
27670 xmlSchemaSetValidErrors(xmlSchemaValidCtxtPtr ctxt,
27674 if (ctxt == NULL)
27676 ctxt->error = err;
27677 ctxt->warning = warn;
27678 ctxt->errCtxt = ctx;
27679 if (ctxt->pctxt != NULL)
27680 xmlSchemaSetParserErrors(ctxt->pctxt, err, warn, ctx);
27685 * @ctxt: a schema validation context
27692 xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt,
27695 if (ctxt == NULL)
27697 ctxt->serror = serror;
27698 ctxt->error = NULL;
27699 ctxt->warning = NULL;
27700 ctxt->errCtxt = ctx;
27701 if (ctxt->pctxt != NULL)
27702 xmlSchemaSetParserStructuredErrors(ctxt->pctxt, serror, ctx);
27707 * @ctxt: a XML-Schema validation context
27717 xmlSchemaGetValidErrors(xmlSchemaValidCtxtPtr ctxt,
27721 if (ctxt == NULL)
27724 *err = ctxt->error;
27726 *warn = ctxt->warning;
27728 *ctx = ctxt->errCtxt;
27735 * @ctxt: a schema validation context
27744 xmlSchemaSetValidOptions(xmlSchemaValidCtxtPtr ctxt,
27750 if (ctxt == NULL)
27762 ctxt->options = options;
27768 * @ctxt: a schema validation context
27775 xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt)
27778 if (ctxt == NULL)
27781 return (ctxt->options);
28061 * @ctxt: a schema validation context
28070 xmlSchemaValidateOneElement(xmlSchemaValidCtxtPtr ctxt, xmlNodePtr elem)
28072 if ((ctxt == NULL) || (elem == NULL) || (elem->type != XML_ELEMENT_NODE))
28075 if (ctxt->schema == NULL)
28078 ctxt->doc = elem->doc;
28079 ctxt->node = elem;
28080 ctxt->validationRoot = elem;
28081 return(xmlSchemaVStart(ctxt));
28086 * @ctxt: a schema validation context
28095 xmlSchemaValidateDoc(xmlSchemaValidCtxtPtr ctxt, xmlDocPtr doc)
28097 if ((ctxt == NULL) || (doc == NULL))
28100 ctxt->doc = doc;
28101 ctxt->node = xmlDocGetRootElement(doc);
28102 if (ctxt->node == NULL) {
28103 xmlSchemaCustomErr(ACTXT_CAST ctxt,
28107 return (ctxt->err);
28109 ctxt->validationRoot = ctxt->node;
28110 return (xmlSchemaVStart(ctxt));
28125 xmlSchemaValidCtxtPtr ctxt;
28142 xmlSchemaValidCtxtPtr ctxt;
28150 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28151 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28152 (ctxt->user_sax->internalSubset != NULL))
28153 ctxt->user_sax->internalSubset(ctxt->user_data, name, ExternalID,
28160 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28161 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28162 (ctxt->user_sax->isStandalone != NULL))
28163 return(ctxt->user_sax->isStandalone(ctxt->user_data));
28170 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28171 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28172 (ctxt->user_sax->hasInternalSubset != NULL))
28173 return(ctxt->user_sax->hasInternalSubset(ctxt->user_data));
28180 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28181 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28182 (ctxt->user_sax->hasExternalSubset != NULL))
28183 return(ctxt->user_sax->hasExternalSubset(ctxt->user_data));
28191 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28192 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28193 (ctxt->user_sax->externalSubset != NULL))
28194 ctxt->user_sax->externalSubset(ctxt->user_data, name, ExternalID,
28201 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28202 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28203 (ctxt->user_sax->resolveEntity != NULL))
28204 return(ctxt->user_sax->resolveEntity(ctxt->user_data, publicId,
28212 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28213 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28214 (ctxt->user_sax->getEntity != NULL))
28215 return(ctxt->user_sax->getEntity(ctxt->user_data, name));
28222 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28223 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28224 (ctxt->user_sax->getParameterEntity != NULL))
28225 return(ctxt->user_sax->getParameterEntity(ctxt->user_data, name));
28234 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28235 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28236 (ctxt->user_sax->entityDecl != NULL))
28237 ctxt->user_sax->entityDecl(ctxt->user_data, name, type, publicId,
28246 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28247 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28248 (ctxt->user_sax->attributeDecl != NULL)) {
28249 ctxt->user_sax->attributeDecl(ctxt->user_data, elem, name, type,
28260 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28261 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28262 (ctxt->user_sax->elementDecl != NULL))
28263 ctxt->user_sax->elementDecl(ctxt->user_data, name, type, content);
28270 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28271 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28272 (ctxt->user_sax->notationDecl != NULL))
28273 ctxt->user_sax->notationDecl(ctxt->user_data, name, publicId,
28282 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28283 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28284 (ctxt->user_sax->unparsedEntityDecl != NULL))
28285 ctxt->user_sax->unparsedEntityDecl(ctxt->user_data, name, publicId,
28292 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28293 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28294 (ctxt->user_sax->setDocumentLocator != NULL))
28295 ctxt->user_sax->setDocumentLocator(ctxt->user_data, loc);
28301 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28302 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28303 (ctxt->user_sax->startDocument != NULL))
28304 ctxt->user_sax->startDocument(ctxt->user_data);
28310 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28311 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28312 (ctxt->user_sax->endDocument != NULL))
28313 ctxt->user_sax->endDocument(ctxt->user_data);
28320 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28321 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28322 (ctxt->user_sax->processingInstruction != NULL))
28323 ctxt->user_sax->processingInstruction(ctxt->user_data, target, data);
28329 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28330 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28331 (ctxt->user_sax->comment != NULL))
28332 ctxt->user_sax->comment(ctxt->user_data, value);
28341 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28342 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28343 (ctxt->user_sax->warning != NULL)) {
28349 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28350 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28351 (ctxt->user_sax->error != NULL)) {
28357 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28358 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28359 (ctxt->user_sax->fatalError != NULL)) {
28371 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28372 if (ctxt == NULL)
28374 if ((ctxt->user_sax != NULL) && (ctxt->user_sax->characters != NULL))
28375 ctxt->user_sax->characters(ctxt->user_data, ch, len);
28376 if (ctxt->ctxt != NULL)
28377 xmlSchemaSAXHandleText(ctxt->ctxt, ch, len);
28383 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28384 if (ctxt == NULL)
28386 if ((ctxt->user_sax != NULL) &&
28387 (ctxt->user_sax->ignorableWhitespace != NULL))
28388 ctxt->user_sax->ignorableWhitespace(ctxt->user_data, ch, len);
28389 if (ctxt->ctxt != NULL)
28390 xmlSchemaSAXHandleText(ctxt->ctxt, ch, len);
28396 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28397 if (ctxt == NULL)
28399 if ((ctxt->user_sax != NULL) &&
28400 (ctxt->user_sax->cdataBlock != NULL))
28401 ctxt->user_sax->cdataBlock(ctxt->user_data, value, len);
28402 if (ctxt->ctxt != NULL)
28403 xmlSchemaSAXHandleCDataSection(ctxt->ctxt, value, len);
28409 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28410 if (ctxt == NULL)
28412 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28413 (ctxt->user_sax->reference != NULL))
28414 ctxt->user_sax->reference(ctxt->user_data, name);
28415 if (ctxt->ctxt != NULL)
28416 xmlSchemaSAXHandleReference(ctxt->user_data, name);
28425 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28426 if (ctxt == NULL)
28428 if ((ctxt->user_sax != NULL) &&
28429 (ctxt->user_sax->startElementNs != NULL))
28430 ctxt->user_sax->startElementNs(ctxt->user_data, localname, prefix,
28434 if (ctxt->ctxt != NULL)
28435 xmlSchemaSAXHandleStartElementNs(ctxt->ctxt, localname, prefix,
28444 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28445 if (ctxt == NULL)
28447 if ((ctxt->user_sax != NULL) &&
28448 (ctxt->user_sax->endElementNs != NULL))
28449 ctxt->user_sax->endElementNs(ctxt->user_data, localname, prefix, URI);
28450 if (ctxt->ctxt != NULL)
28451 xmlSchemaSAXHandleEndElementNs(ctxt->ctxt, localname, prefix, URI);
28456 * @ctxt: a schema validation context
28468 xmlSchemaSAXPlug(xmlSchemaValidCtxtPtr ctxt,
28474 if ((ctxt == NULL) || (sax == NULL) || (user_data == NULL))
28498 ret->ctxt = ctxt;
28517 ret->user_data = ctxt;
28518 *user_data = ctxt;
28594 ctxt->sax = *sax;
28595 ctxt->flags |= XML_SCHEMA_VALID_CTXT_FLAG_STREAM;
28596 xmlSchemaPreRun(ctxt);
28619 xmlSchemaPostRun(plug->ctxt);
28635 * @ctxt: a schema validation context
28649 xmlSchemaValidateStream(xmlSchemaValidCtxtPtr ctxt,
28659 if ((ctxt == NULL) || (input == NULL))
28683 ctxt->parserCtxt = pctxt;
28684 ctxt->input = input;
28689 plug = xmlSchemaSAXPlug(ctxt, &(pctxt->sax), &(pctxt->userData));
28694 ctxt->input = input;
28695 ctxt->enc = enc;
28696 ctxt->sax = pctxt->sax;
28697 ctxt->flags |= XML_SCHEMA_VALID_CTXT_FLAG_STREAM;
28698 ret = xmlSchemaVStart(ctxt);
28700 if ((ret == 0) && (! ctxt->parserCtxt->wellFormed)) {
28701 ret = ctxt->parserCtxt->errNo;
28707 ctxt->parserCtxt = NULL;
28708 ctxt->sax = NULL;
28709 ctxt->input = NULL;
28723 * @ctxt: a schema validation context
28734 xmlSchemaValidateFile(xmlSchemaValidCtxtPtr ctxt,
28741 if ((ctxt == NULL) || (filename == NULL))
28748 ret = xmlSchemaValidateStream(ctxt, input, XML_CHAR_ENCODING_NONE,
28755 * @ctxt: a schema validation context
28763 xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt)
28765 if (ctxt == NULL)
28767 return (ctxt->parserCtxt);