Home | History | Annotate | Download | only in libxml2

Lines Matching defs:vctxt

623     xmlSchemaValidCtxtPtr vctxt;
1069 xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt);
2035 xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctxt;
2038 vctxt->nberrors++;
2039 vctxt->err = error;
2040 channel = vctxt->error;
2042 channel = vctxt->warning;
2044 schannel = vctxt->serror;
2045 data = vctxt->errCtxt;
2053 (vctxt->depth >= 0) &&
2054 (vctxt->inode != NULL)) {
2055 node = vctxt->inode->node;
2061 (vctxt->parserCtxt != NULL) &&
2062 (vctxt->parserCtxt->input != NULL)) {
2063 file = vctxt->parserCtxt->input->filename;
2064 line = vctxt->parserCtxt->input->line;
2075 if (vctxt->doc != NULL)
2076 file = (const char *) vctxt->doc->URL;
2077 else if ((vctxt->parserCtxt != NULL) &&
2078 (vctxt->parserCtxt->input != NULL))
2079 file = vctxt->parserCtxt->input->filename;
2197 xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) actxt;
2201 if (vctxt->inode->nodeType == XML_ATTRIBUTE_NODE) {
2203 vctxt->elemInfos[vctxt->depth];
2215 vctxt->inode->nsName, vctxt->inode->localName));
2359 xmlSchemaKeyrefErr(xmlSchemaValidCtxtPtr vctxt,
2372 xmlSchemaErr4Line(ACTXT_CAST vctxt, XML_ERR_ERROR,
2375 vctxt->nodeQNames->items[idcNode->nodeQNameID +1],
2376 vctxt->nodeQNames->items[idcNode->nodeQNameID]),
2731 xmlSchemaCustomErr(ACTXT_CAST vctxt, err, NULL, type, msg, NULL, NULL);
2733 #define VERROR_INT(func, msg) xmlSchemaInternalErr(ACTXT_CAST vctxt, func, msg);
4512 * @vctxt: the WXS validation context
9967 xmlSchemaCreatePCtxtOnVCtxt(xmlSchemaValidCtxtPtr vctxt)
9969 if (vctxt->pctxt == NULL) {
9970 if (vctxt->schema != NULL)
9971 vctxt->pctxt =
9972 xmlSchemaNewParserCtxtUseDict("*", vctxt->schema->dict);
9974 vctxt->pctxt = xmlSchemaNewParserCtxt("*");
9975 if (vctxt->pctxt == NULL) {
9981 xmlSchemaSetParserErrors(vctxt->pctxt, vctxt->error,
9982 vctxt->warning, vctxt->errCtxt);
9983 xmlSchemaSetParserStructuredErrors(vctxt->pctxt, vctxt->serror,
9984 vctxt->errCtxt);
12495 if (ctxt->vctxt != NULL) {
12496 xmlSchemaFreeValidCtxt(ctxt->vctxt);
15659 if (ctxt->vctxt == NULL) {
15660 ctxt->vctxt = xmlSchemaNewValidCtxt(NULL);
15661 if (ctxt->vctxt == NULL) {
15670 xmlSchemaSetValidErrors(ctxt->vctxt,
15672 xmlSchemaSetValidStructuredErrors(ctxt->vctxt,
18754 if (pctxt->vctxt == NULL) {
18758 pctxt->vctxt->schema = pctxt->schema;
18764 pctxt->vctxt->schema = NULL;
21327 if (ctxt->vctxt != NULL)
21328 xmlSchemaSetValidErrors(ctxt->vctxt, err, warn, ctx);
21348 if (ctxt->vctxt != NULL)
21349 xmlSchemaSetValidStructuredErrors(ctxt->vctxt, serror, ctx);
21481 * @vctxt: a schema validation context
21493 xmlSchemaAssembleByLocation(xmlSchemaValidCtxtPtr vctxt,
21503 if ((vctxt == NULL) || (schema == NULL))
21506 if (vctxt->pctxt == NULL) {
21511 pctxt = vctxt->pctxt;
21536 xmlSchemaCustomWarning(ACTXT_CAST vctxt, XML_SCHEMAV_MISC,
21584 if ((ret != 0) && (vctxt->err == 0))
21585 vctxt->err = ret;
21586 vctxt->nberrors += pctxt->nberrors;
21589 vctxt->nberrors += pctxt->nberrors;
21599 xmlSchemaGetMetaAttrInfo(xmlSchemaValidCtxtPtr vctxt,
21602 if (vctxt->nbAttrInfos == 0)
21608 for (i = 0; i < vctxt->nbAttrInfos; i++) {
21609 iattr = vctxt->attrInfos[i];
21620 * @vctxt: a schema validation context
21631 xmlSchemaAssembleByXSI(xmlSchemaValidCtxtPtr vctxt)
21647 iattr = xmlSchemaGetMetaAttrInfo(vctxt,
21650 iattr = xmlSchemaGetMetaAttrInfo(vctxt,
21671 nsname = xmlDictLookup(vctxt->schema->dict, cur, end - cur);
21690 xmlSchemaCustomWarning(ACTXT_CAST vctxt, XML_SCHEMAV_MISC,
21698 location = xmlDictLookup(vctxt->schema->dict, cur, end - cur);
21700 ret = xmlSchemaAssembleByLocation(vctxt, vctxt->schema,
21712 xmlSchemaLookupNamespace(xmlSchemaValidCtxtPtr vctxt,
21715 if (vctxt->sax != NULL) {
21719 for (i = vctxt->depth; i >= 0; i--) {
21720 if (vctxt->elemInfos[i]->nbNsBindings != 0) {
21721 inode = vctxt->elemInfos[i];
21739 } else if (vctxt->reader != NULL) {
21742 nsName = xmlTextReaderLookupNamespace(vctxt->reader, prefix);
21746 ret = xmlDictLookup(vctxt->dict, nsName, -1);
21755 if ((vctxt->inode->node == NULL) ||
21756 (vctxt->inode->node->doc == NULL)) {
21761 ns = xmlSearchNs(vctxt->inode->node->doc,
21762 vctxt->inode->node, prefix);
21773 xmlSchemaValidateNotation(xmlSchemaValidCtxtPtr vctxt,
21782 if (vctxt && (vctxt->schema == NULL)) {
21798 if (vctxt != NULL)
21799 nsName = xmlSchemaLookupNamespace(vctxt, BAD_CAST prefix);
21841 xmlSchemaVAddNodeQName(xmlSchemaValidCtxtPtr vctxt,
21847 lname = xmlDictLookup(vctxt->dict, lname, -1);
21851 nsname = xmlDictLookup(vctxt->dict, nsname, -1);
21855 for (i = 0; i < vctxt->nodeQNames->nbItems; i += 2) {
21856 if ((vctxt->nodeQNames->items [i] == lname) &&
21857 (vctxt->nodeQNames->items[i +1] == nsname))
21862 i = vctxt->nodeQNames->nbItems;
21863 xmlSchemaItemListAdd(vctxt->nodeQNames, (void *) lname);
21864 xmlSchemaItemListAdd(vctxt->nodeQNames, (void *) nsname);
21884 xmlSchemaValidCtxtPtr vctxt)
21890 xmlSchemaVErrMemory(vctxt,
21898 if (vctxt->aidcs == NULL)
21899 vctxt->aidcs = aidc;
21901 aidc->next = vctxt->aidcs;
21902 vctxt->aidcs = aidc;
21907 if ((vctxt->hasKeyrefs == 0) &&
21909 vctxt->hasKeyrefs = 1;
21919 xmlSchemaAugmentImportedIDC(xmlSchemaImportPtr imported, xmlSchemaValidCtxtPtr vctxt) {
21922 (xmlHashScanner) xmlSchemaAugmentIDC, vctxt);
21953 * @vctxt: the WXS validation context
21963 xmlSchemaIDCStoreNodeTableItem(xmlSchemaValidCtxtPtr vctxt,
21969 if (vctxt->idcNodes == NULL) {
21970 vctxt->idcNodes = (xmlSchemaPSVIIDCNodePtr *)
21972 if (vctxt->idcNodes == NULL) {
21973 xmlSchemaVErrMemory(vctxt,
21977 vctxt->sizeIdcNodes = 20;
21978 } else if (vctxt->sizeIdcNodes <= vctxt->nbIdcNodes) {
21979 vctxt->sizeIdcNodes *= 2;
21980 vctxt->idcNodes = (xmlSchemaPSVIIDCNodePtr *)
21981 xmlRealloc(vctxt->idcNodes, vctxt->sizeIdcNodes *
21983 if (vctxt->idcNodes == NULL) {
21984 xmlSchemaVErrMemory(vctxt,
21989 vctxt->idcNodes[vctxt->nbIdcNodes++] = item;
21996 * @vctxt: the WXS validation context
22004 xmlSchemaIDCStoreKey(xmlSchemaValidCtxtPtr vctxt,
22010 if (vctxt->idcKeys == NULL) {
22011 vctxt->idcKeys = (xmlSchemaPSVIIDCKeyPtr *)
22013 if (vctxt->idcKeys == NULL) {
22014 xmlSchemaVErrMemory(vctxt,
22018 vctxt->sizeIdcKeys = 40;
22019 } else if (vctxt->sizeIdcKeys <= vctxt->nbIdcKeys) {
22020 vctxt->sizeIdcKeys *= 2;
22021 vctxt->idcKeys = (xmlSchemaPSVIIDCKeyPtr *)
22022 xmlRealloc(vctxt->idcKeys, vctxt->sizeIdcKeys *
22024 if (vctxt->idcKeys == NULL) {
22025 xmlSchemaVErrMemory(vctxt,
22030 vctxt->idcKeys[vctxt->nbIdcKeys++] = key;
22074 * @vctxt: the WXS validation context
22084 xmlSchemaIDCAcquireBinding(xmlSchemaValidCtxtPtr vctxt,
22089 ielem = vctxt->elemInfos[matcher->depth];
22116 xmlSchemaIDCAcquireTargetList(xmlSchemaValidCtxtPtr vctxt ATTRIBUTE_UNUSED,
22217 * @vctxt: the WXS validation context
22223 xmlSchemaIDCReleaseMatcherList(xmlSchemaValidCtxtPtr vctxt,
22264 if (vctxt->idcMatcherCache != NULL)
22265 matcher->nextCached = vctxt->idcMatcherCache;
22266 vctxt->idcMatcherCache = matcher;
22274 * @vctxt: the WXS validation context
22287 xmlSchemaIDCAddStateObject(xmlSchemaValidCtxtPtr vctxt,
22297 if (vctxt->xpathStatePool != NULL) {
22298 sto = vctxt->xpathStatePool;
22299 vctxt->xpathStatePool = sto->next;
22316 if (vctxt->xpathStates != NULL)
22317 sto->next = vctxt->xpathStates;
22318 vctxt->xpathStates = sto;
22337 sto->depth = vctxt->depth;
22351 * @vctxt: the WXS validation context
22360 xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt,
22364 int res, resolved = 0, depth = vctxt->depth;
22366 if (vctxt->xpathStates == NULL)
22376 xmlSchemaFormatQName(&str, vctxt->inode->nsName,
22377 vctxt->inode->localName), depth, nodeType);
22384 first = vctxt->xpathStates;
22397 vctxt->inode->localName, vctxt->inode->nsName);
22400 vctxt->inode->localName, vctxt->inode->nsName);
22441 vctxt->depth);
22456 if (xmlSchemaIDCAddStateObject(vctxt, sto->matcher,
22474 if ((vctxt->inode->flags &
22476 vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_VALUE_NEEDED;
22486 sto = vctxt->xpathStates;
22494 xmlSchemaFormatIDCKeySequence(xmlSchemaValidCtxtPtr vctxt,
22531 * @vctxt: the WXS validation context
22538 xmlSchemaXPathPop(xmlSchemaValidCtxtPtr vctxt)
22543 if (vctxt->xpathStates == NULL)
22545 sto = vctxt->xpathStates;
22557 * @vctxt: the WXS validation context
22567 xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
22573 xmlSchemaTypePtr type = vctxt->inode->typeDef, simpleType = NULL;
22575 if (vctxt->xpathStates == NULL)
22577 sto = vctxt->xpathStates;
22584 xmlSchemaFormatQName(&str, vctxt->inode->nsName,
22585 vctxt->inode->localName), vctxt->depth);
22645 xmlSchemaCustomErr(ACTXT_CAST vctxt,
22657 if ((key == NULL) && (vctxt->inode->val == NULL)) {
22754 xmlSchemaCustomErr(ACTXT_CAST vctxt,
22800 key->val = vctxt->inode->val;
22801 vctxt->inode->val = NULL;
22805 if (xmlSchemaIDCStoreKey(vctxt, key) == -1) {
22884 bind = xmlSchemaIDCAcquireBinding(vctxt, matcher);
22886 targets = xmlSchemaIDCAcquireTargetList(vctxt, matcher);
22926 xmlSchemaCustomErr(ACTXT_CAST vctxt,
22930 xmlSchemaFormatIDCKeySequence(vctxt, &str,
22956 if (xmlSchemaIDCStoreNodeTableItem(vctxt, ntItem) == -1) {
22968 ntItem->nodeQNameID = xmlSchemaVAddNodeQName(vctxt,
22969 vctxt->inode->localName, vctxt->inode->nsName);
22981 ntItem->node = vctxt->node;
22982 ntItem->nodeLine = vctxt->inode->nodeLine;
23010 xmlSchemaCustomErr(ACTXT_CAST vctxt,
23038 if (vctxt->xpathStates != sto) {
23047 vctxt->xpathStates = sto->next;
23048 sto->next = vctxt->xpathStatePool;
23052 vctxt->xpathStatePool = sto;
23062 * @vctxt: the WXS validation context
23071 xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt,
23087 (char *) xmlSchemaFormatQName(&str, vctxt->inode->nsName,
23088 vctxt->inode->localName), vctxt->depth);
23092 if (vctxt->inode->idcMatchers != NULL) {
23111 vctxt->inode->hasKeyrefs = 1;
23115 aidc = vctxt->aidcs;
23128 (vctxt->depth < aidc->keyrefDepth))
23129 aidc->keyrefDepth = vctxt->depth;
23135 aidc = vctxt->aidcs;
23149 if (vctxt->idcMatcherCache != NULL) {
23153 matcher = vctxt->idcMatcherCache;
23154 vctxt->idcMatcherCache = matcher->nextCached;
23160 xmlSchemaVErrMemory(vctxt,
23167 vctxt->inode->idcMatchers = matcher;
23173 matcher->depth = vctxt->depth;
23182 if (xmlSchemaIDCAddStateObject(vctxt, matcher,
23192 xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
23201 /* vctxt->createIDCNodeTables */
23216 if ((! vctxt->createIDCNodeTables) &&
23218 (matcher->aidc->keyrefDepth > vctxt->depth)))
23226 bind = xmlSchemaIDCAcquireBinding(vctxt, matcher);
23388 xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
23396 bind = vctxt->inode->idcTable;
23402 parTable = &(vctxt->elemInfos[vctxt->depth -1]->idcTable);
23414 if (! vctxt->createIDCNodeTables) {
23415 aidc = vctxt->aidcs;
23419 (aidc->keyrefDepth >= vctxt->depth)) {
23614 if (! vctxt->psviExposeIDCNodeTables) {
23675 * @vctxt: the WXS validation context
23681 xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt)
23686 matcher = vctxt->inode->idcMatchers;
23704 bind = vctxt->inode->idcTable;
23759 xmlSchemaKeyrefErr(vctxt,
23764 xmlSchemaFormatIDCKeySequence(vctxt, &str,
23778 xmlSchemaKeyrefErr(vctxt,
23782 xmlSchemaFormatIDCKeySequence(vctxt, &str,
23803 xmlSchemaGetFreshAttrInfo(xmlSchemaValidCtxtPtr vctxt)
23809 if (vctxt->attrInfos == NULL) {
23810 vctxt->attrInfos = (xmlSchemaAttrInfoPtr *)
23812 vctxt->sizeAttrInfos = 1;
23813 if (vctxt->attrInfos == NULL) {
23814 xmlSchemaVErrMemory(vctxt,
23818 } else if (vctxt->sizeAttrInfos <= vctxt->nbAttrInfos) {
23819 vctxt->sizeAttrInfos++;
23820 vctxt->attrInfos = (xmlSchemaAttrInfoPtr *)
23821 xmlRealloc(vctxt->attrInfos,
23822 vctxt->sizeAttrInfos * sizeof(xmlSchemaAttrInfoPtr));
23823 if (vctxt->attrInfos == NULL) {
23824 xmlSchemaVErrMemory(vctxt,
23829 iattr = vctxt->attrInfos[vctxt->nbAttrInfos++];
23844 xmlSchemaVErrMemory(vctxt, "creating new attribute info", NULL);
23849 vctxt->attrInfos[vctxt->nbAttrInfos++] = iattr;
23855 xmlSchemaValidatorPushAttribute(xmlSchemaValidCtxtPtr vctxt,
23866 attr = xmlSchemaGetFreshAttrInfo(vctxt);
23913 * @vctxt: the WXS validation context
23917 xmlSchemaClearElemInfo(xmlSchemaValidCtxtPtr vctxt,
23947 xmlSchemaIDCReleaseMatcherList(vctxt, ielem->idcMatchers);
23974 * @vctxt: the schema validation context
23982 xmlSchemaGetFreshElemInfo(xmlSchemaValidCtxtPtr vctxt)
23986 if (vctxt->depth > vctxt->sizeElemInfos) {
23991 if (vctxt->elemInfos == NULL) {
23992 vctxt->elemInfos = (xmlSchemaNodeInfoPtr *)
23994 if (vctxt->elemInfos == NULL) {
23995 xmlSchemaVErrMemory(vctxt,
23999 memset(vctxt->elemInfos, 0, 10 * sizeof(xmlSchemaNodeInfoPtr));
24000 vctxt->sizeElemInfos = 10;
24001 } else if (vctxt->sizeElemInfos <= vctxt->depth) {
24002 int i = vctxt->sizeElemInfos;
24004 vctxt->sizeElemInfos *= 2;
24005 vctxt->elemInfos = (xmlSchemaNodeInfoPtr *)
24006 xmlRealloc(vctxt->elemInfos, vctxt->sizeElemInfos *
24008 if (vctxt->elemInfos == NULL) {
24009 xmlSchemaVErrMemory(vctxt,
24017 for (; i < vctxt->sizeElemInfos; i++)
24018 vctxt->elemInfos[i] = NULL;
24020 info = vctxt->elemInfos[vctxt->depth];
24026 xmlSchemaVErrMemory(vctxt,
24030 vctxt->elemInfos[vctxt->depth] = info;
24040 info->depth = vctxt->depth;
24045 #define ACTIVATE_ATTRIBUTE(item) vctxt->inode = (xmlSchemaNodeInfoPtr) item;
24046 #define ACTIVATE_ELEM vctxt->inode = vctxt->elemInfos[vctxt->depth];
24047 #define ACTIVATE_PARENT_ELEM vctxt->inode = vctxt->elemInfos[vctxt->depth -1];
24299 xmlSchemaValidateQName(xmlSchemaValidCtxtPtr vctxt,
24329 nsName = xmlSchemaLookupNamespace(vctxt, prefix);
24339 xmlSchemaCustomErr(ACTXT_CAST vctxt, ret, NULL,
24707 xmlSchemaVExpandQName(xmlSchemaValidCtxtPtr vctxt,
24723 xmlSchemaSimpleTypeErr(ACTXT_CAST vctxt,
24738 *localName = xmlDictLookup(vctxt->dict, value, -1);
24740 *localName = xmlDictLookup(vctxt->dict, local, -1);
24744 *nsName = xmlSchemaLookupNamespace(vctxt, prefix);
24752 xmlSchemaCustomErr(ACTXT_CAST vctxt,
24766 xmlSchemaProcessXSIType(xmlSchemaValidCtxtPtr vctxt,
24795 ret = xmlSchemaVExpandQName(vctxt, iattr->value,
24810 *localType = xmlSchemaGetType(vctxt->schema, local, nsName);
24814 xmlSchemaCustomErr(ACTXT_CAST vctxt,
24821 ret = vctxt->err;
24863 * if ((vctxt->pctxt == NULL) &&
24864 * (xmlSchemaCreatePCtxtOnVCtxt(vctxt) == -1))
24868 if (xmlSchemaCheckCOSDerivedOK(ACTXT_CAST vctxt, *localType,
24872 xmlSchemaCustomErr(ACTXT_CAST vctxt,
24882 ret = vctxt->err;
24896 xmlSchemaValidateElemDecl(xmlSchemaValidCtxtPtr vctxt)
24898 xmlSchemaElementPtr elemDecl = vctxt->inode->decl;
24907 return (vctxt->err);
24916 return (vctxt->err);
24923 if (vctxt->nbAttrInfos != 0) {
24930 iattr = xmlSchemaGetMetaAttrInfo(vctxt,
24938 ACTXT_CAST vctxt, NULL,
24969 vctxt->inode->flags |=
24979 iattr = xmlSchemaGetMetaAttrInfo(vctxt,
24984 ret = xmlSchemaProcessXSIType(vctxt, iattr, &localType,
24996 vctxt->inode->flags |= XML_SCHEMA_ELEM_INFO_LOCAL_TYPE;
25005 (xmlSchemaIDCRegisterMatchers(vctxt, elemDecl) == -1))
25018 vctxt->inode->typeDef = actualType;
25024 xmlSchemaVAttributesSimple(xmlSchemaValidCtxtPtr vctxt)
25036 if (vctxt->nbAttrInfos == 0)
25038 for (i = 0; i < vctxt->nbAttrInfos; i++) {
25039 iattr = vctxt->attrInfos[i];
25042 xmlSchemaIllegalAttrErr(ACTXT_CAST vctxt,
25055 xmlSchemaClearAttrInfos(xmlSchemaValidCtxtPtr vctxt)
25060 if (vctxt->nbAttrInfos == 0)
25062 for (i = 0; i < vctxt->nbAttrInfos; i++) {
25063 attr = vctxt->attrInfos[i];
25080 vctxt->nbAttrInfos = 0;
25094 xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
25096 xmlSchemaTypePtr type = vctxt->inode->typeDef;
25128 nbAttrs = vctxt->nbAttrInfos;
25138 iattr = vctxt->attrInfos[j];
25191 tmpiattr = xmlSchemaGetFreshAttrInfo(vctxt);
25207 tmpiattr = xmlSchemaGetFreshAttrInfo(vctxt);
25223 if (vctxt->nbAttrInfos == 0)
25225 nbUses = vctxt->nbAttrInfos;
25235 iattr = vctxt->attrInfos[i];
25278 iattr->decl = xmlSchemaGetAttributeDecl(vctxt->schema,
25342 if (vctxt->nbAttrInfos == 0)
25349 if (vctxt->options & XML_SCHEMA_VAL_VC_I_CREATE) {
25350 xmlSchemaNodeInfoPtr ielem = vctxt->elemInfos[vctxt->depth];
25357 for (i = 0; i < vctxt->nbAttrInfos; i++) {
25358 iattr = vctxt->attrInfos[i];
25379 if (vctxt->xpathStates != NULL) {
25383 xpathRes = xmlSchemaXPathEvaluate(vctxt,
25478 ns = xmlNewNs(vctxt->validationRoot,
25500 if (vctxt->value != NULL) {
25504 xmlSchemaFreeValue(vctxt->value);
25505 vctxt->value = NULL;
25532 ACTXT_CAST vctxt,
25537 ACTXT_CAST vctxt,
25619 if (xmlSchemaXPathProcessHistory(vctxt,
25620 vctxt->depth +1) == -1) {
25625 } else if (vctxt->xpathStates != NULL)
25626 xmlSchemaXPathPop(vctxt);
25632 for (i = 0; i < vctxt->nbAttrInfos; i++) {
25633 iattr = vctxt->attrInfos[i];
25644 xmlSchemaCustomErr(ACTXT_CAST vctxt,
25659 xmlSchemaCustomErr(ACTXT_CAST vctxt,
25678 xmlSchemaIllegalAttrErr(ACTXT_CAST vctxt,
25681 xmlSchemaIllegalAttrErr(ACTXT_CAST vctxt,
25698 xmlSchemaValidateElemWildcard(xmlSchemaValidCtxtPtr vctxt,
25701 xmlSchemaWildcardPtr wild = (xmlSchemaWildcardPtr) vctxt->inode->decl;
25724 decl = xmlSchemaGetElem(vctxt->schema,
25725 vctxt->inode->localName, vctxt->inode->nsName);
25727 vctxt->inode->decl = decl;
25736 return (vctxt->err);
25738 if (vctxt->nbAttrInfos != 0) {
25746 iattr = xmlSchemaGetMetaAttrInfo(vctxt,
25749 if (xmlSchemaProcessXSIType(vctxt, iattr,
25750 &(vctxt->inode->typeDef), NULL) == -1) {
25767 vctxt->inode->typeDef =
25780 xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt,
25785 xmlSchemaNodeInfoPtr inode = vctxt->inode;
25828 ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST vctxt,
25833 ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST vctxt,
25844 xmlSchemaVContentModelCallback(xmlSchemaValidCtxtPtr vctxt ATTRIBUTE_UNUSED,
25872 xmlSchemaValidatorPushElem(xmlSchemaValidCtxtPtr vctxt)
25874 vctxt->inode = xmlSchemaGetFreshElemInfo(vctxt);
25875 if (vctxt->inode == NULL) {
25880 vctxt->nbAttrInfos = 0;
25885 xmlSchemaVCheckINodeDataType(xmlSchemaValidCtxtPtr vctxt,
25892 ACTXT_CAST vctxt, NULL,
25896 ACTXT_CAST vctxt, NULL,
25906 xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt)
25909 xmlSchemaNodeInfoPtr inode = vctxt->inode;
25911 if (vctxt->nbAttrInfos != 0)
25912 xmlSchemaClearAttrInfos(vctxt);
25919 vctxt->skipDepth = vctxt->depth -1;
25954 vctxt);
25979 xmlSchemaComplexTypeErr(ACTXT_CAST vctxt,
26007 if (vctxt->value != NULL) {
26008 xmlSchemaFreeValue(vctxt->value);
26009 vctxt->value = NULL;
26019 ret = xmlSchemaVCheckINodeDataType(vctxt,
26022 ret = xmlSchemaVCheckINodeDataType(vctxt,
26061 ret = xmlSchemaCheckCOSValidDefault(vctxt,
26086 ret = xmlSchemaVCheckINodeDataType(vctxt,
26089 ret = xmlSchemaVCheckINodeDataType(vctxt,
26106 if ((vctxt->options & XML_SCHEMA_VAL_VC_I_CREATE) &&
26143 ret = xmlSchemaVCheckINodeDataType(vctxt,
26158 ret = xmlSchemaVCheckINodeDataType(vctxt,
26214 xmlSchemaCustomErr(ACTXT_CAST vctxt,
26237 xmlSchemaCustomErr(ACTXT_CAST vctxt,
26251 if (vctxt->depth < 0) {
26255 if (vctxt->depth == vctxt->skipDepth)
26256 vctxt->skipDepth = -1;
26261 (xmlSchemaXPathProcessHistory(vctxt, vctxt->depth) == -1))
26280 (vctxt->hasKeyrefs || vctxt->createIDCNodeTables))
26282 if (xmlSchemaIDCFillNodeTables(vctxt, inode) == -1)
26288 if (vctxt->inode->hasKeyrefs)
26289 if (xmlSchemaCheckCVCIDCKeyRef(vctxt) == -1)
26301 if ((vctxt->depth > 0) &&
26302 (vctxt->hasKeyrefs || vctxt->createIDCNodeTables))
26307 if (xmlSchemaBubbleIDCNodeTables(vctxt) == -1)
26316 xmlSchemaClearElemInfo(vctxt, inode);
26320 if (vctxt->depth == 0) {
26321 vctxt->depth--;
26322 vctxt->inode = NULL;
26328 if (vctxt->aidcs != NULL) {
26329 xmlSchemaIDCAugPtr aidc = vctxt->aidcs;
26331 if (aidc->keyrefDepth == vctxt->depth) {
26342 vctxt->depth--;
26343 vctxt->inode = vctxt->elemInfos[vctxt->depth];
26351 vctxt->err = -1;
26360 xmlSchemaValidateChildElem(xmlSchemaValidCtxtPtr vctxt)
26366 if (vctxt->depth <= 0) {
26371 pielem = vctxt->elemInfos[vctxt->depth -1];
26398 vctxt->inode->decl = xmlSchemaGetElem(vctxt->schema,
26399 vctxt->inode->localName,
26400 vctxt->inode->nsName);
26402 if (vctxt->inode->decl == NULL) {
26408 iattr = xmlSchemaGetMetaAttrInfo(vctxt,
26411 ret = xmlSchemaProcessXSIType(vctxt, iattr,
26412 &(vctxt->inode->typeDef), NULL);
26433 vctxt->inode->typeDef =
26486 vctxt);
26508 vctxt->inode->localName,
26509 vctxt->inode->nsName,
26510 vctxt->inode);
26515 vctxt->inode->localName, pielem->localName);
26519 vctxt->inode->localName, pielem->localName);
26521 if (vctxt->err == XML_SCHEMAV_INTERNAL) {
26529 xmlSchemaComplexTypeErr(ACTXT_CAST vctxt,
26533 ret = vctxt->err;
26562 ret = vctxt->err;
26575 vctxt->skipDepth = vctxt->depth;
26576 vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_ERR_NOT_EXPECTED;
26586 xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt,
26601 if (INODE_NILLED(vctxt->inode)) {
26610 return (vctxt->err);
26617 if (vctxt->inode->typeDef->contentType ==
26622 return (vctxt->err);
26625 if (vctxt->inode->typeDef->contentType ==
26640 return (vctxt->err);
26652 if ((vctxt->inode->typeDef->contentType == XML_SCHEMA_CONTENT_MIXED) &&
26653 ((vctxt->inode->decl == NULL) ||
26654 (vctxt->inode->decl->value == NULL)))
26657 if (vctxt->inode->value == NULL) {
26666 vctxt->inode->value = value;
26673 vctxt->inode->value = value;
26676 vctxt->inode->flags |=
26685 vctxt->inode->value = BAD_CAST xmlStrndup(value, len);
26687 vctxt->inode->value = BAD_CAST xmlStrdup(value);
26688 vctxt->inode->flags |=
26700 if (vctxt->inode->flags & XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES) {
26701 vctxt->inode->value = BAD_CAST xmlStrncat(
26702 (xmlChar *) vctxt->inode->value, value, len);
26704 vctxt->inode->value =
26705 BAD_CAST xmlStrncatNew(vctxt->inode->value, value, len);
26706 vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES;
26714 xmlSchemaValidateElem(xmlSchemaValidCtxtPtr vctxt)
26718 if ((vctxt->skipDepth != -1) &&
26719 (vctxt->depth >= vctxt->skipDepth)) {
26724 if (vctxt->xsiAssemble) {
26735 ret = xmlSchemaAssembleByXSI(vctxt);
26739 vctxt->skipDepth = 0;
26743 if (vctxt->depth > 0) {
26748 ret = xmlSchemaValidateChildElem(vctxt);
26757 if (vctxt->depth == vctxt->skipDepth)
26759 if ((vctxt->inode->decl == NULL) &&
26760 (vctxt->inode->typeDef == NULL)) {
26770 vctxt->inode->decl = xmlSchemaGetElem(vctxt->schema,
26771 vctxt->inode->localName,
26772 vctxt->inode->nsName);
26773 if (vctxt->inode->decl == NULL) {
26782 if (vctxt->inode->decl == NULL)
26785 if (vctxt->inode->decl->type == XML_SCHEMA_TYPE_ANY) {
26790 ret = xmlSchemaValidateElemWildcard(vctxt, &skip);
26800 vctxt->skipDepth = vctxt->depth;
26807 if (vctxt->inode->decl->type != XML_SCHEMA_TYPE_ELEMENT) {
26811 vctxt->inode->decl = NULL;
26818 ret = xmlSchemaValidateElemDecl(vctxt);
26832 if (vctxt->inode->typeDef == NULL) {
26833 vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_ERR_BAD_TYPE;
26839 if (vctxt->inode->typeDef->flags & XML_SCHEMAS_TYPE_ABSTRACT) {
26840 vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_ERR_BAD_TYPE;
26851 if (vctxt->xpathStates != NULL) {
26852 ret = xmlSchemaXPathEvaluate(vctxt, XML_ELEMENT_NODE);
26853 vctxt->inode->appliedXPath = 1;
26863 if (WXS_IS_COMPLEX(vctxt->inode->typeDef)) {
26864 if ((vctxt->nbAttrInfos != 0) ||
26865 (vctxt->inode->typeDef->attrUses != NULL)) {
26867 ret = xmlSchemaVAttributesComplex(vctxt);
26869 } else if (vctxt->nbAttrInfos != 0) {
26871 ret = xmlSchemaVAttributesSimple(vctxt);
26876 if (vctxt->nbAttrInfos != 0)
26877 xmlSchemaClearAttrInfos(vctxt);
26890 vctxt->skipDepth = vctxt->depth;
26898 xmlSchemaVReaderWalk(xmlSchemaValidCtxtPtr vctxt)
26904 vctxt->depth = -1;
26905 ret = xmlTextReaderRead(vctxt->reader);
26910 nodeType = xmlTextReaderNodeType(vctxt->reader);
26913 ret = xmlTextReaderRead(vctxt->reader);
26920 depth = xmlTextReaderDepth(vctxt->reader);
26921 nodeType = xmlTextReaderNodeType(vctxt->reader);
26925 vctxt->depth++;
26926 if (xmlSchemaValidatorPushElem(vctxt) == -1) {
26931 ielem = vctxt->inode;
26932 ielem->localName = xmlTextReaderLocalName(vctxt->reader);
26933 ielem->nsName = xmlTextReaderNamespaceUri(vctxt->reader);
26938 ret = xmlTextReaderIsEmptyElement(vctxt->reader);
26950 vctxt->nbAttrInfos = 0;
26951 ret = xmlTextReaderMoveToFirstAttribute(vctxt->reader);
26963 if (xmlSchemaValidatorPushAttribute(vctxt, NULL,
26964 (const xmlChar *) xmlTextReaderLocalName(vctxt->reader),
26965 xmlTextReaderNamespaceUri(vctxt->reader), 1,
26966 xmlTextReaderValue(vctxt->reader), 1) == -1) {
26972 ret = xmlTextReaderMoveToNextAttribute(vctxt->reader);
26982 ret = xmlTextReaderMoveToElement(vctxt->reader);
26992 ret= xmlSchemaValidateElem(vctxt);
27001 if (vctxt->depth == vctxt->skipDepth) {
27007 ret = xmlTextReaderRead(vctxt->reader);
27008 curDepth = xmlTextReaderDepth(vctxt->reader);
27010 ret = xmlTextReaderRead(vctxt->reader);
27011 curDepth = xmlTextReaderDepth(vctxt->reader);
27034 ret = xmlSchemaValidatorPopElem(vctxt);
27043 if (vctxt->depth >= 0)
27044 ielem = vctxt->inode;
27059 value = xmlTextReaderValue(vctxt->reader);
27060 ret = xmlSchemaVPushText(vctxt, nodeType, BAD_CAST value,
27079 ret = xmlTextReaderRead(vctxt->reader);
27103 xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
27105 if (vctxt->depth < 0)
27107 if ((vctxt->skipDepth != -1) && (vctxt->depth >= vctxt->skipDepth))
27109 if (vctxt->inode->flags & XML_SCHEMA_ELEM_INFO_EMPTY)
27110 vctxt->inode->flags ^= XML_SCHEMA_ELEM_INFO_EMPTY;
27111 if (xmlSchemaVPushText(vctxt, XML_TEXT_NODE, ch, len,
27115 vctxt->err = -1;
27116 xmlStopParser(vctxt->parserCtxt);
27128 xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
27130 if (vctxt->depth < 0)
27132 if ((vctxt->skipDepth != -1) && (vctxt->depth >= vctxt->skipDepth))
27134 if (vctxt->inode->flags & XML_SCHEMA_ELEM_INFO_EMPTY)
27135 vctxt->inode->flags ^= XML_SCHEMA_ELEM_INFO_EMPTY;
27136 if (xmlSchemaVPushText(vctxt, XML_CDATA_SECTION_NODE, ch, len,
27140 vctxt->err = -1;
27141 xmlStopParser(vctxt->parserCtxt);
27149 xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
27151 if (vctxt->depth < 0)
27153 if ((vctxt->skipDepth != -1) && (vctxt->depth >= vctxt->skipDepth))
27170 xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
27181 vctxt->depth++;
27182 if ((vctxt->skipDepth != -1) && (vctxt->depth >= vctxt->skipDepth))
27187 if (xmlSchemaValidatorPushElem(vctxt) == -1) {
27192 ielem = vctxt->inode;
27196 ielem->nodeLine = xmlSAX2GetLineNumber(vctxt->parserCtxt);
27217 xmlSchemaVErrMemory(vctxt,
27231 xmlSchemaVErrMemory(vctxt,
27267 ret = xmlSchemaValidatorPushAttribute(vctxt,
27280 ret = xmlSchemaValidateElem(vctxt);
27293 vctxt->err = -1;
27294 xmlStopParser(vctxt->parserCtxt);
27304 xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
27310 if (vctxt->skipDepth != -1) {
27311 if (vctxt->depth > vctxt->skipDepth) {
27312 vctxt->depth--;
27315 vctxt->skipDepth = -1;
27320 if ((!xmlStrEqual(vctxt->inode->localName, localname)) ||
27321 (!xmlStrEqual(vctxt->inode->nsName, URI))) {
27325 res = xmlSchemaValidatorPopElem(vctxt);
27337 vctxt->err = -1;
27338 xmlStopParser(vctxt->parserCtxt);
27382 xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt)
27384 if (vctxt == NULL)
27392 vctxt->flags = 0;
27393 vctxt->validationRoot = NULL;
27394 vctxt->doc = NULL;
27396 vctxt->reader = NULL;
27398 vctxt->hasKeyrefs = 0;
27400 if (vctxt->value != NULL) {
27401 xmlSchemaFreeValue(vctxt->value);
27402 vctxt->value = NULL;
27407 if (vctxt->aidcs != NULL) {
27408 xmlSchemaIDCAugPtr cur = vctxt->aidcs, next;
27414 vctxt->aidcs = NULL;
27416 if (vctxt->idcMatcherCache != NULL) {
27417 xmlSchemaIDCMatcherPtr matcher = vctxt->idcMatcherCache, tmp;
27424 vctxt->idcMatcherCache = NULL;
27428 if (vctxt->idcNodes != NULL) {
27432 for (i = 0; i < vctxt->nbIdcNodes; i++) {
27433 item = vctxt->idcNodes[i];
27437 xmlFree(vctxt->idcNodes);
27438 vctxt->idcNodes = NULL;
27439 vctxt->nbIdcNodes = 0;
27440 vctxt->sizeIdcNodes = 0;
27445 if (vctxt->xpathStates != NULL) {
27446 xmlSchemaFreeIDCStateObjList(vctxt->xpathStates);
27447 vctxt->xpathStates = NULL;
27452 if (vctxt->nbAttrInfos != 0) {
27453 xmlSchemaClearAttrInfos(vctxt);
27458 if (vctxt->elemInfos != NULL) {
27462 for (i = 0; i < vctxt->sizeElemInfos; i++) {
27463 ei = vctxt->elemInfos[i];
27466 xmlSchemaClearElemInfo(vctxt, ei);
27469 xmlSchemaItemListClear(vctxt->nodeQNames);
27471 xmlDictFree(vctxt->dict);
27476 vctxt->dict = xmlDictCreate();
27707 xmlSchemaVDocWalk(xmlSchemaValidCtxtPtr vctxt)
27716 valRoot = xmlDocGetRootElement(vctxt->doc);
27722 vctxt->depth = -1;
27723 vctxt->validationRoot = valRoot;
27726 if ((vctxt->skipDepth != -1) && (vctxt->depth >= vctxt->skipDepth))
27733 vctxt->depth++;
27734 if (xmlSchemaValidatorPushElem(vctxt) == -1)
27736 ielem = vctxt->inode;
27748 vctxt->nbAttrInfos = 0;
27756 ret = xmlSchemaValidatorPushAttribute(vctxt,
27776 ret = xmlSchemaValidateElem(vctxt);
27789 if ((vctxt->skipDepth != -1) &&
27790 (vctxt->depth >= vctxt->skipDepth))
27799 ret = xmlSchemaVPushText(vctxt, node->type, node->content,
27839 if (node != vctxt->inode->node) {
27844 ret = xmlSchemaValidatorPopElem(vctxt);
27871 xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) {
27875 vctxt->err = 0;
27876 vctxt->nberrors = 0;
27877 vctxt->depth = -1;
27878 vctxt->skipDepth = -1;
27879 vctxt->xsiAssemble = 0;
27880 vctxt->hasKeyrefs = 0;
27882 vctxt->createIDCNodeTables = 1;
27884 vctxt->createIDCNodeTables = 0;
27889 if (vctxt->schema == NULL) {
27892 vctxt->xsiAssemble = 1;
27899 if ((vctxt->pctxt == NULL) &&
27900 (xmlSchemaCreatePCtxtOnVCtxt(vctxt) == -1))
27902 pctxt = vctxt->pctxt;
27907 vctxt->schema = xmlSchemaNewSchema(pctxt);
27908 if (vctxt->schema == NULL)
27916 pctxt->constructor->mainSchema = vctxt->schema;
27926 xmlHashScan(vctxt->schema->schemasImports,(xmlHashScanner)xmlSchemaAugmentImportedIDC, vctxt);
27932 xmlSchemaPostRun(xmlSchemaValidCtxtPtr vctxt) {
27933 if (vctxt->xsiAssemble) {
27934 if (vctxt->schema != NULL) {
27935 xmlSchemaFree(vctxt->schema);
27936 vctxt->schema = NULL;
27939 xmlSchemaClearValidCtxt(vctxt);
27943 xmlSchemaVStart(xmlSchemaValidCtxtPtr vctxt)
27947 if (xmlSchemaPreRun(vctxt) < 0)
27950 if (vctxt->doc != NULL) {
27954 ret = xmlSchemaVDocWalk(vctxt);
27956 } else if (vctxt->reader != NULL) {
27961 ret = xmlSchemaVReaderWalk(vctxt);
27964 } else if ((vctxt->sax != NULL) && (vctxt->parserCtxt != NULL)) {
27968 ret = xmlParseDocument(vctxt->parserCtxt);
27975 xmlSchemaPostRun(vctxt);
27977 ret = vctxt->err;