Home | History | Annotate | Download | only in libxml2

Lines Matching full:schema

2  * schemas.c : implementation of the XML Schema handling and
3 * schema validity checking
15 * - if we don't intend to use the schema for schemas, we
16 * need to validate all schema attributes (ref, type, name)
21 * - For xsi-driven schema acquisition, augment the IDCs after every
29 * - http://lists.w3.org/Archives/Public/www-xml-schema-comments/2005JulSep/0337.html
36 * Schema Component Constraint:
45 * is schema construction via an API is implemented.
205 * Macros for schema buckets.
299 #define WXS_SCHEMA(ctx) (ctx)->schema
340 * Some flags used for various schema constraints.
379 * Used to create a graph of schema relationships.
413 * Reflects a schema. Holds some information
414 * about the schema and its toplevel components. Duplicate
422 const xmlChar *schemaLocation; /* The URI of the schema document. */
427 * targetNamespace of the including schema.
430 xmlDocPtr doc; /* The schema node-tree. */
439 /* The imported schema. */
440 xmlSchemaPtr schema;
463 /* The owning main or import schema bucket. */
470 * The abstract base type for schema components.
481 * The abstract base type for annotated schema components.
494 * The abstract base type for tree-like structured schema components.
511 * The abstract base type for tree-like structured schema components.
562 xmlSchemaBucketPtr targetBucket; /* The redefined schema. */
571 xmlSchemaPtr mainSchema; /* The main schema. */
572 xmlSchemaBucketPtr mainBucket; /* The main schema bucket */
574 xmlSchemaItemListPtr buckets; /* List of schema buckets. */
575 /* xmlSchemaItemListPtr relations; */ /* List of schema relations. */
576 xmlSchemaBucketPtr bucket; /* The current schema bucket */
602 xmlSchemaPtr schema; /* The main schema in use */
629 xmlSchemaBucketPtr redefined; /* The schema to be redefined. */
639 * A component reference item (not a schema component)
971 xmlSchemaPtr schema; /* The schema in use */
1052 xmlSchemaPtr schema,
1055 xmlSchemaPtr schema,
1063 xmlSchemaParseImport(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
1073 xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
1096 xmlSchemaPtr schema,
1107 * @type: the type of the schema item
1109 * Returns the component name of a schema item.
1157 return(BAD_CAST "Not a schema component");
1163 * @type: the type of the schema item
1165 * Returns the component name of a schema item.
1183 * @item: a schema component
1185 * Returns node associated with the schema component.
1188 * one-to-one relationship between the XML Schema representation and
1235 * @item: a schema component
1237 * Returns the next sibling of the schema component.
2229 * VAL TODO: The output of the given schema component is currently
2743 * @ctxt: the schema validation context
2746 * @ownerItem: the owner as a schema object
2777 * @ctxt: the schema validation context
2780 * @ownerItem: the owner as a schema object
2788 * to schema components.
2818 * @ctxt: the schema parser context
2821 * @ownerItem: the owner as a schema object
2859 * @ctxt: the schema parser context
2886 * @ctxt: the schema parser context
2888 * @itemDes: the designation of the schema item
2889 * @item: the schema item
2890 * @itemElem: the node of the schema item
2924 * @ctxt: the schema parser context
2926 * @itemDes: the designation of the schema item
2927 * @item: the schema item
2928 * @itemElem: the node of the schema item
2948 * @ctxt: the schema parser context
2950 * @itemDes: the designation of the schema type
2951 * @item: the schema type
2952 * @itemElem: the node of the schema type
2953 * @attr: the invalid schema attribute
2987 * @ctxt: the schema parser context
2989 * @type: the schema type
3017 * @ctxt: the schema parser context
3019 * @itemDes: the designation of the schema item involved
3020 * @item: the schema item involved
3043 * @ctxt: the schema validation context
3070 * @ctxt: the schema validation context
3074 * @ownerItem: the schema object if existent
3160 * @ctxt: the schema parser context
3169 * Reports an error concerning the content of a schema element.
3225 * @ctxt: a schema validation context
3227 * Allocate a new Schema structure.
3238 xmlSchemaPErrMemory(ctxt, "allocating schema", NULL);
3271 * @ctxt: a schema validation context
3480 * @annot: a schema type structure
3519 if (WXS_IMPBUCKET(bucket)->schema != NULL)
3520 xmlSchemaFree(WXS_IMPBUCKET(bucket)->schema);
3535 "no main schema on constructor");
3539 /* Create the schema bucket. */
3546 xmlSchemaPErrMemory(NULL, "allocating schema bucket", NULL);
3564 * XML_SCHEMA_SCHEMA_MAIN and it points to the *main* schema.
3578 /* Point to the *main* schema. */
3580 WXS_IMPBUCKET(ret)->schema = mainSchema;
3582 * Ensure that the main schema gets a targetNamespace.
3593 * Create a schema for imports and assign the
3596 WXS_IMPBUCKET(ret)->schema = xmlSchemaNewSchema(pctxt);
3597 if (WXS_IMPBUCKET(ret)->schema == NULL) {
3601 WXS_IMPBUCKET(ret)->schema->targetNamespace = targetNamespace;
3607 * Imports go into the "schemasImports" slot of the main *schema*.
3608 * Note that we create an import entry for the main schema as well; i.e.,
3609 * even if there's only one schema, we'll get an import.
3627 "failed to add the schema bucket to the hash");
3640 /* Includes got into the "includes" slot of the *main* schema. */
3652 * during schema construction time only.
3673 * @annot: a schema type structure
3697 * @schema: a schema notation structure
3699 * Deallocate a Schema Notation structure.
3761 * set: a schema wildcard namespace
3799 * @schema: a schema attribute group structure
3801 * Deallocate a Schema Attribute Group structure.
3897 * @schema: a schema element structure
3899 * Deallocate a Schema Element structure.
3917 * @facet: a schema facet structure
3919 * Deallocate a Schema Facet structure.
3937 * @type: a schema type structure
3939 * Deallocate a Schema Type structure.
3979 * @item: a schema model group definition
3981 * Deallocates a schema model group definition.
3993 * @item: a schema model group
3995 * Deallocates a schema model group structure.
4086 * @schema: a schema structure
4088 * Deallocate a Schema structure.
4091 xmlSchemaFree(xmlSchemaPtr schema)
4093 if (schema == NULL)
4096 if (schema->volatiles != NULL)
4100 * schema components anymore; this will now be done by
4101 * the schema buckets.
4103 if (schema->notaDecl != NULL)
4104 xmlHashFree(schema->notaDecl, NULL);
4105 if (schema->attrDecl != NULL)
4106 xmlHashFree(schema->attrDecl, NULL);
4107 if (schema->attrgrpDecl != NULL)
4108 xmlHashFree(schema->attrgrpDecl, NULL);
4109 if (schema->elemDecl != NULL)
4110 xmlHashFree(schema->elemDecl, NULL);
4111 if (schema->typeDecl != NULL)
4112 xmlHashFree(schema->typeDecl, NULL);
4113 if (schema->groupDecl != NULL)
4114 xmlHashFree(schema->groupDecl, NULL);
4115 if (schema->idcDef != NULL)
4116 xmlHashFree(schema->idcDef, NULL);
4118 if (schema->schemasImports != NULL)
4119 xmlHashFree(schema->schemasImports,
4121 if (schema->includes != NULL) {
4122 xmlSchemaItemListPtr list = (xmlSchemaItemListPtr) schema->includes;
4129 if (schema->annot != NULL)
4130 xmlSchemaFreeAnnot(schema->annot);
4133 xmlDictFree(schema->dict);
4134 xmlFree(schema);
4258 * @particle: the schema particle
4478 * @schema: a schema structure
4480 * Dump a Schema structure.
4483 xmlSchemaDump(FILE * output, xmlSchemaPtr schema)
4487 if (schema == NULL) {
4492 if (schema->name != NULL)
4493 fprintf(output, "%s, ", schema->name);
4496 if (schema->targetNamespace != NULL)
4497 fprintf(output, "%s", (const char *) schema->targetNamespace);
4501 if (schema->annot != NULL)
4502 xmlSchemaAnnotDump(output, schema->annot);
4503 xmlHashScan(schema->typeDecl, (xmlHashScanner) xmlSchemaTypeDump,
4505 xmlHashScanFull(schema->elemDecl,
4701 if (xmlStrEqual(nsName, schema->targetNamespace)) { \
4702 ret = xmlHashLookup(schema->slot, name); \
4705 if (xmlHashSize(schema->schemasImports) > 1) { \
4708 import = xmlHashLookup(schema->schemasImports, \
4711 import = xmlHashLookup(schema->schemasImports, nsName); \
4714 ret = xmlHashLookup(import->schema->slot, name); \
4719 * @schema: the schema context
4723 * Lookup a global element declaration in the schema.
4728 xmlSchemaGetElem(xmlSchemaPtr schema, const xmlChar * name,
4733 if ((name == NULL) || (schema == NULL))
4735 if (schema != NULL) {
4753 * @schema: the main schema
4762 xmlSchemaGetType(xmlSchemaPtr schema, const xmlChar * name,
4781 if (schema != NULL) {
4800 * @schema: the context of the schema
4804 * Lookup a an attribute in the schema or imported schemas
4809 xmlSchemaGetAttributeDecl(xmlSchemaPtr schema, const xmlChar * name,
4814 if ((name == NULL) || (schema == NULL))
4816 if (schema != NULL) {
4834 * @schema: the context of the schema
4838 * Lookup a an attribute group in the schema or imported schemas
4843 xmlSchemaGetAttributeGroup(xmlSchemaPtr schema, const xmlChar * name,
4848 if ((name == NULL) || (schema == NULL))
4850 if (schema != NULL) {
4874 * @schema: the context of the schema
4878 * Lookup a group in the schema or imported schemas
4883 xmlSchemaGetGroup(xmlSchemaPtr schema, const xmlChar * name,
4888 if ((name == NULL) || (schema == NULL))
4890 if (schema != NULL) {
4908 xmlSchemaGetNotation(xmlSchemaPtr schema,
4914 if ((name == NULL) || (schema == NULL))
4916 if (schema != NULL) {
4924 xmlSchemaGetIDC(xmlSchemaPtr schema,
4930 if ((name == NULL) || (schema == NULL))
4932 if (schema != NULL) {
4941 * @schema: the schema
4945 * Lookup a group in the schema or imported schemas
4950 xmlSchemaGetNamedComponent(xmlSchemaPtr schema,
4957 return ((xmlSchemaBasicItemPtr) xmlSchemaGetGroup(schema,
4960 return ((xmlSchemaBasicItemPtr) xmlSchemaGetElem(schema,
5076 * in the same schema, but avoids at least circularity.
5096 * @ctxt: a schema parser context
5097 * @schema: the schema being built
5100 * Add an XML schema annotation declaration
5106 xmlSchemaAddNotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
5112 if ((ctxt == NULL) || (schema == NULL) || (name == NULL))
5132 * @ctxt: a schema parser context
5133 * @schema: the schema being built
5137 * Add an XML schema Attrribute declaration
5143 xmlSchemaAddAttribute(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
5149 if ((ctxt == NULL) || (schema == NULL))
5173 * @ctxt: a schema parser context
5174 * @schema: the schema being built
5178 * Add an XML schema Attrribute declaration
5243 * @ctxt: a schema parser context
5244 * @schema: the schema being built
5249 * Add an XML schema Attrribute Group definition.
5255 xmlSchemaPtr schema ATTRIBUTE_UNUSED,
5295 * @ctxt: a schema parser context
5296 * @schema: the schema being built
5300 * Add an XML schema Element declaration
5336 * @ctxt: a schema parser context
5337 * @schema: the schema being built
5341 * Add an XML schema item
5347 xmlSchemaAddType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
5354 if ((ctxt == NULL) || (schema == NULL))
5406 * Store the reference item in the schema.
5433 * @ctxt: a schema parser context
5434 * @schema: the schema being built
5436 * @node: the node in the schema doc
5438 * Adds a schema model group
5445 xmlSchemaPtr schema,
5451 if ((ctxt == NULL) || (schema == NULL))
5474 * @ctxt: a schema parser context
5475 * @schema: the schema being built
5476 * @node: the corresponding node in the schema doc
5480 * Adds an XML schema particle component.
5523 * @ctxt: a schema validation context
5524 * @schema: the schema being built
5527 * Add an XML schema Group definition
5533 xmlSchemaPtr schema,
5540 if ((ctxt == NULL) || (schema == NULL) || (name == NULL))
5571 * @ctxt: a schema validation context
5594 xmlSchemaAddIDC(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
5600 if ((ctxt == NULL) || (schema == NULL) || (name == NULL))
5627 * @ctxt: a schema validation context
5628 * @schema: a schema
5636 xmlSchemaAddWildcard(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
5641 if ((ctxt == NULL) || (schema == NULL))
5717 * @pctxt: a schema parser context
5753 * @ctxt: a schema parser context
5754 * @schema: the schema context
5756 * @ownerItem: the parent as a schema object
5763 * should resolve to schema components.
5770 xmlSchemaPtr schema,
5799 else if (schema->flags & XML_SCHEMAS_INCLUDING_CONVERT_NS) {
5834 * @ctxt: a schema parser context
5835 * @schema: the schema context
5837 * @ownerItem: the owner as a schema object
5844 * should resolve to schema components.
5851 xmlSchemaPtr schema,
5860 return (xmlSchemaPValAttrNodeQNameValue(ctxt, schema,
5866 * @ctxt: a schema parser context
5867 * @schema: the schema context
5869 * @ownerItem: the owner as a schema object
5882 xmlSchemaPtr schema,
5897 return (xmlSchemaPValAttrNodeQName(ctxt, schema,
5903 * @ctxt: a schema parser context
5904 * @schema: the schema context
5906 * @ownerItem: the owner as a schema object
5986 * @ctxt: a schema validation context
5987 * @node: a subtree containing XML Schema informations
6051 * @ctxt: a schema validation context
6052 * @node: a subtree containing XML Schema informations
6103 * @ctxt: a schema validation context
6105 * @ownerItem: the owner as a schema item
6149 * @ctxt: a schema validation context
6150 * @node: a subtree containing XML Schema informations
6199 ctxt, xmlSchemaPtr schema,
6204 xmlSchemaPtr schema,
6209 xmlSchemaPtr schema,
6214 xmlSchemaPtr schema,
6219 xmlSchemaPtr schema,
6223 xmlSchemaPtr schema, xmlNodePtr node);
6228 * @ctxt: a schema parser context
6230 * @ownerItem: the schema object owner if existent
6231 * @attr: the schema attribute node being validated
6237 * of schema attribute values during parsing of the schema.
6275 "parsing a schema");
6284 "failed to validate a schema attribute value");
6301 * @ctxt: a schema parser context
6303 * @ownerItem: the schema object owner if existent
6304 * @attr: the schema attribute node being validated
6310 * of schema attribute values during parsing of the schema.
6338 * @ctxt: a schema parser context
6341 * @ownerItem: the schema object owner if existent
6343 * @name: the name of the schema attribute node
6349 * of schema attribute values during parsing of the schema.
6391 xmlSchemaPtr schema ATTRIBUTE_UNUSED,
6424 "References from this schema to components in no "
6430 "References from this schema to components in the "
6439 * @ctxt: a schema validation context
6440 * @schema: the schema being built
6441 * @node: a subtree containing XML Schema informations
6448 xmlSchemaParseLocalAttributes(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
6457 item = xmlSchemaParseLocalAttribute(ctxt, schema, *child,
6460 item = xmlSchemaParseAttributeGroupRef(ctxt, schema, *child);
6481 * @ctxt: a schema validation context
6482 * @schema: the schema being built
6483 * @node: a subtree containing XML Schema informations
6485 * parse a XML schema Attrribute declaration
6504 * {any attributes with non-schema namespace . . .}>
6535 * {any attributes with non-schema namespace . . .}>
6557 * {any attributes with non-schema namespace . . .}>
6601 * @ctxt: a schema validation context
6602 * @schema: the schema being built
6603 * @node: a subtree containing XML Schema informations
6605 * parse a XML schema Facet declaration
6611 xmlSchemaParseFacet(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
6618 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
6692 * @ctxt: a schema parser context
6694 * @node: a subtree containing XML Schema informations
6705 xmlSchemaPtr schema ATTRIBUTE_UNUSED,
6829 * 3.9.6 Schema Component Constraint: Particle Correct
6859 * @ctxt: a schema validation context
6860 * @schema: the schema being built
6861 * @node: a subtree containing XML Schema informations
6863 * Parsea a XML schema <any> element. A particle and wildcard
6871 xmlSchemaParseAny(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
6881 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
6915 wild = xmlSchemaAddWildcard(ctxt, schema, XML_SCHEMA_TYPE_ANY, node);
6918 xmlSchemaParseWildcardNs(ctxt, schema, wild, node);
6954 * @ctxt: a schema validation context
6955 * @schema: the schema being built
6956 * @node: a subtree containing XML Schema informations
6958 * parse a XML schema Notation declaration
6963 xmlSchemaParseNotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
6970 schema == NULL) || (node == NULL))
6978 ret = xmlSchemaAddNotation(ctxt, schema, name,
7001 * @ctxt: a schema validation context
7002 * @schema: the schema being built
7003 * @node: a subtree containing XML Schema informations
7005 * parse a XML schema AnyAttrribute declaration
7012 xmlSchemaPtr schema, xmlNodePtr node)
7018 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
7021 ret = xmlSchemaAddWildcard(ctxt, schema, XML_SCHEMA_TYPE_ANY_ATTRIBUTE,
7048 if (xmlSchemaParseWildcardNs(ctxt, schema, ret, node) != 0)
7071 * @ctxt: a schema validation context
7072 * @schema: the schema being built
7073 * @node: a subtree containing XML Schema informations
7075 * parse a XML schema Attrribute declaration
7082 xmlSchemaPtr schema,
7102 if ((pctxt == NULL) || (schema == NULL) || (node == NULL))
7106 if (xmlSchemaPValAttrNodeQName(pctxt, schema,
7110 if (xmlSchemaCheckReference(pctxt, schema, node, attr, tmpNs) != 0)
7135 xmlSchemaPValAttrNodeQName(pctxt, schema, NULL,
7238 if ((! hasForm) && (schema->flags & XML_SCHEMAS_QUALIF_ATTR))
7241 * 3.2.6 Schema Component Constraint: xsi: Not Allowed
7262 * 3.2.6 Schema Component Constraint: xmlns Not Allowed
7286 attrDecl = xmlSchemaAddAttribute(pctxt, schema, name, ns, node, 0);
7459 xmlSchemaParseSimpleType(pctxt, schema, child, 0);
7474 xmlSchemaPtr schema,
7483 * Note that the w3c spec assumes the schema to be validated with schema
7488 if ((pctxt == NULL) || (schema == NULL) || (node == NULL))
7505 * 3.2.6 Schema Component Constraint: xmlns Not Allowed
7518 * 3.2.6 Schema Component Constraint: xsi: Not Allowed
7521 * if we have a schema construction API.
7530 ret = xmlSchemaAddAttribute(pctxt, schema, attrValue,
7557 xmlSchemaPValAttrQName(pctxt, schema, NULL,
7601 ret->subtypes = xmlSchemaParseSimpleType(pctxt, schema, child, 0);
7614 * @ctxt: a schema validation context
7615 * @schema: the schema being built
7616 * @node: a subtree containing XML Schema informations
7627 xmlSchemaPtr schema,
7635 if ((pctxt == NULL) || (schema == NULL) || (node == NULL))
7645 xmlSchemaPValAttrNodeQName(pctxt, schema,
7647 if (xmlSchemaCheckReference(pctxt, schema, node, attr, refNs) != 0)
7747 * @pctxt: a schema validation context
7748 * @schema: the schema being built
7749 * @node: a subtree containing XML Schema informations
7751 * parse a XML schema Attribute Group declaration
7758 xmlSchemaPtr schema,
7767 if ((pctxt == NULL) || (schema == NULL) || (node == NULL))
7785 ret = xmlSchemaAddAttributeGroupDefinition(pctxt, schema,
7820 if (xmlSchemaParseLocalAttributes(pctxt, schema, &child,
7831 schema, child);
7981 * Schema Component Constraint: Selector Value OK
8082 * @item: the schema component
8085 * Adds the annotation to the given schema component.
8170 "The item is not a annotated schema component", NULL);
8178 * @ctxt: a schema validation context
8179 * @schema: the schema being built
8180 * @node: a subtree containing XML Schema informations
8182 * Parses a XML Schema identity-contraint definition's
8276 * @ctxt: a schema validation context
8277 * @schema: the schema being built
8278 * @node: a subtree containing XML Schema informations
8280 * Parses a XML Schema identity-contraint definition.
8286 xmlSchemaPtr schema,
8332 item = xmlSchemaAddIDC(ctxt, schema, name, targetNamespace,
8356 xmlSchemaPValAttrNodeQName(ctxt, schema,
8360 xmlSchemaCheckReference(ctxt, schema, node, attr,
8423 * @ctxt: a schema validation context
8424 * @schema: the schema being built
8425 * @node: a subtree containing XML Schema informations
8428 * Parses a XML schema element declaration.
8435 xmlSchemaParseElement(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
8449 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
8503 xmlSchemaPValAttrNodeQName(ctxt, schema,
8505 xmlSchemaCheckReference(ctxt, schema, node, attr, refNs);
8596 } else if (schema->flags & XML_SCHEMAS_QUALIF_ELEM)
8649 xmlSchemaPValAttrQName(ctxt, schema,
8659 if (schema->flags & XML_SCHEMAS_FINAL_DEFAULT_EXTENSION)
8661 if (schema->flags & XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION)
8685 if (schema->flags & XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION)
8687 if (schema->flags & XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION)
8689 if (schema->flags & XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION)
8711 xmlSchemaPValAttrNodeQName(ctxt, schema,
8714 xmlSchemaCheckReference(ctxt, schema, node,
8750 WXS_ELEM_TYPEDEF(decl) = xmlSchemaParseComplexType(ctxt, schema, child, 0);
8765 WXS_ELEM_TYPEDEF(decl) = xmlSchemaParseSimpleType(ctxt, schema, child, 0);
8771 curIDC = xmlSchemaParseIDC(ctxt, schema, child,
8774 curIDC = xmlSchemaParseIDC(ctxt, schema, child,
8777 curIDC = xmlSchemaParseIDC(ctxt, schema, child,
8822 * @ctxt: a schema validation context
8823 * @schema: the schema being built
8824 * @node: a subtree containing XML Schema informations
8826 * parse a XML schema Union definition
8833 xmlSchemaParseUnion(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
8841 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
8895 if (xmlSchemaPValAttrNodeQNameValue(ctxt, schema,
8955 xmlSchemaParseSimpleType(ctxt, schema, child, 0);
8991 * @ctxt: a schema validation context
8992 * @schema: the schema being built
8993 * @node: a subtree containing XML Schema informations
8995 * parse a XML schema List definition
9002 xmlSchemaParseList(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
9009 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
9049 xmlSchemaPValAttrQName(ctxt, schema, NULL,
9073 type->subtypes = xmlSchemaParseSimpleType(ctxt, schema, child, 0);
9102 * @ctxt: a schema validation context
9103 * @schema: the schema being built
9104 * @node: a subtree containing XML Schema informations
9106 * parse a XML schema Simple Type definition
9113 xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
9122 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
9165 * of the <schema> ancestor element information item if present,
9177 type = xmlSchemaAddType(ctxt, schema,
9182 type = xmlSchemaAddType(ctxt, schema,
9212 type = xmlSchemaAddType(ctxt, schema, XML_SCHEMA_TYPE_SIMPLE,
9242 if (schema->flags & XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION)
9244 if (schema->flags & XML_SCHEMAS_FINAL_DEFAULT_LIST)
9246 if (schema->flags & XML_SCHEMAS_FINAL_DEFAULT_UNION)
9282 xmlSchemaParseRestriction(ctxt, schema, child,
9287 xmlSchemaParseList(ctxt, schema, child);
9290 xmlSchemaParseUnion(ctxt, schema, child);
9318 * @schema: the schema being built
9328 xmlSchemaPtr schema,
9337 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
9346 } else if (xmlSchemaPValAttrNodeQName(ctxt, schema, NULL,
9350 xmlSchemaCheckReference(ctxt, schema, node, attr, refNs);
9413 * @ctxt: a schema validation context
9414 * @schema: the schema being built
9415 * @node: a subtree containing XML Schema informations
9417 * Parses a XML schema model group definition.
9430 xmlSchemaPtr schema,
9438 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
9452 item = xmlSchemaAddModelGroupDefinition(ctxt, schema, name,
9483 item->children = xmlSchemaParseModelGroup(ctxt, schema, child,
9487 item->children = xmlSchemaParseModelGroup(ctxt, schema, child,
9491 item->children = xmlSchemaParseModelGroup(ctxt, schema, child,
9509 * @ctxt: a schema validation context
9584 xmlSchemaClearSchemaDefaults(xmlSchemaPtr schema)
9586 if (schema->flags & XML_SCHEMAS_QUALIF_ELEM)
9587 schema->flags ^= XML_SCHEMAS_QUALIF_ELEM;
9589 if (schema->flags & XML_SCHEMAS_QUALIF_ATTR)
9590 schema->flags ^= XML_SCHEMAS_QUALIF_ATTR;
9592 if (schema->flags & XML_SCHEMAS_FINAL_DEFAULT_EXTENSION)
9593 schema->flags ^= XML_SCHEMAS_FINAL_DEFAULT_EXTENSION;
9594 if (schema->flags & XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION)
9595 schema->flags ^= XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION;
9596 if (schema->flags & XML_SCHEMAS_FINAL_DEFAULT_LIST)
9597 schema->flags ^= XML_SCHEMAS_FINAL_DEFAULT_LIST;
9598 if (schema->flags & XML_SCHEMAS_FINAL_DEFAULT_UNION)
9599 schema->flags ^= XML_SCHEMAS_FINAL_DEFAULT_UNION;
9601 if (schema->flags & XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION)
9602 schema->flags ^= XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION;
9603 if (schema->flags & XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION)
9604 schema->flags ^= XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION;
9605 if (schema->flags & XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION)
9606 schema->flags ^= XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION;
9611 xmlSchemaPtr schema,
9621 * they are used if processing schema *documents* only.
9651 res = xmlSchemaPValAttrFormDefault(val, &schema->flags,
9664 res = xmlSchemaPValAttrFormDefault(val, &schema->flags,
9677 res = xmlSchemaPValAttrBlockFinal(val, &(schema->flags), -1,
9695 res = xmlSchemaPValAttrBlockFinal(val, &(schema->flags), -1,
9719 * @ctxt: a schema validation context
9720 * @schema: the schemas
9723 * Returns the internal XML Schema structure built from the resource or
9728 xmlSchemaPtr schema, xmlNodePtr nodes)
9734 if ((ctxt == NULL) || (schema == NULL) || (nodes == NULL))
9745 if (schema->annot == NULL)
9746 schema->annot = annot;
9751 res = xmlSchemaParseImport(ctxt, schema, child);
9758 res = xmlSchemaParseInclude(ctxt, schema, child);
9765 res = xmlSchemaParseRedefine(ctxt, schema, child);
9779 xmlSchemaParseComplexType(ctxt, schema, child, 1);
9782 xmlSchemaParseSimpleType(ctxt, schema, child, 1);
9785 xmlSchemaParseElement(ctxt, schema, child, NULL, 1);
9788 xmlSchemaParseGlobalAttribute(ctxt, schema, child);
9791 xmlSchemaParseAttributeGroupDefinition(ctxt, schema, child);
9794 xmlSchemaParseModelGroupDefinition(ctxt, schema, child);
9797 xmlSchemaParseNotation(ctxt, schema, child);
9813 if (schema->annot == NULL)
9814 schema->annot = annot;
9837 xmlSchemaPErrMemory(NULL, "allocating schema relation", NULL);
9869 * no schema graph available any more. Only the schema buckets
9896 "allocating schema construction context", NULL);
9904 "allocating list of schema buckets", NULL);
9927 xmlSchemaPErrMemory(NULL, "allocating schema parser context",
9943 * @URL: the location of the schema
9970 if (vctxt->schema != NULL)
9972 xmlSchemaNewParserCtxtUseDict("*", vctxt->schema->dict);
9991 * @pctxt: the schema parser context
9992 * @schemaLocation: the URI of the schema document
9994 * Returns a schema bucket if it was already parsed.
9996 * Returns a schema bucket if it was already parsed from
10077 xmlSchemaPtr schema,
10087 * Save old values; reset the *main* schema.
10089 * to the parser. Get rid of passing the main schema to the
10092 oldFlags = schema->flags;
10093 oldDoc = schema->doc;
10094 if (schema->flags != 0)
10095 xmlSchemaClearSchemaDefaults(schema);
10096 schema->doc = bucket->doc;
10097 pctxt->schema = schema;
10100 * main schema.
10108 * We are parsing the schema for schemas!
10114 /* Compile the schema doc. */
10116 ret = xmlSchemaParseSchemaElement(pctxt, schema, node);
10119 /* An empty schema; just get out. */
10123 ret = xmlSchemaParseSchemaTopLevel(pctxt, schema, node->children);
10138 /* Restore schema values. */
10139 schema->doc = oldDoc;
10140 schema->flags = oldFlags;
10146 xmlSchemaPtr schema,
10156 "reparsing a schema doc");
10161 "parsing a schema doc, but there's no doc");
10176 * TODO: Can we avoid that the parser knows about the main schema?
10177 * It would be better if he knows about the current schema bucket
10180 newpctxt->schema = schema;
10188 res = xmlSchemaParseNewDocWithContext(newpctxt, schema, bucket);
10252 * @pctxt: a schema validation context
10253 * @schema: the schema being built
10254 * @node: a subtree containing XML Schema informations
10256 * Parse an included (and to-be-redefined) XML schema document.
10297 /* Special handling for the main schema:
10313 "The schema must not import/include/redefine itself",
10348 /* We included/redefined and then try to import a schema. */
10353 "The schema document '%s' cannot be imported, since "
10358 /* We imported and then try to include/redefine a schema. */
10363 "The schema document '%s' cannot be included or "
10383 * Schema Document Location Strategy:
10384 * 3 Based on the namespace name, identify an existing schema document,
10385 * either as a resource which is an XML document or a <schema> element
10386 * information item, in some local schema repository;
10401 /* First given location of the schema; load the doc. */
10417 "Skipping import of schema located at '%s' for the "
10419 "imported with the schema located at '%s'",
10440 * schema.
10443 * URGENT TODO: If the schema is a chameleon-include then copy
10444 * the components into the including schema and modify the
10477 "trying to load a schema doc, but a doc is already "
10478 "assigned to the schema bucket");
10507 * TODO: Do we have to burden the schema parser dict with all
10508 * the content of the schema doc?
10530 * a <schema> element information item in a well-formed information
10531 * set, which in turn corresponds to a valid schema.
10534 * 2.2 The referent is a <schema> element information item in
10536 * to a valid schema.
10568 "given schema parser context.\n",
10592 * Check the schema's top level element.
10594 if (!IS_SCHEMA(docElem, "schema")) {
10597 "The XML document '%s' is not a schema document",
10611 /* Only create a bucket if the schema was located. */
10639 * main schema.
10664 * @ctxt: a schema validation context
10665 * @schema: the schema being built
10666 * @node: a subtree containing XML Schema informations
10668 * parse a XML schema Import definition
10675 xmlSchemaParseImport(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema,
10685 if ((pctxt == NULL) || (schema == NULL) || (node == NULL))
10752 * @targetNamespace if the importing schema is a chameleon schema
10759 * must not match the ?actual value? of the enclosing <schema>'s
10767 "the target namespace '%s' of the importing schema",
10774 * <schema> must have a targetNamespace [attribute].
10781 "the importing schema has no target namespace",
10787 * Locate and acquire the schema document.
10801 * schema reference strategy to fail."
10802 * So just don't parse if no schema document was found.
10803 * Note that we will get no bucket if the schema could not be
10810 "Failed to locate a schema at location '%s'. "
10815 ret = xmlSchemaParseNewDoc(pctxt, schema, bucket);
10823 xmlSchemaPtr schema,
10830 if ((pctxt == NULL) || (schema == NULL) || (node == NULL) ||
10898 "The schema document '%s' cannot redefine itself.",
10904 "The schema document '%s' cannot include itself.",
10919 xmlSchemaPtr schema,
10929 if ((pctxt == NULL) || (schema == NULL) || (node == NULL))
10936 res = xmlSchemaParseIncludeOrRedefineAttrs(pctxt, schema,
10941 * Load and add the schema document.
10948 * If we get no schema bucket back, then this means that the schema
10950 * a schema document.
10956 * We will raise an error if the schema cannot be located
10958 * schema people. I.e. the following spec piece will *not* be
10990 * Check targetNamespace sanity before parsing the new schema.
11005 "The target namespace of the included/redefined schema "
11007 "schema has no target namespace",
11017 "schema '%s' differs from '%s' of the "
11018 "including/redefining schema",
11035 "trying to use an already parsed schema for a "
11043 * Parse the schema.
11047 /* TODO: Get rid of this flag on the schema itself. */
11048 if ((schema->flags & XML_SCHEMAS_INCLUDING_CONVERT_NS) == 0) {
11049 schema->flags |= XML_SCHEMAS_INCLUDING_CONVERT_NS;
11053 xmlSchemaParseNewDoc(pctxt, schema, bucket);
11056 schema->flags ^= XML_SCHEMAS_INCLUDING_CONVERT_NS;
11068 * How to proceed if the redefined schema was not located?
11081 xmlSchemaParseSimpleType(pctxt, schema, child, 1);
11083 xmlSchemaParseComplexType(pctxt, schema, child, 1);
11088 schema, child);
11091 xmlSchemaParseAttributeGroupDefinition(pctxt, schema,
11125 xmlSchemaParseRedefine(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema,
11133 res = xmlSchemaParseIncludeOrRedefine(pctxt, schema, node,
11141 xmlSchemaParseInclude(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema,
11146 res = xmlSchemaParseIncludeOrRedefine(pctxt, schema, node,
11155 * @ctxt: a schema validation context
11156 * @schema: the schema being built
11157 * @node: a subtree containing XML Schema informations
11161 * parse a XML schema Sequence definition.
11163 * Schema Representation Constraint:
11167 * Schema Component Constraint:
11171 * is schema construction via an API is implemented.
11179 xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
11189 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
11194 item = xmlSchemaAddModelGroup(ctxt, schema, type, node);
11270 schema, child, &isElemRef, 0);
11323 xmlSchemaParseElement(ctxt, schema, child, &isElemRef, 0);
11328 xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
11395 xmlSchemaParseAny(ctxt, schema, child);
11397 part = xmlSchemaParseModelGroup(ctxt, schema, child,
11400 part = xmlSchemaParseModelGroup(ctxt, schema, child,
11435 * @ctxt: a schema validation context
11436 * @schema: the schema being built
11437 * @node: a subtree containing XML Schema informations
11439 * parse a XML schema Restriction definition
11445 xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
11452 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
11491 if (xmlSchemaPValAttrQName(ctxt, schema, NULL, node, "base",
11561 xmlSchemaParseSimpleType(ctxt, schema, child, 0);
11580 xmlSchemaParseModelGroup(ctxt, schema, child,
11586 schema, child, XML_SCHEMA_TYPE_CHOICE, 1);
11590 xmlSchemaParseModelGroup(ctxt, schema, child,
11598 xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
11618 xmlSchemaParseSimpleType(ctxt, schema, child, 0);
11638 * Simple Type Definition Schema Representation Constraint:
11653 facet = xmlSchemaParseFacet(ctxt, schema, child);
11694 if (xmlSchemaParseLocalAttributes(ctxt, schema, &child,
11703 xmlSchemaParseAnyAttribute(ctxt, schema, child);
11738 * @ctxt: a schema validation context
11739 * @schema: the schema being built
11740 * @node: a subtree containing XML Schema informations
11749 xmlSchemaParseExtension(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
11756 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
11785 if ((xmlSchemaPValAttrQName(ctxt, schema, NULL, node,
11812 xmlSchemaParseModelGroup(ctxt, schema,
11817 xmlSchemaParseModelGroup(ctxt, schema,
11822 xmlSchemaParseModelGroup(ctxt, schema,
11827 xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
11839 if (xmlSchemaParseLocalAttributes(ctxt, schema, &child,
11848 xmlSchemaParseAnyAttribute(ctxt, schema, child);
11874 * @ctxt: a schema validation context
11875 * @schema: the schema being built
11876 * @node: a subtree containing XML Schema informations
11878 * parse a XML schema SimpleContent definition
11885 xmlSchemaPtr schema, xmlNodePtr node,
11892 if ((ctxt == NULL) || (schema == NULL) || (node == NULL) ||
11943 xmlSchemaParseRestriction(ctxt, schema, child,
11948 xmlSchemaParseExtension(ctxt, schema, child,
11964 * @ctxt: a schema validation context
11965 * @schema: the schema being built
11966 * @node: a subtree containing XML Schema informations
11968 * parse a XML schema ComplexContent definition
11975 xmlSchemaPtr schema, xmlNodePtr node,
11982 if ((ctxt == NULL) || (schema == NULL) || (node == NULL) ||
12038 xmlSchemaParseRestriction(ctxt, schema, child,
12043 xmlSchemaParseExtension(ctxt, schema, child,
12059 * @ctxt: a schema validation context
12060 * @schema: the schema being built
12061 * @node: a subtree containing XML Schema
12063 * parse a XML schema Complex Type definition
12069 xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
12083 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
12106 type = xmlSchemaAddType(ctxt, schema,
12111 type = xmlSchemaAddType(ctxt, schema,
12127 type = xmlSchemaAddType(ctxt, schema,
12224 if (schema->flags & XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION)
12226 if (schema->flags & XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION)
12233 if (schema->flags & XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION)
12235 if (schema->flags & XML_SCHEMAS_FINAL_DEFAULT_EXTENSION)
12256 xmlSchemaParseSimpleContent(ctxt, schema, child,
12264 xmlSchemaParseComplexContent(ctxt, schema, child,
12284 xmlSchemaParseModelGroup(ctxt, schema, child,
12289 xmlSchemaParseModelGroup(ctxt, schema, child,
12294 xmlSchemaParseModelGroup(ctxt, schema, child,
12299 xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
12309 if (xmlSchemaParseLocalAttributes(ctxt, schema, &child,
12317 type->attributeWildcard = xmlSchemaParseAnyAttribute(ctxt, schema, child);
12357 * @ctxt: a schema parser context
12389 * @ctxt: a schema parser context
12406 * @URL: the location of the schema
12484 * @ctxt: the schema parser context
12486 * Free the resources associated to the schema parser context
12675 * @ctxt: the schema parser context
13039 * @ctxt: the schema parser context
13098 * @elem: the schema element context
13099 * @ctxt: the schema parser context
13121 type = xmlSchemaGetType(ctxt->schema, elemDecl->namedType,
13139 substHead = xmlSchemaGetElem(ctxt->schema, elemDecl->substGroup,
13176 * @ctxt: the schema parser context
13177 * @type: the schema simple type definition
13211 memberType = xmlSchemaGetType(ctxt->schema, name, nsName);
13256 * @ctxt: the schema parser context
13285 * @ctxt: the schema parser context
13373 * @ctxt: the schema parser context
13419 * @ctxt: the schema parser context
13679 * @ctxt: the schema parser context
13857 * @ctxt: the schema parser context
13861 * Schema Component Constraint: Wildcard Subset (cos-ns-subset)
14001 * Schema Component Constraint:
14006 * In XML Schema 1.1 this will be:
14302 * @ctxt: the schema parser context
14502 * @schema: the schema
14546 * Schema Component Constraint: Effective Total Range
14602 * Schema Component Constraint: Effective Total Range
14663 * Schema Component Constraint: Particle Emptiable
14695 * Schema Component Constraint:
14793 * @pctxt: the schema parser context
14934 typeDef->baseType = xmlSchemaGetType(ctxt->schema,
14958 typeDef->subtypes = xmlSchemaGetType(ctxt->schema,
14999 WXS_MODEL_GROUPDEF_CAST xmlSchemaGetNamedComponent(ctxt->schema,
15043 * @ctxt: the schema parser context
15061 * Schema Component Constraint: Simple Type Definition Properties Correct
15144 * @ctxt: the schema parser context
15147 * Schema Component Constraint:
15611 * @ctxt: the schema parser context
15628 * Definition Schema Components (?3.14.6).
15690 * @pctxt: the schema parser context
15695 * Schema Component Constraint: Element Default Valid (Immediate)
15715 * Schema Component Constraint: Element Default Valid (Immediate)
15771 * @ctxt: the schema parser context
15774 *.(4.6) Constraints on Complex Type Definition Schema Components
15775 * Schema Component Constraint:
15791 * Schema Component (?3.4.1), modulo the impact of Missing
15916 * @ctxt: the schema parser context
15921 * Schema Component Constraint:
16014 * @ctxt: the schema parser context
16017 * (3.4.6) Constraints on Complex Type Definition Schema Components
16018 * Schema Component Constraint:
16126 * if created the type via a schema construction API.
16268 * @ctxt: the schema parser context
16271 * (3.4.6) Constraints on Complex Type Definition Schema Components
16272 * Schema Component Constraint:
16280 * In XML Schema 1.1 this will be:
16468 * @ctxt: the schema parser context
16471 * (3.4.6) Constraints on Complex Type Definition Schema Components
16496 * @ctxt: the schema parser context
16500 * Schema Representation Constraint:
16647 * Definition Schema Components (?3.4.6);"
16663 * @ctxt: the schema parser context
16666 * (3.9.6) Constraints on Particle Schema Components
16667 * Schema Component Constraint:
16689 * @ctxt: the schema parser context
16693 * (3.9.6) Constraints on Particle Schema Components
16694 * Schema Component Constraint:
16796 * @ctxt: the schema parser context
16800 * (3.9.6) Constraints on Particle Schema Components
16801 * Schema Component Constraint:
16840 * @ctxt: the schema parser context
16844 * (3.9.6) Constraints on Particle Schema Components
16845 * Schema Component Constraint:
16866 * @ctxt: the schema parser context
16870 * (3.9.6) Constraints on Particle Schema Components
16871 * Schema Component Constraint:
16918 * @ctxt: the schema parser context
16921 * (3.9.6) Constraints on Particle Schema Components
16922 * Schema Component Constraint:
16956 * @ctxt: the schema parser context
16960 * (3.9.6) Constraints on Particle Schema Components
16961 * Schema Component Constraint:
17010 * @ctxt: the schema parser context
17014 * (3.9.6) Constraints on Particle Schema Components
17015 * Schema Component Constraint:
17116 * Schema Component Constraint: Simple Type Restriction (Facets)
17669 * "http://lists.w3.org/Archives/Public/www-xml-schema-comments/2005JulSep/0287.html"
17952 * 3.14.6 Constraints on Simple Type Definition Schema Components
17989 * Schema Components (?3.14.6)."
17992 * Schema Component Constraint: Simple Type Definition Properties Correct
17998 * Schema Component Constraint: Derivation Valid (Restriction, Simple)
18015 * Schema Component Constraint: Simple Type Restriction (Facets)
18128 content = xmlSchemaAddType(pctxt, pctxt->schema,
18132 content = xmlSchemaAddType(pctxt, pctxt->schema,
18140 * to have it somehow anchored in the schema doc.
18270 xmlSchemaAddModelGroup(pctxt, pctxt->schema,
18395 xmlSchemaAddModelGroup(pctxt, pctxt->schema,
18491 * @typeDecl: the schema type definition
18492 * @ctxt: the schema parser context
18520 * @typeDecl: the schema type definition
18521 * @pctxt: the schema parser context or NULL
18560 /* 4.3.5.5 Constraints on enumeration Schema Components
18561 * Schema Component Constraint: enumeration valid restriction
18732 * @typeDecl: the schema type definition
18733 schema parser context
18751 * Temporarily assign the "schema" to the validation context
18758 pctxt->vctxt->schema = pctxt->schema;
18764 pctxt->vctxt->schema = NULL;
18844 * Schema Component Constraint: Model Group Correct
18893 * Schema Component Constraint:
18994 * Schema Representation Constraint:
19002 * (Schema Document) (?3.15.3) is applied to a ?QName? arising from
19129 * to any node in the schema, we will anchor it on
19132 tmpWild = xmlSchemaAddWildcard(pctxt, pctxt->schema,
19250 * Schema Component Constraint:
19261 * Group Definition Schema Component (?3.6.1), modulo the impact of
19344 * @attrgrpDecl: the schema attribute definition
19345 * @ctxt: the schema parser context
19358 group = xmlSchemaGetAttributeGroup(ctxt->schema,
19375 * @item: an schema attribute declaration/use
19376 * @ctxt: a schema parser context
19380 * Schema Component Constraint:
19396 * Declaration Schema Component (?3.2.1), modulo the impact of
19475 * @ctxt: a schema parser context
19479 * Schema Component Constraint:
19494 * Declaration Schema Component (?3.3.1), modulo the impact of Missing
19650 * @ctxt: a schema parser context
19654 * Schema Component Constraint:
19769 * @pctxt: the schema parser context
19774 * Schema Component Constraint: Element Declarations Consistent
19885 * @item: an schema element declaration/particle
19886 * @ctxt: a schema parser context
19943 refItem = xmlSchemaGetNamedComponent(ctxt->schema,
20082 ause->attrDecl = xmlSchemaGetAttributeDecl(ctxt->schema,
20101 * Schema Component Constraint:
20118 * described in the property tableau in The Attribute Use Schema
20232 type = xmlSchemaGetType(ctxt->schema, item->typeName,
20256 * @ctxt: the schema parser context
20260 * Schema Component Constraint:
20271 xmlSchemaGetIDC(pctxt->schema, idc->ref->name,
20329 if (xmlSchemaGetAttributeDecl(pctxt->schema, prohib->name,
20366 * schema graph starting with the redefined schema.
20367 * NOTE: According to this schema bug entry:
20368 * http://lists.w3.org/Archives/Public/www-xml-schema-comments/2005OctDec/0019.html
20370 * from the <redefine>d schema _document_ or the schema; the latter
20372 * <redefine>d schema. Currenlty we latter approach is used.
20397 * redefined schema.
20411 "the redefined schema",
20563 * Group Definition Schema Components (?3.7.2) must be a
20574 * per XML Representation of Attribute Group Definition Schema
20614 table = &(WXS_IMPBUCKET((c))->schema->slot); \
20616 table = &(WXS_INCBUCKET((c))->ownerImport->schema->slot); }
20619 * Add global components to the schema's hash tables.
20754 * Definition Schema Components (?3.7.2) must be a ?valid
20769 * Now that we have parsed *all* the schema document(s) and converted
20770 * them to schema components, we can resolve references, apply component
21114 * Schema Component Constraint: Element Declarations Consistent
21186 * @ctxt: a schema validation context
21188 * parse a schema definition resource and build an internal
21191 * Returns the internal XML Schema structure built from the resource or
21202 * This one is used if the schema to be parsed was specified via
21216 /* Create the *main* schema. */
21221 * Create the schema constructor.
21232 * Locate and add the schema document.
21243 /* TODO: Error code, actually we failed to *locate* the schema. */
21247 "Failed to locate the main schema resource at '%s'",
21252 "Failed to locate the main schema resource",
21265 ctxt->schema = mainSchema;
21286 ctxt->schema = NULL;
21304 ctxt->schema = NULL;
21310 * @ctxt: a schema validation context
21333 * @ctxt: a schema parser context
21354 * @ctxt: a XMl-Schema parser context
21480 * @pctxt: a schema parser context
21481 * @vctxt: a schema validation context
21482 * @schema: the existing schema
21484 * @nsName: the namespace name of the new schema
21485 * @location: the location of the schema
21487 * Expands an existing schema by an additional schema.
21489 * Returns 0 if the new schema is correct, a positive error code
21494 xmlSchemaPtr schema,
21503 if ((vctxt == NULL) || (schema == NULL))
21518 * Acquire the schema document.
21525 * XML_SCHEMA_SCHEMA_MAIN if it is the first schema document.
21543 * The first located schema will be handled as if all other
21544 * schemas imported by XSI were imported by this first schema.
21551 * if the schema cannot be located?
21556 * We will reuse the parser context for every schema imported
21563 ret = xmlSchemaParseNewDocWithContext(pctxt, schema, bucket);
21575 * For every XSI acquired schema (and its sub-schemata) we will
21581 * Not nice, but we need somehow to channel the schema parser
21620 * @vctxt: a schema validation context
21622 * Expands an existing schema by an additional schema using
21627 * Returns 0 if the new schema is correct, a positive error code
21670 count++; /* TODO: Don't use the schema's dict. */
21671 nsname = xmlDictLookup(vctxt->schema->dict, cur, end - cur);
21697 count++; /* TODO: Don't use the schema's dict. */
21698 location = xmlDictLookup(vctxt->schema->dict, cur, end - cur);
21700 ret = xmlSchemaAssembleByLocation(vctxt, vctxt->schema,
21770 * This one works on the schema of the validation context.
21774 xmlSchemaPtr schema,
21782 if (vctxt && (vctxt->schema == NULL)) {
21784 "a schema is needed on the validation context");
21814 if (xmlSchemaGetNotation(schema, localName, nsName) != NULL) {
21826 if (xmlSchemaGetNotation(schema, value, NULL) != NULL) {
21914 * @imported: the imported schema
21916 * Creates an augmented IDC definition for the imported schema.
21920 if (imported->schema->idcDef != NULL) {
21921 xmlHashScan(imported->schema->idcDef ,
23974 * @vctxt: the schema validation context
24188 * XML Schema 1.0 spec. Use the whitespace type of the base type.
24397 * 1 It is schema-valid with respect to that definition as defined
24446 * to lookup in the hashtable of NOTATION declarations of the schema.
24453 ((xmlSchemaValidCtxtPtr) actxt)->schema,
24474 ((xmlSchemaParserCtxtPtr) actxt)->schema, node,
24775 * Schema-Validity Assessment (Element) (cvc-assess-elt)
24810 *localType = xmlSchemaGetType(vctxt->schema, local, nsName);
24859 * which adds to the string dict of the schema. So this would
24860 * change the schema and we don't want this. We don't need
25164 * attribute information item with respect to Schema-Validity
25278 iattr->decl = xmlSchemaGetAttributeDecl(vctxt->schema,
25483 * http://lists.w3.org/Archives/Public/www-xml-schema-comments/2005JulSep/0406.html
25566 * will be removed in XML Schema 1.1.
25724 decl = xmlSchemaGetElem(vctxt->schema,
25741 * SPEC Validation Rule: Schema-Validity Assessment (Element)
25763 * SPEC Validation Rule: Schema-Validity Assessment (Element)
25789 * Schema Component Constraint: Element Default Valid (Immediate)
26056 * relevant if canonical or not. Additionally XML Schema 1.1
26398 vctxt->inode->decl = xmlSchemaGetElem(vctxt->schema,
26428 * an element information item's schema validity may be laxly
26727 * dynamic schema construction.
26770 vctxt->inode->decl = xmlSchemaGetElem(vctxt->schema,
27350 * @schema: a precompiled XML Schemas
27352 * Create an XML Schemas validation context based on the given schema.
27357 xmlSchemaNewValidCtxt(xmlSchemaPtr schema)
27370 ret->schema = schema;
27376 * @ctxt: the schema validation context
27378 * Free the resources associated to the schema validation context;
27481 * @ctxt: the schema validation context
27483 * Free the resources associated to the schema validation context
27567 * @ctxt: the schema validation context
27584 * @ctxt: a schema validation context
27607 * @ctxt: a schema validation context
27629 * @ctxt: a XML-Schema validation context
27657 * @ctxt: a schema validation context
27690 * @ctxt: a schema validation context
27818 "this XML Schema processor is not supported (yet). Please "
27887 * Create a schema + parser if necessary.
27889 if (vctxt->schema == NULL) {
27894 * If not schema was given then we will create a schema
27895 * dynamically using XSI schema locations.
27897 * Create the schema parser context.
27905 * Create the schema.
27907 vctxt->schema = xmlSchemaNewSchema(pctxt);
27908 if (vctxt->schema == NULL)
27911 * Create the schema construction context.
27916 pctxt->constructor->mainSchema = vctxt->schema;
27923 * Augment the IDC definitions for the main schema and all imported ones
27924 * NOTE: main schema if the first in the imported list
27926 xmlHashScan(vctxt->schema->schemasImports,(xmlHashScanner)xmlSchemaAugmentImportedIDC, vctxt);
27934 if (vctxt->schema != NULL) {
27935 xmlSchemaFree(vctxt->schema);
27936 vctxt->schema = NULL;
27983 * @ctxt: a schema validation context
27997 if (ctxt->schema == NULL)
28008 * @ctxt: a schema validation context
28378 * @ctxt: a schema validation context
28557 * @ctxt: a schema validation context
28645 * @ctxt: a schema validation context
28677 * @ctxt: a schema validation context
28679 * allow access to the parser context of the schema validation context
28681 * Returns the parser context of the schema validation context or NULL