• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/ap/gpl/timemachine/gettext-0.17/gettext-tools/gnulib-lib/libxml/

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);
12487 if (ctxt->vctxt != NULL) {
12488 xmlSchemaFreeValidCtxt(ctxt->vctxt);
15649 if (ctxt->vctxt == NULL) {
15650 ctxt->vctxt = xmlSchemaNewValidCtxt(NULL);
15651 if (ctxt->vctxt == NULL) {
15660 xmlSchemaSetValidErrors(ctxt->vctxt,
15662 xmlSchemaSetValidStructuredErrors(ctxt->vctxt,
18742 if (pctxt->vctxt == NULL) {
18746 pctxt->vctxt->schema = pctxt->schema;
18752 pctxt->vctxt->schema = NULL;
21317 if (ctxt->vctxt != NULL)
21318 xmlSchemaSetValidErrors(ctxt->vctxt, err, warn, ctx);
21338 if (ctxt->vctxt != NULL)
21339 xmlSchemaSetValidStructuredErrors(ctxt->vctxt, serror, ctx);
21471 * @vctxt: a schema validation context
21483 xmlSchemaAssembleByLocation(xmlSchemaValidCtxtPtr vctxt,
21493 if ((vctxt == NULL) || (schema == NULL))
21496 if (vctxt->pctxt == NULL) {
21501 pctxt = vctxt->pctxt;
21526 xmlSchemaCustomWarning(ACTXT_CAST vctxt, XML_SCHEMAV_MISC,
21574 if ((ret != 0) && (vctxt->err == 0))
21575 vctxt->err = ret;
21576 vctxt->nberrors += pctxt->nberrors;
21579 vctxt->nberrors += pctxt->nberrors;
21589 xmlSchemaGetMetaAttrInfo(xmlSchemaValidCtxtPtr vctxt,
21592 if (vctxt->nbAttrInfos == 0)
21598 for (i = 0; i < vctxt->nbAttrInfos; i++) {
21599 iattr = vctxt->attrInfos[i];
21610 * @vctxt: a schema validation context
21621 xmlSchemaAssembleByXSI(xmlSchemaValidCtxtPtr vctxt)
21637 iattr = xmlSchemaGetMetaAttrInfo(vctxt,
21640 iattr = xmlSchemaGetMetaAttrInfo(vctxt,
21661 nsname = xmlDictLookup(vctxt->schema->dict, cur, end - cur);
21680 xmlSchemaCustomWarning(ACTXT_CAST vctxt, XML_SCHEMAV_MISC,
21688 location = xmlDictLookup(vctxt->schema->dict, cur, end - cur);
21690 ret = xmlSchemaAssembleByLocation(vctxt, vctxt->schema,
21702 xmlSchemaLookupNamespace(xmlSchemaValidCtxtPtr vctxt,
21705 if (vctxt->sax != NULL) {
21709 for (i = vctxt->depth; i >= 0; i--) {
21710 if (vctxt->elemInfos[i]->nbNsBindings != 0) {
21711 inode = vctxt->elemInfos[i];
21729 } else if (vctxt->reader != NULL) {
21732 nsName = xmlTextReaderLookupNamespace(vctxt->reader, prefix);
21736 ret = xmlDictLookup(vctxt->dict, nsName, -1);
21745 if ((vctxt->inode->node == NULL) ||
21746 (vctxt->inode->node->doc == NULL)) {
21751 ns = xmlSearchNs(vctxt->inode->node->doc,
21752 vctxt->inode->node, prefix);
21763 xmlSchemaValidateNotation(xmlSchemaValidCtxtPtr vctxt,
21772 if (vctxt && (vctxt->schema == NULL)) {
21788 if (vctxt != NULL)
21789 nsName = xmlSchemaLookupNamespace(vctxt, BAD_CAST prefix);
21831 xmlSchemaVAddNodeQName(xmlSchemaValidCtxtPtr vctxt,
21837 lname = xmlDictLookup(vctxt->dict, lname, -1);
21841 nsname = xmlDictLookup(vctxt->dict, nsname, -1);
21845 for (i = 0; i < vctxt->nodeQNames->nbItems; i += 2) {
21846 if ((vctxt->nodeQNames->items [i] == lname) &&
21847 (vctxt->nodeQNames->items[i +1] == nsname))
21852 i = vctxt->nodeQNames->nbItems;
21853 xmlSchemaItemListAdd(vctxt->nodeQNames, (void *) lname);
21854 xmlSchemaItemListAdd(vctxt->nodeQNames, (void *) nsname);
21874 xmlSchemaValidCtxtPtr vctxt)
21880 xmlSchemaVErrMemory(vctxt,
21888 if (vctxt->aidcs == NULL)
21889 vctxt->aidcs = aidc;
21891 aidc->next = vctxt->aidcs;
21892 vctxt->aidcs = aidc;
21897 if ((vctxt->hasKeyrefs == 0) &&
21899 vctxt->hasKeyrefs = 1;
21929 * @vctxt: the WXS validation context
21939 xmlSchemaIDCStoreNodeTableItem(xmlSchemaValidCtxtPtr vctxt,
21945 if (vctxt->idcNodes == NULL) {
21946 vctxt->idcNodes = (xmlSchemaPSVIIDCNodePtr *)
21948 if (vctxt->idcNodes == NULL) {
21949 xmlSchemaVErrMemory(vctxt,
21953 vctxt->sizeIdcNodes = 20;
21954 } else if (vctxt->sizeIdcNodes <= vctxt->nbIdcNodes) {
21955 vctxt->sizeIdcNodes *= 2;
21956 vctxt->idcNodes = (xmlSchemaPSVIIDCNodePtr *)
21957 xmlRealloc(vctxt->idcNodes, vctxt->sizeIdcNodes *
21959 if (vctxt->idcNodes == NULL) {
21960 xmlSchemaVErrMemory(vctxt,
21965 vctxt->idcNodes[vctxt->nbIdcNodes++] = item;
21972 * @vctxt: the WXS validation context
21980 xmlSchemaIDCStoreKey(xmlSchemaValidCtxtPtr vctxt,
21986 if (vctxt->idcKeys == NULL) {
21987 vctxt->idcKeys = (xmlSchemaPSVIIDCKeyPtr *)
21989 if (vctxt->idcKeys == NULL) {
21990 xmlSchemaVErrMemory(vctxt,
21994 vctxt->sizeIdcKeys = 40;
21995 } else if (vctxt->sizeIdcKeys <= vctxt->nbIdcKeys) {
21996 vctxt->sizeIdcKeys *= 2;
21997 vctxt->idcKeys = (xmlSchemaPSVIIDCKeyPtr *)
21998 xmlRealloc(vctxt->idcKeys, vctxt->sizeIdcKeys *
22000 if (vctxt->idcKeys == NULL) {
22001 xmlSchemaVErrMemory(vctxt,
22006 vctxt->idcKeys[vctxt->nbIdcKeys++] = key;
22050 * @vctxt: the WXS validation context
22060 xmlSchemaIDCAcquireBinding(xmlSchemaValidCtxtPtr vctxt,
22065 ielem = vctxt->elemInfos[matcher->depth];
22092 xmlSchemaIDCAcquireTargetList(xmlSchemaValidCtxtPtr vctxt ATTRIBUTE_UNUSED,
22193 * @vctxt: the WXS validation context
22199 xmlSchemaIDCReleaseMatcherList(xmlSchemaValidCtxtPtr vctxt,
22240 if (vctxt->idcMatcherCache != NULL)
22241 matcher->nextCached = vctxt->idcMatcherCache;
22242 vctxt->idcMatcherCache = matcher;
22250 * @vctxt: the WXS validation context
22263 xmlSchemaIDCAddStateObject(xmlSchemaValidCtxtPtr vctxt,
22273 if (vctxt->xpathStatePool != NULL) {
22274 sto = vctxt->xpathStatePool;
22275 vctxt->xpathStatePool = sto->next;
22292 if (vctxt->xpathStates != NULL)
22293 sto->next = vctxt->xpathStates;
22294 vctxt->xpathStates = sto;
22313 sto->depth = vctxt->depth;
22327 * @vctxt: the WXS validation context
22336 xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt,
22340 int res, resolved = 0, depth = vctxt->depth;
22342 if (vctxt->xpathStates == NULL)
22352 xmlSchemaFormatQName(&str, vctxt->inode->nsName,
22353 vctxt->inode->localName), depth, nodeType);
22360 first = vctxt->xpathStates;
22373 vctxt->inode->localName, vctxt->inode->nsName);
22376 vctxt->inode->localName, vctxt->inode->nsName);
22417 vctxt->depth);
22432 if (xmlSchemaIDCAddStateObject(vctxt, sto->matcher,
22450 if ((vctxt->inode->flags &
22452 vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_VALUE_NEEDED;
22462 sto = vctxt->xpathStates;
22470 xmlSchemaFormatIDCKeySequence(xmlSchemaValidCtxtPtr vctxt,
22507 * @vctxt: the WXS validation context
22514 xmlSchemaXPathPop(xmlSchemaValidCtxtPtr vctxt)
22519 if (vctxt->xpathStates == NULL)
22521 sto = vctxt->xpathStates;
22533 * @vctxt: the WXS validation context
22543 xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
22549 xmlSchemaTypePtr type = vctxt->inode->typeDef, simpleType = NULL;
22551 if (vctxt->xpathStates == NULL)
22553 sto = vctxt->xpathStates;
22560 xmlSchemaFormatQName(&str, vctxt->inode->nsName,
22561 vctxt->inode->localName), vctxt->depth);
22621 xmlSchemaCustomErr(ACTXT_CAST vctxt,
22633 if ((key == NULL) && (vctxt->inode->val == NULL)) {
22730 xmlSchemaCustomErr(ACTXT_CAST vctxt,
22776 key->val = vctxt->inode->val;
22777 vctxt->inode->val = NULL;
22781 if (xmlSchemaIDCStoreKey(vctxt, key) == -1) {
22860 bind = xmlSchemaIDCAcquireBinding(vctxt, matcher);
22862 targets = xmlSchemaIDCAcquireTargetList(vctxt, matcher);
22902 xmlSchemaCustomErr(ACTXT_CAST vctxt,
22906 xmlSchemaFormatIDCKeySequence(vctxt, &str,
22932 if (xmlSchemaIDCStoreNodeTableItem(vctxt, ntItem) == -1) {
22944 ntItem->nodeQNameID = xmlSchemaVAddNodeQName(vctxt,
22945 vctxt->inode->localName, vctxt->inode->nsName);
22957 ntItem->node = vctxt->node;
22958 ntItem->nodeLine = vctxt->inode->nodeLine;
22986 xmlSchemaCustomErr(ACTXT_CAST vctxt,
23014 if (vctxt->xpathStates != sto) {
23023 vctxt->xpathStates = sto->next;
23024 sto->next = vctxt->xpathStatePool;
23028 vctxt->xpathStatePool = sto;
23038 * @vctxt: the WXS validation context
23047 xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt,
23063 (char *) xmlSchemaFormatQName(&str, vctxt->inode->nsName,
23064 vctxt->inode->localName), vctxt->depth);
23068 if (vctxt->inode->idcMatchers != NULL) {
23087 vctxt->inode->hasKeyrefs = 1;
23091 aidc = vctxt->aidcs;
23104 (vctxt->depth < aidc->keyrefDepth))
23105 aidc->keyrefDepth = vctxt->depth;
23111 aidc = vctxt->aidcs;
23125 if (vctxt->idcMatcherCache != NULL) {
23129 matcher = vctxt->idcMatcherCache;
23130 vctxt->idcMatcherCache = matcher->nextCached;
23136 xmlSchemaVErrMemory(vctxt,
23143 vctxt->inode->idcMatchers = matcher;
23149 matcher->depth = vctxt->depth;
23158 if (xmlSchemaIDCAddStateObject(vctxt, matcher,
23168 xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
23177 /* vctxt->createIDCNodeTables */
23192 if ((! vctxt->createIDCNodeTables) &&
23194 (matcher->aidc->keyrefDepth > vctxt->depth)))
23202 bind = xmlSchemaIDCAcquireBinding(vctxt, matcher);
23364 xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
23372 bind = vctxt->inode->idcTable;
23378 parTable = &(vctxt->elemInfos[vctxt->depth -1]->idcTable);
23390 if (! vctxt->createIDCNodeTables) {
23391 aidc = vctxt->aidcs;
23395 (aidc->keyrefDepth >= vctxt->depth)) {
23590 if (! vctxt->psviExposeIDCNodeTables) {
23651 * @vctxt: the WXS validation context
23657 xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt)
23662 matcher = vctxt->inode->idcMatchers;
23680 bind = vctxt->inode->idcTable;
23735 xmlSchemaKeyrefErr(vctxt,
23740 xmlSchemaFormatIDCKeySequence(vctxt, &str,
23754 xmlSchemaKeyrefErr(vctxt,
23758 xmlSchemaFormatIDCKeySequence(vctxt, &str,
23779 xmlSchemaGetFreshAttrInfo(xmlSchemaValidCtxtPtr vctxt)
23785 if (vctxt->attrInfos == NULL) {
23786 vctxt->attrInfos = (xmlSchemaAttrInfoPtr *)
23788 vctxt->sizeAttrInfos = 1;
23789 if (vctxt->attrInfos == NULL) {
23790 xmlSchemaVErrMemory(vctxt,
23794 } else if (vctxt->sizeAttrInfos <= vctxt->nbAttrInfos) {
23795 vctxt->sizeAttrInfos++;
23796 vctxt->attrInfos = (xmlSchemaAttrInfoPtr *)
23797 xmlRealloc(vctxt->attrInfos,
23798 vctxt->sizeAttrInfos * sizeof(xmlSchemaAttrInfoPtr));
23799 if (vctxt->attrInfos == NULL) {
23800 xmlSchemaVErrMemory(vctxt,
23805 iattr = vctxt->attrInfos[vctxt->nbAttrInfos++];
23820 xmlSchemaVErrMemory(vctxt, "creating new attribute info", NULL);
23825 vctxt->attrInfos[vctxt->nbAttrInfos++] = iattr;
23831 xmlSchemaValidatorPushAttribute(xmlSchemaValidCtxtPtr vctxt,
23842 attr = xmlSchemaGetFreshAttrInfo(vctxt);
23889 * @vctxt: the WXS validation context
23893 xmlSchemaClearElemInfo(xmlSchemaValidCtxtPtr vctxt,
23923 xmlSchemaIDCReleaseMatcherList(vctxt, ielem->idcMatchers);
23950 * @vctxt: the schema validation context
23958 xmlSchemaGetFreshElemInfo(xmlSchemaValidCtxtPtr vctxt)
23962 if (vctxt->depth > vctxt->sizeElemInfos) {
23967 if (vctxt->elemInfos == NULL) {
23968 vctxt->elemInfos = (xmlSchemaNodeInfoPtr *)
23970 if (vctxt->elemInfos == NULL) {
23971 xmlSchemaVErrMemory(vctxt,
23975 memset(vctxt->elemInfos, 0, 10 * sizeof(xmlSchemaNodeInfoPtr));
23976 vctxt->sizeElemInfos = 10;
23977 } else if (vctxt->sizeElemInfos <= vctxt->depth) {
23978 int i = vctxt->sizeElemInfos;
23980 vctxt->sizeElemInfos *= 2;
23981 vctxt->elemInfos = (xmlSchemaNodeInfoPtr *)
23982 xmlRealloc(vctxt->elemInfos, vctxt->sizeElemInfos *
23984 if (vctxt->elemInfos == NULL) {
23985 xmlSchemaVErrMemory(vctxt,
23993 for (; i < vctxt->sizeElemInfos; i++)
23994 vctxt->elemInfos[i] = NULL;
23996 info = vctxt->elemInfos[vctxt->depth];
24002 xmlSchemaVErrMemory(vctxt,
24006 vctxt->elemInfos[vctxt->depth] = info;
24016 info->depth = vctxt->depth;
24021 #define ACTIVATE_ATTRIBUTE(item) vctxt->inode = (xmlSchemaNodeInfoPtr) item;
24022 #define ACTIVATE_ELEM vctxt->inode = vctxt->elemInfos[vctxt->depth];
24023 #define ACTIVATE_PARENT_ELEM vctxt->inode = vctxt->elemInfos[vctxt->depth -1];
24275 xmlSchemaValidateQName(xmlSchemaValidCtxtPtr vctxt,
24305 nsName = xmlSchemaLookupNamespace(vctxt, prefix);
24315 xmlSchemaCustomErr(ACTXT_CAST vctxt, ret, NULL,
24683 xmlSchemaVExpandQName(xmlSchemaValidCtxtPtr vctxt,
24699 xmlSchemaSimpleTypeErr(ACTXT_CAST vctxt,
24714 *localName = xmlDictLookup(vctxt->dict, value, -1);
24716 *localName = xmlDictLookup(vctxt->dict, local, -1);
24720 *nsName = xmlSchemaLookupNamespace(vctxt, prefix);
24728 xmlSchemaCustomErr(ACTXT_CAST vctxt,
24742 xmlSchemaProcessXSIType(xmlSchemaValidCtxtPtr vctxt,
24771 ret = xmlSchemaVExpandQName(vctxt, iattr->value,
24786 *localType = xmlSchemaGetType(vctxt->schema, local, nsName);
24790 xmlSchemaCustomErr(ACTXT_CAST vctxt,
24797 ret = vctxt->err;
24839 * if ((vctxt->pctxt == NULL) &&
24840 * (xmlSchemaCreatePCtxtOnVCtxt(vctxt) == -1))
24844 if (xmlSchemaCheckCOSDerivedOK(ACTXT_CAST vctxt, *localType,
24848 xmlSchemaCustomErr(ACTXT_CAST vctxt,
24858 ret = vctxt->err;
24872 xmlSchemaValidateElemDecl(xmlSchemaValidCtxtPtr vctxt)
24874 xmlSchemaElementPtr elemDecl = vctxt->inode->decl;
24883 return (vctxt->err);
24892 return (vctxt->err);
24899 if (vctxt->nbAttrInfos != 0) {
24906 iattr = xmlSchemaGetMetaAttrInfo(vctxt,
24914 ACTXT_CAST vctxt, NULL,
24945 vctxt->inode->flags |=
24955 iattr = xmlSchemaGetMetaAttrInfo(vctxt,
24960 ret = xmlSchemaProcessXSIType(vctxt, iattr, &localType,
24972 vctxt->inode->flags |= XML_SCHEMA_ELEM_INFO_LOCAL_TYPE;
24981 (xmlSchemaIDCRegisterMatchers(vctxt, elemDecl) == -1))
24994 vctxt->inode->typeDef = actualType;
25000 xmlSchemaVAttributesSimple(xmlSchemaValidCtxtPtr vctxt)
25012 if (vctxt->nbAttrInfos == 0)
25014 for (i = 0; i < vctxt->nbAttrInfos; i++) {
25015 iattr = vctxt->attrInfos[i];
25018 xmlSchemaIllegalAttrErr(ACTXT_CAST vctxt,
25031 xmlSchemaClearAttrInfos(xmlSchemaValidCtxtPtr vctxt)
25036 if (vctxt->nbAttrInfos == 0)
25038 for (i = 0; i < vctxt->nbAttrInfos; i++) {
25039 attr = vctxt->attrInfos[i];
25056 vctxt->nbAttrInfos = 0;
25070 xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
25072 xmlSchemaTypePtr type = vctxt->inode->typeDef;
25104 nbAttrs = vctxt->nbAttrInfos;
25114 iattr = vctxt->attrInfos[j];
25167 tmpiattr = xmlSchemaGetFreshAttrInfo(vctxt);
25183 tmpiattr = xmlSchemaGetFreshAttrInfo(vctxt);
25199 if (vctxt->nbAttrInfos == 0)
25201 nbUses = vctxt->nbAttrInfos;
25211 iattr = vctxt->attrInfos[i];
25254 iattr->decl = xmlSchemaGetAttributeDecl(vctxt->schema,
25318 if (vctxt->nbAttrInfos == 0)
25325 if (vctxt->options & XML_SCHEMA_VAL_VC_I_CREATE) {
25326 xmlSchemaNodeInfoPtr ielem = vctxt->elemInfos[vctxt->depth];
25333 for (i = 0; i < vctxt->nbAttrInfos; i++) {
25334 iattr = vctxt->attrInfos[i];
25355 if (vctxt->xpathStates != NULL) {
25359 xpathRes = xmlSchemaXPathEvaluate(vctxt,
25454 ns = xmlNewNs(vctxt->validationRoot,
25476 if (vctxt->value != NULL) {
25480 xmlSchemaFreeValue(vctxt->value);
25481 vctxt->value = NULL;
25508 ACTXT_CAST vctxt,
25513 ACTXT_CAST vctxt,
25595 if (xmlSchemaXPathProcessHistory(vctxt,
25596 vctxt->depth +1) == -1) {
25601 } else if (vctxt->xpathStates != NULL)
25602 xmlSchemaXPathPop(vctxt);
25608 for (i = 0; i < vctxt->nbAttrInfos; i++) {
25609 iattr = vctxt->attrInfos[i];
25620 xmlSchemaCustomErr(ACTXT_CAST vctxt,
25635 xmlSchemaCustomErr(ACTXT_CAST vctxt,
25654 xmlSchemaIllegalAttrErr(ACTXT_CAST vctxt,
25657 xmlSchemaIllegalAttrErr(ACTXT_CAST vctxt,
25674 xmlSchemaValidateElemWildcard(xmlSchemaValidCtxtPtr vctxt,
25677 xmlSchemaWildcardPtr wild = (xmlSchemaWildcardPtr) vctxt->inode->decl;
25700 decl = xmlSchemaGetElem(vctxt->schema,
25701 vctxt->inode->localName, vctxt->inode->nsName);
25703 vctxt->inode->decl = decl;
25712 return (vctxt->err);
25714 if (vctxt->nbAttrInfos != 0) {
25722 iattr = xmlSchemaGetMetaAttrInfo(vctxt,
25725 if (xmlSchemaProcessXSIType(vctxt, iattr,
25726 &(vctxt->inode->typeDef), NULL) == -1) {
25743 vctxt->inode->typeDef =
25756 xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt,
25761 xmlSchemaNodeInfoPtr inode = vctxt->inode;
25804 ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST vctxt,
25809 ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST vctxt,
25820 xmlSchemaVContentModelCallback(xmlSchemaValidCtxtPtr vctxt ATTRIBUTE_UNUSED,
25848 xmlSchemaValidatorPushElem(xmlSchemaValidCtxtPtr vctxt)
25850 vctxt->inode = xmlSchemaGetFreshElemInfo(vctxt);
25851 if (vctxt->inode == NULL) {
25856 vctxt->nbAttrInfos = 0;
25861 xmlSchemaVCheckINodeDataType(xmlSchemaValidCtxtPtr vctxt,
25868 ACTXT_CAST vctxt, NULL,
25872 ACTXT_CAST vctxt, NULL,
25882 xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt)
25885 xmlSchemaNodeInfoPtr inode = vctxt->inode;
25887 if (vctxt->nbAttrInfos != 0)
25888 xmlSchemaClearAttrInfos(vctxt);
25895 vctxt->skipDepth = vctxt->depth -1;
25930 vctxt);
25955 xmlSchemaComplexTypeErr(ACTXT_CAST vctxt,
25983 if (vctxt->value != NULL) {
25984 xmlSchemaFreeValue(vctxt->value);
25985 vctxt->value = NULL;
25995 ret = xmlSchemaVCheckINodeDataType(vctxt,
25998 ret = xmlSchemaVCheckINodeDataType(vctxt,
26037 ret = xmlSchemaCheckCOSValidDefault(vctxt,
26062 ret = xmlSchemaVCheckINodeDataType(vctxt,
26065 ret = xmlSchemaVCheckINodeDataType(vctxt,
26082 if ((vctxt->options & XML_SCHEMA_VAL_VC_I_CREATE) &&
26119 ret = xmlSchemaVCheckINodeDataType(vctxt,
26134 ret = xmlSchemaVCheckINodeDataType(vctxt,
26190 xmlSchemaCustomErr(ACTXT_CAST vctxt,
26213 xmlSchemaCustomErr(ACTXT_CAST vctxt,
26227 if (vctxt->depth < 0) {
26231 if (vctxt->depth == vctxt->skipDepth)
26232 vctxt->skipDepth = -1;
26237 (xmlSchemaXPathProcessHistory(vctxt, vctxt->depth) == -1))
26256 (vctxt->hasKeyrefs || vctxt->createIDCNodeTables))
26258 if (xmlSchemaIDCFillNodeTables(vctxt, inode) == -1)
26264 if (vctxt->inode->hasKeyrefs)
26265 if (xmlSchemaCheckCVCIDCKeyRef(vctxt) == -1)
26277 if ((vctxt->depth > 0) &&
26278 (vctxt->hasKeyrefs || vctxt->createIDCNodeTables))
26283 if (xmlSchemaBubbleIDCNodeTables(vctxt) == -1)
26292 xmlSchemaClearElemInfo(vctxt, inode);
26296 if (vctxt->depth == 0) {
26297 vctxt->depth--;
26298 vctxt->inode = NULL;
26304 if (vctxt->aidcs != NULL) {
26305 xmlSchemaIDCAugPtr aidc = vctxt->aidcs;
26307 if (aidc->keyrefDepth == vctxt->depth) {
26318 vctxt->depth--;
26319 vctxt->inode = vctxt->elemInfos[vctxt->depth];
26327 vctxt->err = -1;
26336 xmlSchemaValidateChildElem(xmlSchemaValidCtxtPtr vctxt)
26342 if (vctxt->depth <= 0) {
26347 pielem = vctxt->elemInfos[vctxt->depth -1];
26374 vctxt->inode->decl = xmlSchemaGetElem(vctxt->schema,
26375 vctxt->inode->localName,
26376 vctxt->inode->nsName);
26378 if (vctxt->inode->decl == NULL) {
26384 iattr = xmlSchemaGetMetaAttrInfo(vctxt,
26387 ret = xmlSchemaProcessXSIType(vctxt, iattr,
26388 &(vctxt->inode->typeDef), NULL);
26409 vctxt->inode->typeDef =
26462 vctxt);
26484 vctxt->inode->localName,
26485 vctxt->inode->nsName,
26486 vctxt->inode);
26491 vctxt->inode->localName, pielem->localName);
26495 vctxt->inode->localName, pielem->localName);
26497 if (vctxt->err == XML_SCHEMAV_INTERNAL) {
26505 xmlSchemaComplexTypeErr(ACTXT_CAST vctxt,
26509 ret = vctxt->err;
26538 ret = vctxt->err;
26551 vctxt->skipDepth = vctxt->depth;
26552 vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_ERR_NOT_EXPECTED;
26562 xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt,
26577 if (INODE_NILLED(vctxt->inode)) {
26586 return (vctxt->err);
26593 if (vctxt->inode->typeDef->contentType ==
26598 return (vctxt->err);
26601 if (vctxt->inode->typeDef->contentType ==
26616 return (vctxt->err);
26628 if ((vctxt->inode->typeDef->contentType == XML_SCHEMA_CONTENT_MIXED) &&
26629 ((vctxt->inode->decl == NULL) ||
26630 (vctxt->inode->decl->value == NULL)))
26633 if (vctxt->inode->value == NULL) {
26642 vctxt->inode->value = value;
26649 vctxt->inode->value = value;
26652 vctxt->inode->flags |=
26661 vctxt->inode->value = BAD_CAST xmlStrndup(value, len);
26663 vctxt->inode->value = BAD_CAST xmlStrdup(value);
26664 vctxt->inode->flags |=
26676 if (vctxt->inode->flags & XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES) {
26677 vctxt->inode->value = BAD_CAST xmlStrncat(
26678 (xmlChar *) vctxt->inode->value, value, len);
26680 vctxt->inode->value =
26681 BAD_CAST xmlStrncatNew(vctxt->inode->value, value, len);
26682 vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES;
26690 xmlSchemaValidateElem(xmlSchemaValidCtxtPtr vctxt)
26694 if ((vctxt->skipDepth != -1) &&
26695 (vctxt->depth >= vctxt->skipDepth)) {
26700 if (vctxt->xsiAssemble) {
26711 ret = xmlSchemaAssembleByXSI(vctxt);
26715 vctxt->skipDepth = 0;
26719 if (vctxt->depth > 0) {
26724 ret = xmlSchemaValidateChildElem(vctxt);
26733 if (vctxt->depth == vctxt->skipDepth)
26735 if ((vctxt->inode->decl == NULL) &&
26736 (vctxt->inode->typeDef == NULL)) {
26746 vctxt->inode->decl = xmlSchemaGetElem(vctxt->schema,
26747 vctxt->inode->localName,
26748 vctxt->inode->nsName);
26749 if (vctxt->inode->decl == NULL) {
26758 if (vctxt->inode->decl == NULL)
26761 if (vctxt->inode->decl->type == XML_SCHEMA_TYPE_ANY) {
26766 ret = xmlSchemaValidateElemWildcard(vctxt, &skip);
26776 vctxt->skipDepth = vctxt->depth;
26783 if (vctxt->inode->decl->type != XML_SCHEMA_TYPE_ELEMENT) {
26787 vctxt->inode->decl = NULL;
26794 ret = xmlSchemaValidateElemDecl(vctxt);
26808 if (vctxt->inode->typeDef == NULL) {
26809 vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_ERR_BAD_TYPE;
26815 if (vctxt->inode->typeDef->flags & XML_SCHEMAS_TYPE_ABSTRACT) {
26816 vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_ERR_BAD_TYPE;
26827 if (vctxt->xpathStates != NULL) {
26828 ret = xmlSchemaXPathEvaluate(vctxt, XML_ELEMENT_NODE);
26829 vctxt->inode->appliedXPath = 1;
26839 if (WXS_IS_COMPLEX(vctxt->inode->typeDef)) {
26840 if ((vctxt->nbAttrInfos != 0) ||
26841 (vctxt->inode->typeDef->attrUses != NULL)) {
26843 ret = xmlSchemaVAttributesComplex(vctxt);
26845 } else if (vctxt->nbAttrInfos != 0) {
26847 ret = xmlSchemaVAttributesSimple(vctxt);
26852 if (vctxt->nbAttrInfos != 0)
26853 xmlSchemaClearAttrInfos(vctxt);
26866 vctxt->skipDepth = vctxt->depth;
26874 xmlSchemaVReaderWalk(xmlSchemaValidCtxtPtr vctxt)
26880 vctxt->depth = -1;
26881 ret = xmlTextReaderRead(vctxt->reader);
26886 nodeType = xmlTextReaderNodeType(vctxt->reader);
26889 ret = xmlTextReaderRead(vctxt->reader);
26896 depth = xmlTextReaderDepth(vctxt->reader);
26897 nodeType = xmlTextReaderNodeType(vctxt->reader);
26901 vctxt->depth++;
26902 if (xmlSchemaValidatorPushElem(vctxt) == -1) {
26907 ielem = vctxt->inode;
26908 ielem->localName = xmlTextReaderLocalName(vctxt->reader);
26909 ielem->nsName = xmlTextReaderNamespaceUri(vctxt->reader);
26914 ret = xmlTextReaderIsEmptyElement(vctxt->reader);
26926 vctxt->nbAttrInfos = 0;
26927 ret = xmlTextReaderMoveToFirstAttribute(vctxt->reader);
26939 if (xmlSchemaValidatorPushAttribute(vctxt, NULL,
26940 (const xmlChar *) xmlTextReaderLocalName(vctxt->reader),
26941 xmlTextReaderNamespaceUri(vctxt->reader), 1,
26942 xmlTextReaderValue(vctxt->reader), 1) == -1) {
26948 ret = xmlTextReaderMoveToNextAttribute(vctxt->reader);
26958 ret = xmlTextReaderMoveToElement(vctxt->reader);
26968 ret= xmlSchemaValidateElem(vctxt);
26977 if (vctxt->depth == vctxt->skipDepth) {
26983 ret = xmlTextReaderRead(vctxt->reader);
26984 curDepth = xmlTextReaderDepth(vctxt->reader);
26986 ret = xmlTextReaderRead(vctxt->reader);
26987 curDepth = xmlTextReaderDepth(vctxt->reader);
27010 ret = xmlSchemaValidatorPopElem(vctxt);
27019 if (vctxt->depth >= 0)
27020 ielem = vctxt->inode;
27035 value = xmlTextReaderValue(vctxt->reader);
27036 ret = xmlSchemaVPushText(vctxt, nodeType, BAD_CAST value,
27055 ret = xmlTextReaderRead(vctxt->reader);
27079 xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
27081 if (vctxt->depth < 0)
27083 if ((vctxt->skipDepth != -1) && (vctxt->depth >= vctxt->skipDepth))
27085 if (vctxt->inode->flags & XML_SCHEMA_ELEM_INFO_EMPTY)
27086 vctxt->inode->flags ^= XML_SCHEMA_ELEM_INFO_EMPTY;
27087 if (xmlSchemaVPushText(vctxt, XML_TEXT_NODE, ch, len,
27091 vctxt->err = -1;
27092 xmlStopParser(vctxt->parserCtxt);
27104 xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
27106 if (vctxt->depth < 0)
27108 if ((vctxt->skipDepth != -1) && (vctxt->depth >= vctxt->skipDepth))
27110 if (vctxt->inode->flags & XML_SCHEMA_ELEM_INFO_EMPTY)
27111 vctxt->inode->flags ^= XML_SCHEMA_ELEM_INFO_EMPTY;
27112 if (xmlSchemaVPushText(vctxt, XML_CDATA_SECTION_NODE, ch, len,
27116 vctxt->err = -1;
27117 xmlStopParser(vctxt->parserCtxt);
27125 xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
27127 if (vctxt->depth < 0)
27129 if ((vctxt->skipDepth != -1) && (vctxt->depth >= vctxt->skipDepth))
27146 xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
27157 vctxt->depth++;
27158 if ((vctxt->skipDepth != -1) && (vctxt->depth >= vctxt->skipDepth))
27163 if (xmlSchemaValidatorPushElem(vctxt) == -1) {
27168 ielem = vctxt->inode;
27172 ielem->nodeLine = xmlSAX2GetLineNumber(vctxt->parserCtxt);
27193 xmlSchemaVErrMemory(vctxt,
27207 xmlSchemaVErrMemory(vctxt,
27243 ret = xmlSchemaValidatorPushAttribute(vctxt,
27256 ret = xmlSchemaValidateElem(vctxt);
27269 vctxt->err = -1;
27270 xmlStopParser(vctxt->parserCtxt);
27280 xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
27286 if (vctxt->skipDepth != -1) {
27287 if (vctxt->depth > vctxt->skipDepth) {
27288 vctxt->depth--;
27291 vctxt->skipDepth = -1;
27296 if ((!xmlStrEqual(vctxt->inode->localName, localname)) ||
27297 (!xmlStrEqual(vctxt->inode->nsName, URI))) {
27301 res = xmlSchemaValidatorPopElem(vctxt);
27313 vctxt->err = -1;
27314 xmlStopParser(vctxt->parserCtxt);
27358 xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt)
27360 if (vctxt == NULL)
27368 vctxt->flags = 0;
27369 vctxt->validationRoot = NULL;
27370 vctxt->doc = NULL;
27372 vctxt->reader = NULL;
27374 vctxt->hasKeyrefs = 0;
27376 if (vctxt->value != NULL) {
27377 xmlSchemaFreeValue(vctxt->value);
27378 vctxt->value = NULL;
27383 if (vctxt->aidcs != NULL) {
27384 xmlSchemaIDCAugPtr cur = vctxt->aidcs, next;
27390 vctxt->aidcs = NULL;
27392 if (vctxt->idcMatcherCache != NULL) {
27393 xmlSchemaIDCMatcherPtr matcher = vctxt->idcMatcherCache, tmp;
27400 vctxt->idcMatcherCache = NULL;
27404 if (vctxt->idcNodes != NULL) {
27408 for (i = 0; i < vctxt->nbIdcNodes; i++) {
27409 item = vctxt->idcNodes[i];
27413 xmlFree(vctxt->idcNodes);
27414 vctxt->idcNodes = NULL;
27415 vctxt->nbIdcNodes = 0;
27416 vctxt->sizeIdcNodes = 0;
27421 if (vctxt->xpathStates != NULL) {
27422 xmlSchemaFreeIDCStateObjList(vctxt->xpathStates);
27423 vctxt->xpathStates = NULL;
27428 if (vctxt->nbAttrInfos != 0) {
27429 xmlSchemaClearAttrInfos(vctxt);
27434 if (vctxt->elemInfos != NULL) {
27438 for (i = 0; i < vctxt->sizeElemInfos; i++) {
27439 ei = vctxt->elemInfos[i];
27442 xmlSchemaClearElemInfo(vctxt, ei);
27445 xmlSchemaItemListClear(vctxt->nodeQNames);
27447 xmlDictFree(vctxt->dict);
27452 vctxt->dict = xmlDictCreate();
27683 xmlSchemaVDocWalk(xmlSchemaValidCtxtPtr vctxt)
27692 valRoot = xmlDocGetRootElement(vctxt->doc);
27698 vctxt->depth = -1;
27699 vctxt->validationRoot = valRoot;
27702 if ((vctxt->skipDepth != -1) && (vctxt->depth >= vctxt->skipDepth))
27709 vctxt->depth++;
27710 if (xmlSchemaValidatorPushElem(vctxt) == -1)
27712 ielem = vctxt->inode;
27724 vctxt->nbAttrInfos = 0;
27732 ret = xmlSchemaValidatorPushAttribute(vctxt,
27752 ret = xmlSchemaValidateElem(vctxt);
27765 if ((vctxt->skipDepth != -1) &&
27766 (vctxt->depth >= vctxt->skipDepth))
27775 ret = xmlSchemaVPushText(vctxt, node->type, node->content,
27815 if (node != vctxt->inode->node) {
27820 ret = xmlSchemaValidatorPopElem(vctxt);
27847 xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) {
27851 vctxt->err = 0;
27852 vctxt->nberrors = 0;
27853 vctxt->depth = -1;
27854 vctxt->skipDepth = -1;
27855 vctxt->xsiAssemble = 0;
27856 vctxt->hasKeyrefs = 0;
27858 vctxt->createIDCNodeTables = 1;
27860 vctxt->createIDCNodeTables = 0;
27865 if (vctxt->schema == NULL) {
27868 vctxt->xsiAssemble = 1;
27875 if ((vctxt->pctxt == NULL) &&
27876 (xmlSchemaCreatePCtxtOnVCtxt(vctxt) == -1))
27878 pctxt = vctxt->pctxt;
27883 vctxt->schema = xmlSchemaNewSchema(pctxt);
27884 if (vctxt->schema == NULL)
27892 pctxt->constructor->mainSchema = vctxt->schema;
27901 if (vctxt->schema->idcDef != NULL) {
27902 xmlHashScan(vctxt->schema->idcDef,
27903 (xmlHashScanner) xmlSchemaAugmentIDC, vctxt);
27909 xmlSchemaPostRun(xmlSchemaValidCtxtPtr vctxt) {
27910 if (vctxt->xsiAssemble) {
27911 if (vctxt->schema != NULL) {
27912 xmlSchemaFree(vctxt->schema);
27913 vctxt->schema = NULL;
27916 xmlSchemaClearValidCtxt(vctxt);
27920 xmlSchemaVStart(xmlSchemaValidCtxtPtr vctxt)
27924 if (xmlSchemaPreRun(vctxt) < 0)
27927 if (vctxt->doc != NULL) {
27931 ret = xmlSchemaVDocWalk(vctxt);
27933 } else if (vctxt->reader != NULL) {
27938 ret = xmlSchemaVReaderWalk(vctxt);
27941 } else if ((vctxt->sax != NULL) && (vctxt->parserCtxt != NULL)) {
27945 ret = xmlParseDocument(vctxt->parserCtxt);
27952 xmlSchemaPostRun(vctxt);
27954 ret = vctxt->err;