Home | History | Annotate | Download | only in libxml2

Lines Matching full:ctxt

1064 static int xmlSchemaParseInclude(xmlSchemaParserCtxtPtr ctxt,
1067 static int xmlSchemaParseRedefine(xmlSchemaParserCtxtPtr ctxt,
1072 xmlSchemaAbstractCtxtPtr ctxt);
1076 xmlSchemaParseImport(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
1080 xmlSchemaParserCtxtPtr ctxt);
1086 xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
1098 xmlSchemaCheckCOSSTDerivedOK(xmlSchemaAbstractCtxtPtr ctxt,
1104 xmlSchemaParserCtxtPtr ctxt);
1881 xmlSchemaPErrMemory(xmlSchemaParserCtxtPtr ctxt,
1884 if (ctxt != NULL)
1885 ctxt->nberrors++;
1892 * @ctxt: the parsing context
1902 xmlSchemaPErr(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error,
1909 if (ctxt != NULL) {
1910 ctxt->nberrors++;
1911 ctxt->err = error;
1912 channel = ctxt->error;
1913 data = ctxt->errCtxt;
1914 schannel = ctxt->serror;
1916 __xmlRaiseError(schannel, channel, data, ctxt, node, XML_FROM_SCHEMASP,
1924 * @ctxt: the parsing context
1935 xmlSchemaPErr2(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
1940 xmlSchemaPErr(ctxt, child, error, msg, str1, str2);
1942 xmlSchemaPErr(ctxt, node, error, msg, str1, str2);
1948 * @ctxt: the parsing context
1964 xmlSchemaPErrExt(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error,
1975 if (ctxt != NULL) {
1976 ctxt->nberrors++;
1977 ctxt->err = error;
1978 channel = ctxt->error;
1979 data = ctxt->errCtxt;
1980 schannel = ctxt->serror;
1982 __xmlRaiseError(schannel, channel, data, ctxt, node, XML_FROM_SCHEMASP,
2003 xmlSchemaVErrMemory(xmlSchemaValidCtxtPtr ctxt,
2006 if (ctxt != NULL) {
2007 ctxt->nberrors++;
2008 ctxt->err = XML_SCHEMAV_INTERNAL;
2026 * @ctxt: the validation context
2040 xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt,
2050 if (ctxt != NULL) {
2051 if (ctxt->type == XML_SCHEMA_CTXT_VALIDATOR) {
2052 xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctxt;
2114 __xmlRaiseError(schannel, channel, data, ctxt,
2120 } else if (ctxt->type == XML_SCHEMA_CTXT_PARSER) {
2121 xmlSchemaParserCtxtPtr pctxt = (xmlSchemaParserCtxtPtr) ctxt;
2131 __xmlRaiseError(schannel, channel, data, ctxt,
2144 * @ctxt: the validation context
2775 #define PERROR_INT2(func, msg) xmlSchemaInternalErr(ACTXT_CAST ctxt, func, msg);
2782 * @ctxt: the schema validation context
2793 xmlSchemaPMissingAttrErr(xmlSchemaParserCtxtPtr ctxt,
2805 xmlSchemaPErr(ctxt, ownerElem, error, "%s: %s.\n", BAD_CAST des, BAD_CAST message);
2807 xmlSchemaPErr(ctxt, ownerElem, error,
2816 * @ctxt: the schema validation context
2830 xmlSchemaPResCompAttrErr(xmlSchemaParserCtxtPtr ctxt,
2845 xmlSchemaPErrExt(ctxt, ownerElem, error,
2857 * @ctxt: the schema parser context
2866 xmlSchemaPCustomAttrErr(xmlSchemaParserCtxtPtr ctxt,
2883 xmlSchemaPErrExt(ctxt, NULL, error, NULL, NULL, NULL,
2888 xmlSchemaPErrExt(ctxt, (xmlNodePtr) attr, error, NULL, NULL, NULL,
2898 * @ctxt: the schema parser context
2907 xmlSchemaPIllegalAttrErr(xmlSchemaParserCtxtPtr ctxt,
2914 xmlSchemaFormatNodeForError(&strA, ACTXT_CAST ctxt, attr->parent);
2915 xmlSchemaErr4(ACTXT_CAST ctxt, error, (xmlNodePtr) attr,
2925 * @ctxt: the schema parser context
2938 xmlSchemaPCustomErrExt(xmlSchemaParserCtxtPtr ctxt,
2955 xmlSchemaPErrExt(ctxt, itemElem, error, NULL, NULL, NULL,
2963 * @ctxt: the schema parser context
2974 xmlSchemaPCustomErr(xmlSchemaParserCtxtPtr ctxt,
2981 xmlSchemaPCustomErrExt(ctxt, error, item, itemElem, message,
2987 * @ctxt: the schema parser context
2999 xmlSchemaPAttrUseErr4(xmlSchemaParserCtxtPtr ctxt,
3019 xmlSchemaErr4(ACTXT_CAST ctxt, error, node,
3026 * @ctxt: the schema parser context
3035 xmlSchemaPIllegalFacetAtomicErr(xmlSchemaParserCtxtPtr ctxt,
3044 xmlSchemaPErrExt(ctxt, type->node, error, NULL, NULL, NULL,
3056 * @ctxt: the schema parser context
3065 xmlSchemaPIllegalFacetListUnionErr(xmlSchemaParserCtxtPtr ctxt,
3074 xmlSchemaPErr(ctxt, type->node, error,
3082 * @ctxt: the schema validation context
3091 xmlSchemaPMutualExclAttrErr(xmlSchemaParserCtxtPtr ctxt,
3101 xmlSchemaPErrExt(ctxt, (xmlNodePtr) attr, error, NULL, NULL, NULL,
3109 * @ctxt: the schema validation context
3121 xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt,
3134 xmlSchemaFormatNodeForError(&msg, ACTXT_CAST ctxt, node);
3188 xmlSchemaPErr(ctxt, node, error, (const char *) msg, value, NULL);
3190 xmlSchemaPErr(ctxt, node, error, (const char *) msg, NULL, NULL);
3194 xmlSchemaPErrExt(ctxt, node, error, NULL, NULL, NULL,
3203 * @ctxt: the schema parser context
3215 xmlSchemaPContentErr(xmlSchemaParserCtxtPtr ctxt,
3227 xmlSchemaPErr2(ctxt, ownerElem, child, error,
3232 xmlSchemaPErr2(ctxt, ownerElem, child, error,
3236 xmlSchemaPErr2(ctxt, ownerElem, child, error,
3268 * @ctxt: a schema validation context
3275 xmlSchemaNewSchema(xmlSchemaParserCtxtPtr ctxt)
3281 xmlSchemaPErrMemory(ctxt, "allocating schema", NULL);
3285 ret->dict = ctxt->dict;
3314 * @ctxt: a schema validation context
3322 xmlSchemaNewAnnot(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node)
3328 xmlSchemaPErrMemory(ctxt, "allocating annotation", node);
4705 xmlSchemaGetNodeContent(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node)
4713 ret = xmlDictLookup(ctxt->dict, val, -1);
4726 * @ctxt: the parser context
4735 xmlSchemaGetProp(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
4744 ret = xmlDictLookup(ctxt->dict, val, -1);
5151 * @ctxt: a schema parser context
5161 xmlSchemaAddNotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
5167 if ((ctxt == NULL) || (schema == NULL) || (name == NULL))
5172 xmlSchemaPErrMemory(ctxt, "add annotation", NULL);
5181 WXS_ADD_GLOBAL(ctxt, ret);
5187 * @ctxt: a schema parser context
5198 xmlSchemaAddAttribute(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
5204 if ((ctxt == NULL) || (schema == NULL))
5209 xmlSchemaPErrMemory(ctxt, "allocating attribute", NULL);
5219 WXS_ADD_GLOBAL(ctxt, ret);
5221 WXS_ADD_LOCAL(ctxt, ret);
5222 WXS_ADD_PENDING(ctxt, ret);
5228 * @ctxt: a schema parser context
5298 * @ctxt: a schema parser context
5350 * @ctxt: a schema parser context
5361 xmlSchemaAddElement(xmlSchemaParserCtxtPtr ctxt,
5367 if ((ctxt == NULL) || (name == NULL))
5372 xmlSchemaPErrMemory(ctxt, "allocating element", NULL);
5382 WXS_ADD_GLOBAL(ctxt, ret);
5384 WXS_ADD_LOCAL(ctxt, ret);
5385 WXS_ADD_PENDING(ctxt, ret);
5391 * @ctxt: a schema parser context
5402 xmlSchemaAddType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
5409 if ((ctxt == NULL) || (schema == NULL))
5414 xmlSchemaPErrMemory(ctxt, "allocating type", NULL);
5423 if (ctxt->isRedefine) {
5424 ctxt->redef = xmlSchemaAddRedef(ctxt, ctxt->redefined,
5426 if (ctxt->redef == NULL) {
5430 ctxt->redefCounter = 0;
5432 WXS_ADD_GLOBAL(ctxt, ret);
5434 WXS_ADD_LOCAL(ctxt, ret);
5435 WXS_ADD_PENDING(ctxt, ret);
5488 * @ctxt: a schema parser context
5499 xmlSchemaAddModelGroup(xmlSchemaParserCtxtPtr ctxt,
5506 if ((ctxt == NULL) || (schema == NULL))
5512 xmlSchemaPErrMemory(ctxt, "allocating model group component",
5519 WXS_ADD_LOCAL(ctxt, ret);
5522 WXS_ADD_PENDING(ctxt, ret);
5529 * @ctxt: a schema parser context
5541 xmlSchemaAddParticle(xmlSchemaParserCtxtPtr ctxt,
5545 if (ctxt == NULL)
5554 xmlSchemaPErrMemory(ctxt, "allocating particle component",
5566 WXS_ADD_LOCAL(ctxt, ret);
5571 * REMOVED: WXS_ADD_PENDING(ctxt, ret);
5578 * @ctxt: a schema validation context
5587 xmlSchemaAddModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt,
5595 if ((ctxt == NULL) || (schema == NULL) || (name == NULL))
5601 xmlSchemaPErrMemory(ctxt, "adding group", NULL);
5610 if (ctxt->isRedefine) {
5611 ctxt->redef = xmlSchemaAddRedef(ctxt, ctxt->redefined,
5613 if (ctxt->redef == NULL) {
5617 ctxt->redefCounter = 0;
5619 WXS_ADD_GLOBAL(ctxt, ret);
5620 WXS_ADD_PENDING(ctxt, ret);
5626 * @ctxt: a schema validation context
5633 xmlSchemaNewWildcardNsConstraint(xmlSchemaParserCtxtPtr ctxt)
5640 xmlSchemaPErrMemory(ctxt, "creating wildcard namespace constraint", NULL);
5649 xmlSchemaAddIDC(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
5655 if ((ctxt == NULL) || (schema == NULL) || (name == NULL))
5660 xmlSchemaPErrMemory(ctxt,
5671 WXS_ADD_GLOBAL(ctxt, ret);
5676 WXS_ADD_PENDING(ctxt, ret);
5682 * @ctxt: a schema validation context
5691 xmlSchemaAddWildcard(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
5696 if ((ctxt == NULL) || (schema == NULL))
5701 xmlSchemaPErrMemory(ctxt, "adding wildcard", NULL);
5707 WXS_ADD_LOCAL(ctxt, ret);
5814 * @ctxt: a schema parser context
5830 xmlSchemaPValAttrNodeQNameValue(xmlSchemaParserCtxtPtr ctxt,
5846 xmlSchemaPSimpleTypeErr(ctxt,
5852 return (ctxt->err);
5859 *uri = xmlDictLookup(ctxt->dict, ns->href, -1);
5867 *uri = ctxt->targetNamespace;
5869 *local = xmlDictLookup(ctxt->dict, value, -1);
5876 *local = xmlDictLookup(ctxt->dict, *local, -1);
5877 pref = xmlDictLookup(ctxt->dict, value, len);
5880 xmlSchemaPSimpleTypeErr(ctxt,
5886 return (ctxt->err);
5888 *uri = xmlDictLookup(ctxt->dict, ns->href, -1);
5895 * @ctxt: a schema parser context
5911 xmlSchemaPValAttrNodeQName(xmlSchemaParserCtxtPtr ctxt,
5920 value = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
5921 return (xmlSchemaPValAttrNodeQNameValue(ctxt, schema,
5927 * @ctxt: a schema parser context
5942 xmlSchemaPValAttrQName(xmlSchemaParserCtxtPtr ctxt,
5958 return (xmlSchemaPValAttrNodeQName(ctxt, schema,
5964 * @ctxt: a schema parser context
5977 xmlSchemaPValAttrNodeID(xmlSchemaParserCtxtPtr ctxt, xmlAttrPtr attr)
6006 xmlSchemaPSimpleTypeErr(ctxt,
6017 xmlSchemaPSimpleTypeErr(ctxt,
6032 xmlSchemaPValAttrID(xmlSchemaParserCtxtPtr ctxt,
6041 return(xmlSchemaPValAttrNodeID(ctxt, attr));
6047 * @ctxt: a schema validation context
6055 xmlGetMaxOccurs(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
6065 val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
6069 xmlSchemaPSimpleTypeErr(ctxt,
6083 xmlSchemaPSimpleTypeErr(ctxt,
6100 xmlSchemaPSimpleTypeErr(ctxt,
6112 * @ctxt: a schema validation context
6120 xmlGetMinOccurs(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
6130 val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
6135 xmlSchemaPSimpleTypeErr(ctxt,
6152 xmlSchemaPSimpleTypeErr(ctxt,
6164 * @ctxt: a schema validation context
6174 xmlSchemaPGetBoolNodeValue(xmlSchemaParserCtxtPtr ctxt,
6196 xmlSchemaPSimpleTypeErr(ctxt,
6210 * @ctxt: a schema validation context
6221 xmlGetBooleanProp(xmlSchemaParserCtxtPtr ctxt,
6227 val = xmlSchemaGetProp(ctxt, node, name);
6244 xmlSchemaPSimpleTypeErr(ctxt,
6260 ctxt, xmlSchemaPtr schema,
6264 ctxt,
6269 ctxt,
6279 static xmlSchemaTypePtr xmlSchemaParseList(xmlSchemaParserCtxtPtr ctxt,
6283 xmlSchemaParseAnyAttribute(xmlSchemaParserCtxtPtr ctxt,
6289 * @ctxt: a schema parser context
6362 * @ctxt: a schema parser context
6377 xmlSchemaPValAttrNode(xmlSchemaParserCtxtPtr ctxt,
6385 if ((ctxt == NULL) || (type == NULL) || (attr == NULL))
6388 val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
6392 return (xmlSchemaPValAttrNodeValue(ctxt, ownerItem, attr,
6399 * @ctxt: a schema parser context
6416 xmlSchemaPValAttr(xmlSchemaParserCtxtPtr ctxt,
6425 if ((ctxt == NULL) || (type == NULL)) {
6433 xmlSchemaPErr(ctxt, ownerElem,
6446 return (xmlSchemaPValAttrNode(ctxt, ownerItem, attr,
6500 * @ctxt: a schema validation context
6509 xmlSchemaParseLocalAttributes(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
6518 item = xmlSchemaParseLocalAttribute(ctxt, schema, *child,
6521 item = xmlSchemaParseAttributeGroupRef(ctxt, schema, *child);
6542 * @ctxt: a schema validation context
6553 xmlSchemaParseAnnotation(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int needed)
6568 if ((ctxt == NULL) || (node == NULL))
6571 ret = xmlSchemaNewAnnot(ctxt, node);
6581 xmlSchemaPIllegalAttrErr(ctxt,
6586 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
6606 xmlSchemaPIllegalAttrErr(ctxt,
6611 xmlSchemaPValAttr(ctxt, NULL, child, "source",
6625 xmlSchemaPIllegalAttrErr(ctxt,
6633 xmlSchemaPIllegalAttrErr(ctxt,
6644 xmlSchemaPValAttrNode(ctxt, NULL, attr,
6649 xmlSchemaPContentErr(ctxt,
6662 * @ctxt: a schema validation context
6672 xmlSchemaParseFacet(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
6679 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
6684 xmlSchemaPErrMemory(ctxt, "allocating facet", node);
6688 value = xmlSchemaGetProp(ctxt, node, "value");
6690 xmlSchemaPErr2(ctxt, node, child, XML_SCHEMAP_FACET_NO_VALUE,
6720 xmlSchemaPErr2(ctxt, node, child, XML_SCHEMAP_UNKNOWN_FACET_TYPE,
6725 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
6731 fixed = xmlSchemaGetProp(ctxt, node, "fixed");
6740 facet->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
6744 xmlSchemaPErr2(ctxt, node, child, XML_SCHEMAP_UNKNOWN_FACET_CHILD,
6753 * @ctxt: a schema parser context
6765 xmlSchemaParseWildcardNs(xmlSchemaParserCtxtPtr ctxt,
6776 pc = xmlSchemaGetProp(ctxt, node, "processContents");
6785 xmlSchemaPSimpleTypeErr(ctxt,
6797 ns = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
6801 wildc->negNsSet = xmlSchemaNewWildcardNsConstraint(ctxt);
6805 wildc->negNsSet->value = ctxt->targetNamespace;
6821 xmlSchemaPSimpleTypeErr(ctxt,
6831 dictnsItem = ctxt->targetNamespace;
6838 xmlSchemaPValAttrNodeValue(ctxt, NULL, attr,
6840 dictnsItem = xmlDictLookup(ctxt->dict, nsItem, -1);
6852 tmp = xmlSchemaNewWildcardNsConstraint(ctxt);
6875 xmlSchemaPCheckParticleCorrect_2(xmlSchemaParserCtxtPtr ctxt,
6897 xmlSchemaPCustomAttrErr(ctxt,
6907 xmlSchemaPCustomAttrErr(ctxt,
6920 * @ctxt: a schema validation context
6932 xmlSchemaParseAny(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
6942 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
6955 xmlSchemaPIllegalAttrErr(ctxt,
6959 xmlSchemaPIllegalAttrErr(ctxt,
6964 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
6968 max = xmlGetMaxOccurs(ctxt, node, 0, UNBOUNDED, 1,
6970 min = xmlGetMinOccurs(ctxt, node, 0, -1, 1,
6972 xmlSchemaPCheckParticleCorrect_2(ctxt, NULL, node, min, max);
6976 wild = xmlSchemaAddWildcard(ctxt, schema, XML_SCHEMA_TYPE_ANY, node);
6979 xmlSchemaParseWildcardNs(ctxt, schema, wild, node);
6985 annot = xmlSchemaParseAnnotation(ctxt, child, 1);
6989 xmlSchemaPContentErr(ctxt,
7004 particle = xmlSchemaAddParticle(ctxt, node, min, max);
7015 * @ctxt: a schema validation context
7024 xmlSchemaParseNotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
7031 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
7033 name = xmlSchemaGetProp(ctxt, node, "name");
7035 xmlSchemaPErr2(ctxt, node, child, XML_SCHEMAP_NOTATION_NO_NAME,
7039 ret = xmlSchemaAddNotation(ctxt, schema, name,
7040 ctxt->targetNamespace, node);
7043 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
7047 ret->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
7051 xmlSchemaPContentErr(ctxt,
7062 * @ctxt: a schema validation context
7072 xmlSchemaParseAnyAttribute(xmlSchemaParserCtxtPtr ctxt,
7079 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
7082 ret = xmlSchemaAddWildcard(ctxt, schema, XML_SCHEMA_TYPE_ANY_ATTRIBUTE,
7096 xmlSchemaPIllegalAttrErr(ctxt,
7100 xmlSchemaPIllegalAttrErr(ctxt,
7105 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
7109 if (xmlSchemaParseWildcardNs(ctxt, schema, ret, node) != 0)
7116 ret->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
7120 xmlSchemaPContentErr(ctxt,
7132 * @ctxt: a schema validation context
7675 * @ctxt: a schema validation context
8032 xmlSchemaCheckCSelectorXPath(xmlSchemaParserCtxtPtr ctxt,
8048 xmlSchemaPErr(ctxt, idc->node,
8059 xmlSchemaPCustomErr(ctxt,
8092 xmlSchemaPErrMemory(ctxt, "allocating a namespace array",
8117 ctxt,
8239 * @ctxt: a schema validation context
8249 xmlSchemaParseIDCSelectorAndField(xmlSchemaParserCtxtPtr ctxt,
8266 xmlSchemaPIllegalAttrErr(ctxt,
8270 xmlSchemaPIllegalAttrErr(ctxt,
8280 xmlSchemaPErrMemory(ctxt,
8291 xmlSchemaPMissingAttrErr(ctxt,
8296 item->xpath = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
8301 if (xmlSchemaCheckCSelectorXPath(ctxt, idc, item, attr,
8303 xmlSchemaPErr(ctxt,
8312 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
8322 xmlSchemaParseAnnotation(ctxt, child, 1));
8326 xmlSchemaPContentErr(ctxt,
8337 * @ctxt: a schema validation context
8346 xmlSchemaParseIDC(xmlSchemaParserCtxtPtr ctxt,
8368 xmlSchemaPIllegalAttrErr(ctxt,
8372 xmlSchemaPIllegalAttrErr(ctxt,
8382 xmlSchemaPMissingAttrErr(ctxt,
8387 } else if (xmlSchemaPValAttrNode(ctxt,
8393 item = xmlSchemaAddIDC(ctxt, schema, name, targetNamespace,
8398 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
8405 xmlSchemaPMissingAttrErr(ctxt,
8413 item->ref = xmlSchemaNewQNameRef(ctxt, XML_SCHEMA_TYPE_IDC_KEY,
8417 xmlSchemaPValAttrNodeQName(ctxt, schema,
8421 xmlSchemaCheckReference(ctxt, schema, node, attr,
8430 item->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
8434 xmlSchemaPContentErr(ctxt,
8444 item->selector = xmlSchemaParseIDCSelectorAndField(ctxt,
8452 field = xmlSchemaParseIDCSelectorAndField(ctxt,
8466 xmlSchemaPContentErr(ctxt,
8473 xmlSchemaPContentErr(ctxt,
8484 * @ctxt: a schema validation context
8496 xmlSchemaParseElement(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
8510 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
8524 xmlSchemaPMissingAttrErr(ctxt,
8532 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
8535 annot = xmlSchemaParseAnnotation(ctxt, child, 1);
8546 min = xmlGetMinOccurs(ctxt, node, 0, -1, 1, "xs:nonNegativeInteger");
8547 max = xmlGetMaxOccurs(ctxt, node, 0, UNBOUNDED, 1, "(xs:nonNegativeInteger | unbounded)");
8548 xmlSchemaPCheckParticleCorrect_2(ctxt, NULL, node, min, max);
8549 particle = xmlSchemaAddParticle(ctxt, node, min, max);
8564 xmlSchemaPValAttrNodeQName(ctxt, schema,
8566 xmlSchemaCheckReference(ctxt, schema, node, attr, refNs);
8571 xmlSchemaPMutualExclAttrErr(ctxt,
8590 xmlSchemaPCustomAttrErr(ctxt,
8598 xmlSchemaPIllegalAttrErr(ctxt,
8607 xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED,
8615 refer = xmlSchemaNewQNameRef(ctxt, XML_SCHEMA_TYPE_ELEMENT,
8625 WXS_ADD_PENDING(ctxt, particle);
8636 if (xmlSchemaPValAttrNode(ctxt, NULL, nameAttr,
8643 ns = ctxt->targetNamespace;
8647 attrValue = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
8649 ns = ctxt->targetNamespace;
8651 xmlSchemaPSimpleTypeErr(ctxt,
8658 ns = ctxt->targetNamespace;
8660 decl = xmlSchemaAddElement(ctxt, name, ns, node, topLevel);
8683 xmlSchemaPIllegalAttrErr(ctxt,
8690 xmlSchemaPIllegalAttrErr(ctxt,
8696 xmlSchemaPIllegalAttrErr(ctxt,
8710 xmlSchemaPValAttrQName(ctxt, schema,
8713 if (xmlGetBooleanProp(ctxt, node, "abstract", 0))
8725 attrValue = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
8730 xmlSchemaPSimpleTypeErr(ctxt,
8753 attrValue = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
8759 xmlSchemaPSimpleTypeErr(ctxt,
8767 if (xmlGetBooleanProp(ctxt, node, "nillable", 0))
8772 xmlSchemaPValAttrNodeQName(ctxt, schema,
8775 xmlSchemaCheckReference(ctxt, schema, node,
8778 decl->value = xmlSchemaGetProp(ctxt, node, "default");
8781 fixed = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
8787 xmlSchemaPMutualExclAttrErr(ctxt,
8805 xmlSchemaPContentErr(ctxt,
8811 WXS_ELEM_TYPEDEF(decl) = xmlSchemaParseComplexType(ctxt, schema, child, 0);
8820 xmlSchemaPContentErr(ctxt,
8826 WXS_ELEM_TYPEDEF(decl) = xmlSchemaParseSimpleType(ctxt, schema, child, 0);
8832 curIDC = xmlSchemaParseIDC(ctxt, schema, child,
8835 curIDC = xmlSchemaParseIDC(ctxt, schema, child,
8838 curIDC = xmlSchemaParseIDC(ctxt, schema, child,
8849 xmlSchemaPContentErr(ctxt,
8883 * @ctxt: a schema validation context
8894 xmlSchemaParseUnion(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
8902 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
8905 type = ctxt->ctxtType;
8923 xmlSchemaPIllegalAttrErr(ctxt,
8927 xmlSchemaPIllegalAttrErr(ctxt,
8932 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
8945 cur = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
8956 if (xmlSchemaPValAttrNodeQNameValue(ctxt, schema,
8964 xmlSchemaPErrMemory(ctxt, "xmlSchemaParseUnion, "
8978 ref = xmlSchemaNewQNameRef(ctxt, XML_SCHEMA_TYPE_SIMPLE,
9004 xmlSchemaParseAnnotation(ctxt, child, 1));
9016 xmlSchemaParseSimpleType(ctxt, schema, child, 0);
9031 xmlSchemaPContentErr(ctxt,
9041 xmlSchemaPCustomErr(ctxt,
9052 * @ctxt: a schema validation context
9063 xmlSchemaParseList(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
9070 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
9073 type = ctxt->ctxtType;
9091 xmlSchemaPIllegalAttrErr(ctxt,
9095 xmlSchemaPIllegalAttrErr(ctxt,
9101 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
9110 xmlSchemaPValAttrQName(ctxt, schema, NULL,
9118 xmlSchemaParseAnnotation(ctxt, child, 1));
9128 xmlSchemaPCustomErr(ctxt,
9134 type->subtypes = xmlSchemaParseSimpleType(ctxt, schema, child, 0);
9138 xmlSchemaPCustomErr(ctxt,
9145 xmlSchemaPContentErr(ctxt,
9152 xmlSchemaPCustomErr(ctxt,
9163 * @ctxt: a schema validation context
9174 xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
9183 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
9189 xmlSchemaPMissingAttrErr(ctxt,
9195 if (xmlSchemaPValAttrNode(ctxt,
9202 if (ctxt->isS4S) {
9205 if (ctxt->isRedefine) {
9211 xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_REDEFINE,
9237 snprintf(buf, 39, "#ST%d", ctxt->counter++ + 1);
9238 type = xmlSchemaAddType(ctxt, schema,
9240 xmlDictLookup(ctxt->dict, (const xmlChar *)buf, -1),
9241 ctxt->targetNamespace, node, 0);
9243 type = xmlSchemaAddType(ctxt, schema,
9245 NULL, ctxt->targetNamespace, node, 0);
9258 xmlSchemaPIllegalAttrErr(ctxt,
9262 xmlSchemaPIllegalAttrErr(ctxt,
9273 type = xmlSchemaAddType(ctxt, schema, XML_SCHEMA_TYPE_SIMPLE,
9274 attrValue, ctxt->targetNamespace, node, 1);
9289 xmlSchemaPIllegalAttrErr(ctxt,
9293 xmlSchemaPIllegalAttrErr(ctxt,
9310 attrValue = xmlSchemaGetProp(ctxt, node, "final");
9316 xmlSchemaPSimpleTypeErr(ctxt,
9324 type->targetNamespace = ctxt->targetNamespace;
9325 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
9329 oldCtxtType = ctxt->ctxtType;
9331 ctxt->ctxtType = type;
9335 type->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
9339 xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_MISSING,
9343 xmlSchemaParseRestriction(ctxt, schema, child,
9348 xmlSchemaParseList(ctxt, schema, child);
9351 xmlSchemaParseUnion(ctxt, schema, child);
9355 xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED,
9366 if (topLevel && ctxt->isRedefine && (! hasRestriction)) {
9367 xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_REDEFINE,
9372 ctxt->ctxtType = oldCtxtType;
9378 * @ctxt: the parser context
9388 xmlSchemaParseModelGroupDefRef(xmlSchemaParserCtxtPtr ctxt,
9398 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
9403 xmlSchemaPMissingAttrErr(ctxt,
9407 } else if (xmlSchemaPValAttrNodeQName(ctxt, schema, NULL,
9411 xmlSchemaCheckReference(ctxt, schema, node, attr, refNs);
9412 min = xmlGetMinOccurs(ctxt, node, 0, -1, 1, "xs:nonNegativeInteger");
9413 max = xmlGetMaxOccurs(ctxt, node, 0, UNBOUNDED, 1,
9425 xmlSchemaPIllegalAttrErr(ctxt,
9429 xmlSchemaPIllegalAttrErr(ctxt,
9434 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
9435 item = xmlSchemaAddParticle(ctxt, node, min, max);
9443 xmlSchemaNewQNameRef(ctxt, XML_SCHEMA_TYPE_GROUP, ref, refNs);
9444 xmlSchemaPCheckParticleCorrect_2(ctxt, item, node, min, max);
9454 item->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
9458 xmlSchemaPContentErr(ctxt,
9474 * @ctxt: a schema validation context
9490 xmlSchemaParseModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt,
9499 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
9504 xmlSchemaPMissingAttrErr(ctxt,
9509 } else if (xmlSchemaPValAttrNode(ctxt, NULL, attr,
9513 item = xmlSchemaAddModelGroupDefinition(ctxt, schema, name,
9514 ctxt->targetNamespace, node);
9525 xmlSchemaPIllegalAttrErr(ctxt,
9529 xmlSchemaPIllegalAttrErr(ctxt,
9534 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
9540 item->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
9544 item->children = xmlSchemaParseModelGroup(ctxt, schema, child,
9548 item->children = xmlSchemaParseModelGroup(ctxt, schema, child,
9552 item->children = xmlSchemaParseModelGroup(ctxt, schema, child,
9560 xmlSchemaPContentErr(ctxt,
9570 * @ctxt: a schema validation context
9576 xmlSchemaCleanupDoc(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr root)
9580 if ((ctxt == NULL) || (root == NULL)) return;
9671 xmlSchemaParseSchemaElement(xmlSchemaParserCtxtPtr ctxt,
9677 int res = 0, oldErrs = ctxt->nberrors;
9684 res = xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
9694 res = xmlSchemaPValAttrNode(ctxt, NULL, NULL, attr,
9701 res = xmlSchemaPValAttrNode(ctxt, NULL, attr,
9705 ctxt->stop = XML_SCHEMAP_S4S_ATTR_INVALID_VALUE;
9711 val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
9716 xmlSchemaPSimpleTypeErr(ctxt,
9724 val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
9729 xmlSchemaPSimpleTypeErr(ctxt,
9737 val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
9746 xmlSchemaPSimpleTypeErr(ctxt,
9755 val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
9762 xmlSchemaPSimpleTypeErr(ctxt,
9771 if (oldErrs != ctxt->nberrors)
9772 res = ctxt->err;
9780 * @ctxt: a schema validation context
9788 xmlSchemaParseSchemaTopLevel(xmlSchemaParserCtxtPtr ctxt,
9795 if ((ctxt == NULL) || (schema == NULL) || (nodes == NULL))
9798 oldErrs = ctxt->nberrors;
9805 annot = xmlSchemaParseAnnotation(ctxt, child, 1);
9811 tmpOldErrs = ctxt->nberrors;
9812 res = xmlSchemaParseImport(ctxt, schema, child);
9814 HSTOP(ctxt);
9815 if (tmpOldErrs != ctxt->nberrors)
9818 tmpOldErrs = ctxt->nberrors;
9819 res = xmlSchemaParseInclude(ctxt, schema, child);
9821 HSTOP(ctxt);
9822 if (tmpOldErrs != ctxt->nberrors)
9825 tmpOldErrs = ctxt->nberrors;
9826 res = xmlSchemaParseRedefine(ctxt, schema, child);
9828 HSTOP(ctxt);
9829 if (tmpOldErrs != ctxt->nberrors)
9840 xmlSchemaParseComplexType(ctxt, schema, child, 1);
9843 xmlSchemaParseSimpleType(ctxt, schema, child, 1);
9846 xmlSchemaParseElement(ctxt, schema, child, NULL, 1);
9849 xmlSchemaParseGlobalAttribute(ctxt, schema, child);
9852 xmlSchemaParseAttributeGroupDefinition(ctxt, schema, child);
9855 xmlSchemaParseModelGroupDefinition(ctxt, schema, child);
9858 xmlSchemaParseNotation(ctxt, schema, child);
9861 xmlSchemaPContentErr(ctxt,
9873 annot = xmlSchemaParseAnnotation(ctxt, child, 1);
9882 ctxt->ctxtType = NULL;
9883 if (oldErrs != ctxt->nberrors)
9884 res = ctxt->err;
10736 * @ctxt: a schema validation context
11228 * @ctxt: a schema validation context
11252 xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
11262 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
11267 item = xmlSchemaAddModelGroup(ctxt, schema, type, node);
11273 min = xmlGetMinOccurs(ctxt, node, 0, 1, 1, "(0 | 1)");
11274 max = xmlGetMaxOccurs(ctxt, node, 1, 1, 1, "1");
11277 min = xmlGetMinOccurs(ctxt, node, 0, -1, 1, "xs:nonNegativeInteger");
11278 max = xmlGetMaxOccurs(ctxt, node, 0, UNBOUNDED, 1,
11281 xmlSchemaPCheckParticleCorrect_2(ctxt, NULL, node, min, max);
11285 particle = xmlSchemaAddParticle(ctxt, node, min, max);
11298 xmlSchemaPIllegalAttrErr(ctxt,
11302 xmlSchemaPIllegalAttrErr(ctxt,
11315 xmlSchemaPIllegalAttrErr(ctxt,
11319 xmlSchemaPIllegalAttrErr(ctxt,
11329 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
11335 item->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
11342 part = (xmlSchemaParticlePtr) xmlSchemaParseElement(ctxt,
11353 xmlSchemaPCustomErr(ctxt,
11362 xmlSchemaPCustomErr(ctxt,
11379 xmlSchemaPContentErr(ctxt,
11396 xmlSchemaParseElement(ctxt, schema, child, &isElemRef, 0);
11401 xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
11407 if (ctxt->isRedefine && ctxt->redef &&
11408 (ctxt->redef->item->type == XML_SCHEMA_TYPE_GROUP) &&
11412 ctxt->redef->refName) &&
11414 ctxt->redef->refTargetNs))
11425 if (ctxt->redefCounter != 0) {
11428 xmlSchemaCustomErr(ACTXT_CAST ctxt,
11434 ctxt->redef->refTargetNs,
11435 ctxt->redef->refName),
11449 xmlSchemaCustomErr(ACTXT_CAST ctxt,
11456 ctxt->redef->refTargetNs,
11457 ctxt->redef->refName),
11462 ctxt->redef->reference = WXS_BASIC_CAST part;
11463 ctxt->redefCounter++;
11468 xmlSchemaParseAny(ctxt, schema, child);
11470 part = xmlSchemaParseModelGroup(ctxt, schema, child,
11473 part = xmlSchemaParseModelGroup(ctxt, schema, child,
11486 xmlSchemaPContentErr(ctxt,
11498 WXS_ADD_PENDING(ctxt, item);
11508 * @ctxt: a schema validation context
11518 xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
11525 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
11528 type = ctxt->ctxtType;
11539 xmlSchemaPIllegalAttrErr(ctxt,
11543 xmlSchemaPIllegalAttrErr(ctxt,
11551 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
11564 if (xmlSchemaPValAttrQName(ctxt, schema, NULL, node, "base",
11568 xmlSchemaPMissingAttrErr(ctxt,
11571 } else if ((ctxt->isRedefine) &&
11575 xmlSchemaPMissingAttrErr(ctxt,
11589 xmlSchemaPCustomErrExt(ctxt, XML_SCHEMAP_SRC_REDEFINE,
11613 xmlSchemaParseAnnotation(ctxt, child, 1));
11627 xmlSchemaPContentErr(ctxt,
11634 xmlSchemaParseSimpleType(ctxt, schema, child, 0);
11638 xmlSchemaPContentErr(ctxt,
11653 xmlSchemaParseModelGroup(ctxt, schema, child,
11658 xmlSchemaParseModelGroup(ctxt,
11663 xmlSchemaParseModelGroup(ctxt, schema, child,
11671 xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
11691 xmlSchemaParseSimpleType(ctxt, schema, child, 0);
11726 facet = xmlSchemaParseFacet(ctxt, schema, child);
11748 xmlSchemaPErrMemory(ctxt, "allocating a facet link", NULL);
11767 if (xmlSchemaParseLocalAttributes(ctxt, schema, &child,
11776 xmlSchemaParseAnyAttribute(ctxt, schema, child);
11782 xmlSchemaPContentErr(ctxt,
11788 xmlSchemaPContentErr(ctxt,
11797 xmlSchemaPContentErr(ctxt,
11811 * @ctxt: a schema validation context
11822 xmlSchemaParseExtension(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
11829 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
11832 type = ctxt->ctxtType;
11843 xmlSchemaPIllegalAttrErr(ctxt,
11847 xmlSchemaPIllegalAttrErr(ctxt,
11853 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
11858 if ((xmlSchemaPValAttrQName(ctxt, schema, NULL, node,
11861 xmlSchemaPMissingAttrErr(ctxt,
11874 xmlSchemaParseAnnotation(ctxt, child, 1));
11885 xmlSchemaParseModelGroup(ctxt, schema,
11890 xmlSchemaParseModelGroup(ctxt, schema,
11895 xmlSchemaParseModelGroup(ctxt, schema,
11900 xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
11912 if (xmlSchemaParseLocalAttributes(ctxt, schema, &child,
11920 ctxt->ctxtType->attributeWildcard =
11921 xmlSchemaParseAnyAttribute(ctxt, schema, child);
11928 xmlSchemaPContentErr(ctxt,
11935 xmlSchemaPContentErr(ctxt,
11947 * @ctxt: a schema validation context
11957 xmlSchemaParseSimpleContent(xmlSchemaParserCtxtPtr ctxt,
11965 if ((ctxt == NULL) || (schema == NULL) || (node == NULL) ||
11970 type = ctxt->ctxtType;
11979 xmlSchemaPIllegalAttrErr(ctxt,
11983 xmlSchemaPIllegalAttrErr(ctxt,
11989 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
12000 xmlSchemaParseAnnotation(ctxt, child, 1));
12004 xmlSchemaPContentErr(ctxt,
12010 xmlSchemaPContentErr(ctxt,
12016 xmlSchemaParseRestriction(ctxt, schema, child,
12021 xmlSchemaParseExtension(ctxt, schema, child,
12027 xmlSchemaPContentErr(ctxt,
12037 * @ctxt: a schema validation context
12047 xmlSchemaParseComplexContent(xmlSchemaParserCtxtPtr ctxt,
12055 if ((ctxt == NULL) || (schema == NULL) || (node == NULL) ||
12060 type = ctxt->ctxtType;
12070 xmlSchemaPIllegalAttrErr(ctxt,
12074 xmlSchemaPIllegalAttrErr(ctxt,
12080 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
12085 if (xmlGetBooleanProp(ctxt, node, "mixed", 0)) {
12095 xmlSchemaParseAnnotation(ctxt, child, 1));
12099 xmlSchemaPContentErr(ctxt,
12105 xmlSchemaPContentErr(ctxt,
12111 xmlSchemaParseRestriction(ctxt, schema, child,
12116 xmlSchemaParseExtension(ctxt, schema, child,
12122 xmlSchemaPContentErr(ctxt,
12132 * @ctxt: a schema validation context
12142 xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
12156 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
12159 ctxtType = ctxt->ctxtType;
12164 xmlSchemaPMissingAttrErr(ctxt,
12167 } else if (xmlSchemaPValAttrNode(ctxt, NULL, attr,
12178 snprintf(buf, 39, "#CT%d", ctxt->counter++ + 1);
12179 type = xmlSchemaAddType(ctxt, schema,
12181 xmlDictLookup(ctxt->dict, (const xmlChar *)buf, -1),
12182 ctxt->targetNamespace, node, 0);
12184 type = xmlSchemaAddType(ctxt, schema,
12186 NULL, ctxt->targetNamespace, node, 0);
12200 type = xmlSchemaAddType(ctxt, schema,
12202 name, ctxt->targetNamespace, node, 1);
12209 type->targetNamespace = ctxt->targetNamespace;
12220 xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
12225 if (xmlSchemaPGetBoolNodeValue(ctxt,
12238 if (xmlSchemaPGetBoolNodeValue(ctxt,
12245 attrValue = xmlSchemaGetNodeContent(ctxt,
12254 xmlSchemaPSimpleTypeErr(ctxt,
12265 attrValue = xmlSchemaGetNodeContent(ctxt,
12272 xmlSchemaPSimpleTypeErr(ctxt,
12280 xmlSchemaPIllegalAttrErr(ctxt,
12284 xmlSchemaPIllegalAttrErr(ctxt,
12288 xmlSchemaPIllegalAttrErr(ctxt,
12316 type->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
12319 ctxt->ctxtType = type;
12329 xmlSchemaParseSimpleContent(ctxt, schema, child,
12337 xmlSchemaParseComplexContent(ctxt, schema, child,
12357 xmlSchemaParseModelGroup(ctxt, schema, child,
12362 xmlSchemaParseModelGroup(ctxt, schema, child,
12367 xmlSchemaParseModelGroup(ctxt, schema, child,
12372 xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
12382 if (xmlSchemaParseLocalAttributes(ctxt, schema, &child,
12390 type->attributeWildcard = xmlSchemaParseAnyAttribute(ctxt, schema, child);
12395 xmlSchemaPContentErr(ctxt,
12405 if (topLevel && ctxt->isRedefine && (! hasRestrictionOrExtension)) {
12406 xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_REDEFINE,
12411 ctxt->ctxtType = ctxtType;
12430 * @ctxt: a schema parser context
12439 xmlSchemaParserCtxtSetOptions(xmlSchemaParserCtxtPtr ctxt,
12445 if (ctxt == NULL)
12456 ctxt->options = options;
12462 * @ctxt: a schema parser context
12467 xmlSchemaParserCtxtGetOptions(xmlSchemaParserCtxtPtr ctxt)
12470 if (ctxt == NULL)
12473 return (ctxt->options);
12557 * @ctxt: the schema parser context
12562 xmlSchemaFreeParserCtxt(xmlSchemaParserCtxtPtr ctxt)
12564 if (ctxt == NULL)
12566 if (ctxt->doc != NULL && !ctxt->preserve)
12567 xmlFreeDoc(ctxt->doc);
12568 if (ctxt->vctxt != NULL) {
12569 xmlSchemaFreeValidCtxt(ctxt->vctxt);
12571 if (ctxt->ownsConstructor && (ctxt->constructor != NULL)) {
12572 xmlSchemaConstructionCtxtFree(ctxt->constructor);
12573 ctxt->constructor = NULL;
12574 ctxt->ownsConstructor = 0;
12576 if (ctxt->attrProhibs != NULL)
12577 xmlSchemaItemListFree(ctxt->attrProhibs);
12578 xmlDictFree(ctxt->dict);
12579 xmlFree(ctxt);
12711 xmlSchemaBuildContentModelForElement(xmlSchemaParserCtxtPtr ctxt,
12721 ret = xmlSchemaBuildContentModelForSubstGroup(ctxt, particle, -1, NULL);
12731 start = ctxt->state;
12732 ctxt->state = xmlAutomataNewTransition2(ctxt->am, start, NULL,
12737 start = ctxt->state;
12738 ctxt->state = xmlAutomataNewTransition2(ctxt->am, start, NULL,
12740 ctxt->state = xmlAutomataNewTransition2(ctxt->am, ctxt->state, ctxt->state,
12749 start = xmlAutomataNewEpsilon(ctxt->am, ctxt->state, NULL);
12750 counter = xmlAutomataNewCounter(ctxt->am, minOccurs, maxOccurs);
12751 ctxt->state = xmlAutomataNewTransition2(ctxt->am, start, NULL,
12753 xmlAutomataNewCountedTrans(ctxt->am, ctxt->state, start, counter);
12754 ctxt->state = xmlAutomataNewCounterTrans(ctxt->am, ctxt->state,
12758 xmlAutomataNewEpsilon(ctxt->am, start, ctxt->state);
12767 * @ctxt: the schema parser context
13176 * @ctxt: the schema parser context
13184 xmlSchemaParserCtxtPtr ctxt)
13196 ctxt->am = NULL;
13197 ctxt->am = xmlNewAutomata();
13198 if (ctxt->am == NULL) {
13203 ctxt->state = xmlAutomataGetInitState(ctxt->am);
13207 xmlSchemaBuildAContentModel(ctxt, WXS_TYPE_PARTICLE(type));
13208 xmlAutomataSetFinalState(ctxt->am, ctxt->state);
13209 type->contModel = xmlAutomataCompile(ctxt->am);
13211 xmlSchemaPCustomErr(ctxt,
13216 xmlSchemaPCustomErr(ctxt,
13228 ctxt->state = NULL;
13229 xmlFreeAutomata(ctxt->am);
13230 ctxt->am = NULL;
13236 * @ctxt: the schema parser context
13244 xmlSchemaParserCtxtPtr ctxt)
13246 if ((ctxt == NULL) || (elemDecl == NULL) ||
13258 type = xmlSchemaGetType(ctxt->schema, elemDecl->namedType,
13261 xmlSchemaPResCompAttrErr(ctxt,
13276 substHead = xmlSchemaGetElem(ctxt->schema, elemDecl->substGroup,
13279 xmlSchemaPResCompAttrErr(ctxt,
13285 xmlSchemaResolveElementReferences(substHead, ctxt);
13313 * @ctxt: the schema parser context
13323 xmlSchemaResolveUnionMemberTypes(xmlSchemaParserCtxtPtr ctxt,
13348 memberType = xmlSchemaGetType(ctxt->schema, name, nsName);
13350 xmlSchemaPResCompAttrErr(ctxt, XML_SCHEMAP_SRC_RESOLVE,
13376 xmlSchemaPErrMemory(ctxt, "allocating a type link", NULL);
13393 * @ctxt: the schema parser context
13422 * @ctxt: the schema parser context
13510 * @ctxt: the schema parser context
13519 xmlSchemaCloneWildcardNsConstraints(xmlSchemaParserCtxtPtr ctxt,
13531 tmp = xmlSchemaNewWildcardNsConstraint(ctxt);
13545 dest->negNsSet = xmlSchemaNewWildcardNsConstraint(ctxt);
13556 * @ctxt: the schema parser context
13566 xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
13648 tmp = xmlSchemaNewWildcardNsConstraint(ctxt);
13726 completeWild->negNsSet = xmlSchemaNewWildcardNsConstraint(ctxt);
13736 xmlSchemaPErr(ctxt, completeWild->node,
13752 completeWild->negNsSet = xmlSchemaNewWildcardNsConstraint(ctxt);
13803 completeWild->negNsSet = xmlSchemaNewWildcardNsConstraint(ctxt);
13816 * @ctxt: the schema parser context
13826 xmlSchemaIntersectWildcards(xmlSchemaParserCtxtPtr ctxt,
13874 if (xmlSchemaCloneWildcardNsConstraints(ctxt, completeWild, curWild) == -1)
13890 if (xmlSchemaCloneWildcardNsConstraints(ctxt, completeWild, curWild) == -1)
13974 xmlSchemaPErr(ctxt, completeWild->node, XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE,
13994 * @ctxt: the schema parser context
14439 * @ctxt: the schema parser context
14973 * @ctxt: the parser context
14980 xmlSchemaParserCtxtPtr ctxt)
14986 xmlSchemaCheckTypeDefCircularInternal(ctxt, item,
15055 * @ctxt: the parser context
15062 xmlSchemaParserCtxtPtr ctxt)
15071 typeDef->baseType = xmlSchemaGetType(ctxt->schema,
15074 xmlSchemaPResCompAttrErr(ctxt,
15087 xmlSchemaResolveUnionMemberTypes(ctxt, typeDef);
15095 typeDef->subtypes = xmlSchemaGetType(ctxt->schema,
15102 xmlSchemaPResCompAttrErr(ctxt,
15136 WXS_MODEL_GROUPDEF_CAST xmlSchemaGetNamedComponent(ctxt->schema,
15139 xmlSchemaPResCompAttrErr(ctxt, XML_SCHEMAP_SRC_RESOLVE,
15163 xmlSchemaCustomErr(ACTXT_CAST ctxt,
15180 * @ctxt: the schema parser context
15190 xmlSchemaCheckSTPropsCorrect(xmlSchemaParserCtxtPtr ctxt,
15212 xmlSchemaPCustomErr(ctxt,
15220 xmlSchemaPCustomErr(ctxt,
15232 xmlSchemaPCustomErr(ctxt,
15246 xmlSchemaPCustomErr(ctxt,
15259 xmlSchemaPCustomErr(ctxt,
15282 * @ctxt: the schema parser context
15750 * @ctxt: the schema parser context
15761 xmlSchemaCheckSRCSimpleType(xmlSchemaParserCtxtPtr ctxt,
15796 xmlSchemaCreateVCtxtOnPCtxt(xmlSchemaParserCtxtPtr ctxt)
15798 if (ctxt->vctxt == NULL) {
15799 ctxt->vctxt = xmlSchemaNewValidCtxt(NULL);
15800 if (ctxt->vctxt == NULL) {
15801 xmlSchemaPErr(ctxt, NULL,
15809 xmlSchemaSetValidErrors(ctxt->vctxt,
15810 ctxt->error, ctxt->warning, ctxt->errCtxt);
15811 xmlSchemaSetValidStructuredErrors(ctxt->vctxt,
15812 ctxt->serror, ctxt->errCtxt);
15910 * @ctxt: the schema parser context
16055 * @ctxt: the schema parser context
16153 * @ctxt: the schema parser context
16169 xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt,
16187 xmlSchemaPCustomErr(ctxt,
16239 xmlSchemaCustomErr(ACTXT_CAST ctxt,
16322 xmlSchemaPCustomErr(ctxt,
16348 xmlSchemaPCustomErr(ctxt,
16382 xmlSchemaPCustomErr(ctxt,
16394 xmlSchemaPCustomErr(ctxt,
16407 * @ctxt: the schema parser context
16426 xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
16437 xmlSchemaCustomErr(ACTXT_CAST ctxt,
16441 return(ctxt->err);
16448 xmlSchemaCustomErr(ACTXT_CAST ctxt,
16453 return (ctxt->err);
16461 if (xmlSchemaCheckDerivationOKRestriction2to4(ctxt,
16501 err = xmlSchemaCheckCOSSTDerivedOK(ACTXT_CAST ctxt,
16508 xmlSchemaCustomErr(ACTXT_CAST ctxt,
16519 return(ctxt->err);
16531 xmlSchemaPCustomErr(ctxt,
16536 return (ctxt->err);
16560 xmlSchemaPCustomErr(ctxt,
16566 return (ctxt->err);
16580 xmlSchemaPCustomErr(ctxt,
16585 return (ctxt->err);
16596 xmlSchemaPCustomErr(ctxt,
16600 return (ctxt->err);
16607 * @ctxt: the schema parser context
16616 xmlSchemaCheckCTComponent(xmlSchemaParserCtxtPtr ctxt,
16623 ret = xmlSchemaCheckCTPropsCorrect(ctxt, type);
16627 ret = xmlSchemaCheckCOSCTExtends(ctxt, type);
16629 ret = xmlSchemaCheckDerivationOKRestriction(ctxt, type);
16635 * @ctxt: the schema parser context
16646 xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt,
16665 xmlSchemaPCustomErr(ctxt,
16691 xmlSchemaPCustomErr(ctxt,
16712 xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_INTERNAL,
16743 xmlSchemaPCustomErr(ctxt,
16761 xmlSchemaPCustomErr(ctxt,
16771 xmlSchemaPCustomErr(ctxt,
16802 * @ctxt: the schema parser context
16828 * @ctxt: the schema parser context
16845 xmlSchemaCheckRCaseNameAndTypeOK(xmlSchemaParserCtxtPtr ctxt,
16926 if (xmlSchemaCheckCOSDerivedOK(ACTXT_CAST ctxt, elemR->subtypes,
16935 * @ctxt: the schema parser context
16950 xmlSchemaCheckRCaseNSCompat(xmlSchemaParserCtxtPtr ctxt,
16979 * @ctxt: the schema parser context
16994 xmlSchemaCheckRCaseRecurseAsIfGroup(xmlSchemaParserCtxtPtr ctxt,
17005 * @ctxt: the schema parser context
17020 xmlSchemaCheckRCaseNSSubset(xmlSchemaParserCtxtPtr ctxt,
17057 * @ctxt: the schema parser context
17070 xmlSchemaCheckCOSParticleRestrict(xmlSchemaParserCtxtPtr ctxt,
17095 * @ctxt: the schema parser context
17111 xmlSchemaCheckRCaseNSRecurseCheckCardinality(xmlSchemaParserCtxtPtr ctxt,
17129 if (xmlSchemaCheckCOSParticleRestrict(ctxt, part, b))
17149 * @ctxt: the schema parser context
17166 xmlSchemaCheckRCaseRecurse(xmlSchemaParserCtxtPtr ctxt,
18147 * xmlSchemaPErr(ctxt, type->node,
18631 * @ctxt: the schema parser context
18872 * @ctxt: the schema parser context
18973 * @ctxt: the parser context
18980 xmlSchemaParserCtxtPtr ctxt)
19005 xmlSchemaPCustomErr(ctxt,
19023 * @ctxt: the parser context
19037 xmlSchemaParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
19123 * @ctxt: the parser context
19130 xmlSchemaParserCtxtPtr ctxt)
19160 xmlSchemaPCustomErr(ctxt,
19172 return(ctxt->err);
19484 * @ctxt: the schema parser context
19491 xmlSchemaParserCtxtPtr ctxt)
19497 group = xmlSchemaGetAttributeGroup(ctxt->schema,
19501 xmlSchemaPResCompAttrErr(ctxt,
19506 return(ctxt->err);
19515 * @ctxt: a schema parser context
19614 * @ctxt: a schema parser context
19789 * @ctxt: a schema parser context
19807 xmlSchemaCheckElemSubstGroup(xmlSchemaParserCtxtPtr ctxt,
19898 xmlSchemaAddElementSubstitutionMember(ctxt, head, elemDecl);
20025 * @ctxt: a schema parser context
20033 xmlSchemaParserCtxtPtr ctxt)
20040 if (xmlSchemaCheckElemPropsCorrect(ctxt, elemDecl) == 0) {
20044 xmlSchemaCheckElemSubstGroup(ctxt, elemDecl);
20051 * @ctxt: a parser context
20058 xmlSchemaParserCtxtPtr ctxt,
20082 refItem = xmlSchemaGetNamedComponent(ctxt->schema,
20085 xmlSchemaPResCompAttrErr(ctxt, XML_SCHEMAP_SRC_RESOLVE,
20114 xmlSchemaCustomErr(ACTXT_CAST ctxt,
20200 * @ctxt: a parser context
20206 xmlSchemaParserCtxtPtr ctxt)
20208 if ((ctxt == NULL) || (ause == NULL))
20221 ause->attrDecl = xmlSchemaGetAttributeDecl(ctxt->schema,
20224 xmlSchemaPResCompAttrErr(ctxt,
20229 return(ctxt->err);;
20237 * @ctxt: a parser context
20245 xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt,
20248 if ((ctxt == NULL) || (use == NULL))
20266 xmlSchemaPCustomErr(ctxt,
20273 return(ctxt->err);
20290 xmlSchemaCustomErr(ACTXT_CAST ctxt,
20296 return(ctxt->err);
20299 ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST ctxt,
20309 xmlSchemaCustomErr(ACTXT_CAST ctxt,
20314 return(ctxt->err);
20330 xmlSchemaPCustomErr(ctxt,
20338 return(ctxt->err);
20349 * @ctxt: a parser context
20355 xmlSchemaParserCtxtPtr ctxt)
20371 type = xmlSchemaGetType(ctxt->schema, item->typeName,
20374 xmlSchemaPResCompAttrErr(ctxt,
20379 return(ctxt->err);
20395 * @ctxt: the schema parser context
21324 * @ctxt: a schema validation context
21333 xmlSchemaParse(xmlSchemaParserCtxtPtr ctxt)
21346 if (ctxt == NULL)
21350 ctxt->nberrors = 0;
21351 ctxt->err = 0;
21352 ctxt->counter = 0;
21355 mainSchema = xmlSchemaNewSchema(ctxt);
21361 if (ctxt->constructor == NULL) {
21362 ctxt->constructor = xmlSchemaConstructionCtxtCreate(ctxt->dict);
21363 if (ctxt->constructor == NULL)
21366 ctxt->ownsConstructor = 1;
21368 ctxt->constructor->mainSchema = mainSchema;
21372 res = xmlSchemaAddSchemaDoc(ctxt, XML_SCHEMA_SCHEMA_MAIN,
21373 ctxt->URL, ctxt->doc, ctxt->buffer, ctxt->size, NULL,
21382 if (ctxt->URL)
21383 xmlSchemaCustomErr(ACTXT_CAST ctxt, XML_SCHEMAP_FAILED_LOAD,
21386 ctxt->URL, NULL);
21388 xmlSchemaCustomErr(ACTXT_CAST ctxt, XML_SCHEMAP_FAILED_LOAD,
21395 if (xmlSchemaParseNewDocWithContext(ctxt, mainSchema, bucket) == -1)
21397 if (ctxt->nberrors != 0)
21401 mainSchema->preserve = ctxt->preserve;
21403 ctxt->schema = mainSchema;
21405 if (xmlSchemaFixupComponents(ctxt, WXS_CONSTRUCTOR(ctxt)->mainBucket) == -1)
21413 if (ctxt->nberrors != 0) {
21418 if (ctxt->constructor) {
21419 xmlSchemaConstructionCtxtFree(ctxt->constructor);
21420 ctxt->constructor = NULL;
21421 ctxt->ownsConstructor = 0;
21424 ctxt->schema = NULL;
21435 if (ctxt->constructor) {
21436 xmlSchemaConstructionCtxtFree(ctxt->constructor);
21437 ctxt->constructor = NULL;
21438 ctxt->ownsConstructor = 0;
21442 ctxt->schema = NULL;
21448 * @ctxt: a schema validation context
21456 xmlSchemaSetParserErrors(xmlSchemaParserCtxtPtr ctxt,
21460 if (ctxt == NULL)
21462 ctxt->error = err;
21463 ctxt->warning = warn;
21464 ctxt->errCtxt = ctx;
21465 if (ctxt->vctxt != NULL)
21466 xmlSchemaSetValidErrors(ctxt->vctxt, err, warn, ctx);
21471 * @ctxt: a schema parser context
21478 xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt,
21482 if (ctxt == NULL)
21484 ctxt->serror = serror;
21485 ctxt->errCtxt = ctx;
21486 if (ctxt->vctxt != NULL)
21487 xmlSchemaSetValidStructuredErrors(ctxt->vctxt, serror, ctx);
21492 * @ctxt: a XMl-Schema parser context
21502 xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt,
21506 if (ctxt == NULL)
21509 *err = ctxt->error;
21511 *warn = ctxt->warning;
21513 *ctx = ctxt->errCtxt;
27700 * @ctxt: the schema validation context
27705 xmlSchemaFreeValidCtxt(xmlSchemaValidCtxtPtr ctxt)
27707 if (ctxt == NULL)
27709 if (ctxt->value != NULL)
27710 xmlSchemaFreeValue(ctxt->value);
27711 if (ctxt->pctxt != NULL)
27712 xmlSchemaFreeParserCtxt(ctxt->pctxt);
27713 if (ctxt->idcNodes != NULL) {
27717 for (i = 0; i < ctxt->nbIdcNodes; i++) {
27718 item = ctxt->idcNodes[i];
27722 xmlFree(ctxt->idcNodes);
27724 if (ctxt->idcKeys != NULL) {
27726 for (i = 0; i < ctxt->nbIdcKeys; i++)
27727 xmlSchemaIDCFreeKey(ctxt->idcKeys[i]);
27728 xmlFree(ctxt->idcKeys);
27731 if (ctxt->xpathStates != NULL) {
27732 xmlSchemaFreeIDCStateObjList(ctxt->xpathStates);
27733 ctxt->xpathStates = NULL;
27735 if (ctxt->xpathStatePool != NULL) {
27736 xmlSchemaFreeIDCStateObjList(ctxt->xpathStatePool);
27737 ctxt->xpathStatePool = NULL;
27743 if (ctxt->aidcs != NULL) {
27744 xmlSchemaIDCAugPtr cur = ctxt->aidcs, next;
27751 if (ctxt->attrInfos != NULL) {
27756 if (ctxt->nbAttrInfos != 0)
27757 xmlSchemaClearAttrInfos(ctxt);
27758 for (i = 0; i < ctxt->sizeAttrInfos; i++) {
27759 attr = ctxt->attrInfos[i];
27762 xmlFree(ctxt->attrInfos);
27764 if (ctxt->elemInfos != NULL) {
27768 for (i = 0; i < ctxt->sizeElemInfos; i++) {
27769 ei = ctxt->elemInfos[i];
27772 xmlSchemaClearElemInfo(ctxt, ei);
27775 xmlFree(ctxt->elemInfos);
27777 if (ctxt->nodeQNames != NULL)
27778 xmlSchemaItemListFree(ctxt->nodeQNames);
27779 if (ctxt->dict != NULL)
27780 xmlDictFree(ctxt->dict);
27781 if (ctxt->filename != NULL)
27782 xmlFree(ctxt->filename);
27783 xmlFree(ctxt);
27788 * @ctxt: the schema validation context
27796 xmlSchemaIsValid(xmlSchemaValidCtxtPtr ctxt)
27798 if (ctxt == NULL)
27800 return(ctxt->err == 0);
27805 * @ctxt: a schema validation context
27813 xmlSchemaSetValidErrors(xmlSchemaValidCtxtPtr ctxt,
27817 if (ctxt == NULL)
27819 ctxt->error = err;
27820 ctxt->warning = warn;
27821 ctxt->errCtxt = ctx;
27822 if (ctxt->pctxt != NULL)
27823 xmlSchemaSetParserErrors(ctxt->pctxt, err, warn, ctx);
27828 * @ctxt: a schema validation context
27835 xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt,
27838 if (ctxt == NULL)
27840 ctxt->serror = serror;
27841 ctxt->error = NULL;
27842 ctxt->warning = NULL;
27843 ctxt->errCtxt = ctx;
27844 if (ctxt->pctxt != NULL)
27845 xmlSchemaSetParserStructuredErrors(ctxt->pctxt, serror, ctx);
27850 * @ctxt: a XML-Schema validation context
27860 xmlSchemaGetValidErrors(xmlSchemaValidCtxtPtr ctxt,
27864 if (ctxt == NULL)
27867 *err = ctxt->error;
27869 *warn = ctxt->warning;
27871 *ctx = ctxt->errCtxt;
27878 * @ctxt: a schema validation context
27887 xmlSchemaSetValidOptions(xmlSchemaValidCtxtPtr ctxt,
27893 if (ctxt == NULL)
27905 ctxt->options = options;
27911 * @ctxt: a schema validation context
27918 xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt)
27921 if (ctxt == NULL)
27924 return (ctxt->options);
28208 * @ctxt: a schema validation context
28217 xmlSchemaValidateOneElement(xmlSchemaValidCtxtPtr ctxt, xmlNodePtr elem)
28219 if ((ctxt == NULL) || (elem == NULL) || (elem->type != XML_ELEMENT_NODE))
28222 if (ctxt->schema == NULL)
28225 ctxt->doc = elem->doc;
28226 ctxt->node = elem;
28227 ctxt->validationRoot = elem;
28228 return(xmlSchemaVStart(ctxt));
28233 * @ctxt: a schema validation context
28242 xmlSchemaValidateDoc(xmlSchemaValidCtxtPtr ctxt, xmlDocPtr doc)
28244 if ((ctxt == NULL) || (doc == NULL))
28247 ctxt->doc = doc;
28248 ctxt->node = xmlDocGetRootElement(doc);
28249 if (ctxt->node == NULL) {
28250 xmlSchemaCustomErr(ACTXT_CAST ctxt,
28254 return (ctxt->err);
28256 ctxt->validationRoot = ctxt->node;
28257 return (xmlSchemaVStart(ctxt));
28272 xmlSchemaValidCtxtPtr ctxt;
28289 xmlSchemaValidCtxtPtr ctxt;
28297 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28298 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28299 (ctxt->user_sax->internalSubset != NULL))
28300 ctxt->user_sax->internalSubset(ctxt->user_data, name, ExternalID,
28307 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28308 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28309 (ctxt->user_sax->isStandalone != NULL))
28310 return(ctxt->user_sax->isStandalone(ctxt->user_data));
28317 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28318 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28319 (ctxt->user_sax->hasInternalSubset != NULL))
28320 return(ctxt->user_sax->hasInternalSubset(ctxt->user_data));
28327 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28328 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28329 (ctxt->user_sax->hasExternalSubset != NULL))
28330 return(ctxt->user_sax->hasExternalSubset(ctxt->user_data));
28338 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28339 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28340 (ctxt->user_sax->externalSubset != NULL))
28341 ctxt->user_sax->externalSubset(ctxt->user_data, name, ExternalID,
28348 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28349 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28350 (ctxt->user_sax->resolveEntity != NULL))
28351 return(ctxt->user_sax->resolveEntity(ctxt->user_data, publicId,
28359 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28360 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28361 (ctxt->user_sax->getEntity != NULL))
28362 return(ctxt->user_sax->getEntity(ctxt->user_data, name));
28369 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28370 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28371 (ctxt->user_sax->getParameterEntity != NULL))
28372 return(ctxt->user_sax->getParameterEntity(ctxt->user_data, name));
28381 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28382 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28383 (ctxt->user_sax->entityDecl != NULL))
28384 ctxt->user_sax->entityDecl(ctxt->user_data, name, type, publicId,
28393 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28394 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28395 (ctxt->user_sax->attributeDecl != NULL)) {
28396 ctxt->user_sax->attributeDecl(ctxt->user_data, elem, name, type,
28407 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28408 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28409 (ctxt->user_sax->elementDecl != NULL))
28410 ctxt->user_sax->elementDecl(ctxt->user_data, name, type, content);
28417 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28418 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28419 (ctxt->user_sax->notationDecl != NULL))
28420 ctxt->user_sax->notationDecl(ctxt->user_data, name, publicId,
28429 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28430 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28431 (ctxt->user_sax->unparsedEntityDecl != NULL))
28432 ctxt->user_sax->unparsedEntityDecl(ctxt->user_data, name, publicId,
28439 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28440 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28441 (ctxt->user_sax->setDocumentLocator != NULL))
28442 ctxt->user_sax->setDocumentLocator(ctxt->user_data, loc);
28448 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28449 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28450 (ctxt->user_sax->startDocument != NULL))
28451 ctxt->user_sax->startDocument(ctxt->user_data);
28457 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28458 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28459 (ctxt->user_sax->endDocument != NULL))
28460 ctxt->user_sax->endDocument(ctxt->user_data);
28467 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28468 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28469 (ctxt->user_sax->processingInstruction != NULL))
28470 ctxt->user_sax->processingInstruction(ctxt->user_data, target, data);
28476 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28477 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28478 (ctxt->user_sax->comment != NULL))
28479 ctxt->user_sax->comment(ctxt->user_data, value);
28488 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28489 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28490 (ctxt->user_sax->warning != NULL)) {
28496 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28497 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28498 (ctxt->user_sax->error != NULL)) {
28504 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28505 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28506 (ctxt->user_sax->fatalError != NULL)) {
28518 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28519 if (ctxt == NULL)
28521 if ((ctxt->user_sax != NULL) && (ctxt->user_sax->characters != NULL))
28522 ctxt->user_sax->characters(ctxt->user_data, ch, len);
28523 if (ctxt->ctxt != NULL)
28524 xmlSchemaSAXHandleText(ctxt->ctxt, ch, len);
28530 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28531 if (ctxt == NULL)
28533 if ((ctxt->user_sax != NULL) &&
28534 (ctxt->user_sax->ignorableWhitespace != NULL))
28535 ctxt->user_sax->ignorableWhitespace(ctxt->user_data, ch, len);
28536 if (ctxt->ctxt != NULL)
28537 xmlSchemaSAXHandleText(ctxt->ctxt, ch, len);
28543 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28544 if (ctxt == NULL)
28546 if ((ctxt->user_sax != NULL) &&
28547 (ctxt->user_sax->cdataBlock != NULL))
28548 ctxt->user_sax->cdataBlock(ctxt->user_data, value, len);
28549 if (ctxt->ctxt != NULL)
28550 xmlSchemaSAXHandleCDataSection(ctxt->ctxt, value, len);
28556 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28557 if (ctxt == NULL)
28559 if ((ctxt != NULL) && (ctxt->user_sax != NULL) &&
28560 (ctxt->user_sax->reference != NULL))
28561 ctxt->user_sax->reference(ctxt->user_data, name);
28562 if (ctxt->ctxt != NULL)
28563 xmlSchemaSAXHandleReference(ctxt->user_data, name);
28572 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28573 if (ctxt == NULL)
28575 if ((ctxt->user_sax != NULL) &&
28576 (ctxt->user_sax->startElementNs != NULL))
28577 ctxt->user_sax->startElementNs(ctxt->user_data, localname, prefix,
28581 if (ctxt->ctxt != NULL)
28582 xmlSchemaSAXHandleStartElementNs(ctxt->ctxt, localname, prefix,
28591 xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
28592 if (ctxt == NULL)
28594 if ((ctxt->user_sax != NULL) &&
28595 (ctxt->user_sax->endElementNs != NULL))
28596 ctxt->user_sax->endElementNs(ctxt->user_data, localname, prefix, URI);
28597 if (ctxt->ctxt != NULL)
28598 xmlSchemaSAXHandleEndElementNs(ctxt->ctxt, localname, prefix, URI);
28603 * @ctxt: a schema validation context
28615 xmlSchemaSAXPlug(xmlSchemaValidCtxtPtr ctxt,
28621 if ((ctxt == NULL) || (sax == NULL) || (user_data == NULL))
28645 ret->ctxt = ctxt;
28664 ret->user_data = ctxt;
28665 *user_data = ctxt;
28741 ctxt->sax = *sax;
28742 ctxt->flags |= XML_SCHEMA_VALID_CTXT_FLAG_STREAM;
28743 xmlSchemaPreRun(ctxt);
28766 xmlSchemaPostRun(plug->ctxt);
28784 * @ctxt: the locator context
28795 void *ctxt)
28799 vctxt->locCtxt = ctxt;
28816 xmlParserCtxtPtr ctxt;
28826 ctxt = (xmlParserCtxtPtr) ctx;
28827 if (ctxt->input != NULL) {
28829 *file = ctxt->input->filename;
28831 *line = ctxt->input->line;
28839 * @ctxt: a schema validation context
28853 xmlSchemaValidateStream(xmlSchemaValidCtxtPtr ctxt,
28863 if ((ctxt == NULL) || (input == NULL))
28880 xmlSchemaValidateSetLocator(ctxt, xmlSchemaValidateStreamLocator, pctxt);
28888 ctxt->parserCtxt = pctxt;
28889 ctxt->input = input;
28894 plug = xmlSchemaSAXPlug(ctxt, &(pctxt->sax), &(pctxt->userData));
28899 ctxt->input = input;
28900 ctxt->enc = enc;
28901 ctxt->sax = pctxt->sax;
28902 ctxt->flags |= XML_SCHEMA_VALID_CTXT_FLAG_STREAM;
28903 ret = xmlSchemaVStart(ctxt);
28905 if ((ret == 0) && (! ctxt->parserCtxt->wellFormed)) {
28906 ret = ctxt->parserCtxt->errNo;
28912 ctxt->parserCtxt = NULL;
28913 ctxt->sax = NULL;
28914 ctxt->input = NULL;
28928 * @ctxt: a schema validation context
28939 xmlSchemaValidateFile(xmlSchemaValidCtxtPtr ctxt,
28946 if ((ctxt == NULL) || (filename == NULL))
28953 ret = xmlSchemaValidateStream(ctxt, input, XML_CHAR_ENCODING_NONE,
28960 * @ctxt: a schema validation context
28968 xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt)
28970 if (ctxt == NULL)
28972 return (ctxt->parserCtxt);