Home | History | Annotate | Download | only in libxml2

Lines Matching refs: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 if ((ctxt == NULL) || (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,
10357 "The schema document '%s' cannot be imported, since "
10364 * We imported and then try to include/redefine a schema,
10374 "The schema document '%s' cannot be included or "
10395 * Schema Document Location Strategy:
10396 * 3 Based on the namespace name, identify an existing schema document,
10397 * either as a resource which is an XML document or a <schema> element
10398 * information item, in some local schema repository;
10413 /* First given location of the schema; load the doc. */
10429 "Skipping import of schema located at '%s' for the "
10431 "imported with the schema located at '%s'",
10452 * schema.
10455 * URGENT TODO: If the schema is a chameleon-include then copy
10456 * the components into the including schema and modify the
10489 "trying to load a schema doc, but a doc is already "
10490 "assigned to the schema bucket");
10519 * TODO: Do we have to burden the schema parser dict with all
10520 * the content of the schema doc?
10542 * a <schema> element information item in a well-formed information
10543 * set, which in turn corresponds to a valid schema.
10546 * 2.2 The referent is a <schema> element information item in
10548 * to a valid schema.
10580 "given schema parser context.\n",
10604 * Check the schema's top level element.
10606 if (!IS_SCHEMA(docElem, "schema")) {
10609 "The XML document '%s' is not a schema document",
10623 /* Only create a bucket if the schema was located. */
10651 * main schema.
10676 * @ctxt: a schema validation context
10677 * @schema: the schema being built
10678 * @node: a subtree containing XML Schema informations
10680 * parse a XML schema Import definition
10687 xmlSchemaParseImport(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema,
10697 if ((pctxt == NULL) || (schema == NULL) || (node == NULL))
10764 * @targetNamespace if the importing schema is a chameleon schema
10771 * must not match the ?actual value? of the enclosing <schema>'s
10779 "the target namespace '%s' of the importing schema",
10786 * <schema> must have a targetNamespace [attribute].
10793 "the importing schema has no target namespace",
10799 * Locate and acquire the schema document.
10813 * schema reference strategy to fail."
10814 * So just don't parse if no schema document was found.
10815 * Note that we will get no bucket if the schema could not be
10822 "Failed to locate a schema at location '%s'. "
10827 ret = xmlSchemaParseNewDoc(pctxt, schema, bucket);
10835 xmlSchemaPtr schema,
10842 if ((pctxt == NULL) || (schema == NULL) || (node == NULL) ||
10910 "The schema document '%s' cannot redefine itself.",
10916 "The schema document '%s' cannot include itself.",
10931 xmlSchemaPtr schema,
10941 if ((pctxt == NULL) || (schema == NULL) || (node == NULL))
10948 res = xmlSchemaParseIncludeOrRedefineAttrs(pctxt, schema,
10953 * Load and add the schema document.
10960 * If we get no schema bucket back, then this means that the schema
10962 * a schema document.
10968 * We will raise an error if the schema cannot be located
10970 * schema people. I.e. the following spec piece will *not* be
11002 * Check targetNamespace sanity before parsing the new schema.
11017 "The target namespace of the included/redefined schema "
11019 "schema has no target namespace",
11029 "schema '%s' differs from '%s' of the "
11030 "including/redefining schema",
11046 "The target namespace of the included/redefined schema "
11048 "including/redefining schema's target namespace",
11056 * Parse the schema.
11060 /* TODO: Get rid of this flag on the schema itself. */
11061 if ((schema->flags & XML_SCHEMAS_INCLUDING_CONVERT_NS) == 0) {
11062 schema->flags |= XML_SCHEMAS_INCLUDING_CONVERT_NS;
11066 xmlSchemaParseNewDoc(pctxt, schema, bucket);
11069 schema->flags ^= XML_SCHEMAS_INCLUDING_CONVERT_NS;
11081 * How to proceed if the redefined schema was not located?
11094 xmlSchemaParseSimpleType(pctxt, schema, child, 1);
11096 xmlSchemaParseComplexType(pctxt, schema, child, 1);
11101 schema, child);
11104 xmlSchemaParseAttributeGroupDefinition(pctxt, schema,
11138 xmlSchemaParseRedefine(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema,
11146 res = xmlSchemaParseIncludeOrRedefine(pctxt, schema, node,
11154 xmlSchemaParseInclude(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema,
11159 res = xmlSchemaParseIncludeOrRedefine(pctxt, schema, node,
11168 * @ctxt: a schema validation context
11169 * @schema: the schema being built
11170 * @node: a subtree containing XML Schema informations
11174 * parse a XML schema Sequence definition.
11176 * Schema Representation Constraint:
11180 * Schema Component Constraint:
11184 * is schema construction via an API is implemented.
11192 xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
11202 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
11207 item = xmlSchemaAddModelGroup(ctxt, schema, type, node);
11283 schema, child, &isElemRef, 0);
11336 xmlSchemaParseElement(ctxt, schema, child, &isElemRef, 0);
11341 xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
11408 xmlSchemaParseAny(ctxt, schema, child);
11410 part = xmlSchemaParseModelGroup(ctxt, schema, child,
11413 part = xmlSchemaParseModelGroup(ctxt, schema, child,
11448 * @ctxt: a schema validation context
11449 * @schema: the schema being built
11450 * @node: a subtree containing XML Schema informations
11452 * parse a XML schema Restriction definition
11458 xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
11465 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
11504 if (xmlSchemaPValAttrQName(ctxt, schema, NULL, node, "base",
11574 xmlSchemaParseSimpleType(ctxt, schema, child, 0);
11593 xmlSchemaParseModelGroup(ctxt, schema, child,
11599 schema, child, XML_SCHEMA_TYPE_CHOICE, 1);
11603 xmlSchemaParseModelGroup(ctxt, schema, child,
11611 xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
11631 xmlSchemaParseSimpleType(ctxt, schema, child, 0);
11651 * Simple Type Definition Schema Representation Constraint:
11666 facet = xmlSchemaParseFacet(ctxt, schema, child);
11707 if (xmlSchemaParseLocalAttributes(ctxt, schema, &child,
11716 xmlSchemaParseAnyAttribute(ctxt, schema, child);
11751 * @ctxt: a schema validation context
11752 * @schema: the schema being built
11753 * @node: a subtree containing XML Schema informations
11762 xmlSchemaParseExtension(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
11769 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
11798 if ((xmlSchemaPValAttrQName(ctxt, schema, NULL, node,
11825 xmlSchemaParseModelGroup(ctxt, schema,
11830 xmlSchemaParseModelGroup(ctxt, schema,
11835 xmlSchemaParseModelGroup(ctxt, schema,
11840 xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
11852 if (xmlSchemaParseLocalAttributes(ctxt, schema, &child,
11861 xmlSchemaParseAnyAttribute(ctxt, schema, child);
11887 * @ctxt: a schema validation context
11888 * @schema: the schema being built
11889 * @node: a subtree containing XML Schema informations
11891 * parse a XML schema SimpleContent definition
11898 xmlSchemaPtr schema, xmlNodePtr node,
11905 if ((ctxt == NULL) || (schema == NULL) || (node == NULL) ||
11956 xmlSchemaParseRestriction(ctxt, schema, child,
11961 xmlSchemaParseExtension(ctxt, schema, child,
11977 * @ctxt: a schema validation context
11978 * @schema: the schema being built
11979 * @node: a subtree containing XML Schema informations
11981 * parse a XML schema ComplexContent definition
11988 xmlSchemaPtr schema, xmlNodePtr node,
11995 if ((ctxt == NULL) || (schema == NULL) || (node == NULL) ||
12051 xmlSchemaParseRestriction(ctxt, schema, child,
12056 xmlSchemaParseExtension(ctxt, schema, child,
12072 * @ctxt: a schema validation context
12073 * @schema: the schema being built
12074 * @node: a subtree containing XML Schema informations
12076 * parse a XML schema Complex Type definition
12082 xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
12096 if ((ctxt == NULL) || (schema == NULL) || (node == NULL))
12119 type = xmlSchemaAddType(ctxt, schema,
12124 type = xmlSchemaAddType(ctxt, schema,
12140 type = xmlSchemaAddType(ctxt, schema,
12237 if (schema->flags & XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION)
12239 if (schema->flags & XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION)
12246 if (schema->flags & XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION)
12248 if (schema->flags & XML_SCHEMAS_FINAL_DEFAULT_EXTENSION)
12269 xmlSchemaParseSimpleContent(ctxt, schema, child,
12277 xmlSchemaParseComplexContent(ctxt, schema, child,
12297 xmlSchemaParseModelGroup(ctxt, schema, child,
12302 xmlSchemaParseModelGroup(ctxt, schema, child,
12307 xmlSchemaParseModelGroup(ctxt, schema, child,
12312 xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
12322 if (xmlSchemaParseLocalAttributes(ctxt, schema, &child,
12330 type->attributeWildcard = xmlSchemaParseAnyAttribute(ctxt, schema, child);
12370 * @ctxt: a schema parser context
12402 * @ctxt: a schema parser context
12419 * @URL: the location of the schema
12497 * @ctxt: the schema parser context
12499 * Free the resources associated to the schema parser context
12707 * @ctxt: the schema parser context
13107 * @ctxt: the schema parser context
13166 * @elem: the schema element context
13167 * @ctxt: the schema parser context
13189 type = xmlSchemaGetType(ctxt->schema, elemDecl->namedType,
13207 substHead = xmlSchemaGetElem(ctxt->schema, elemDecl->substGroup,
13244 * @ctxt: the schema parser context
13245 * @type: the schema simple type definition
13279 memberType = xmlSchemaGetType(ctxt->schema, name, nsName);
13324 * @ctxt: the schema parser context
13353 * @ctxt: the schema parser context
13441 * @ctxt: the schema parser context
13487 * @ctxt: the schema parser context
13747 * @ctxt: the schema parser context
13925 * @ctxt: the schema parser context
13929 * Schema Component Constraint: Wildcard Subset (cos-ns-subset)
14069 * Schema Component Constraint:
14074 * In XML Schema 1.1 this will be:
14370 * @ctxt: the schema parser context
14570 * @schema: the schema
14614 * Schema Component Constraint: Effective Total Range
14670 * Schema Component Constraint: Effective Total Range
14731 * Schema Component Constraint: Particle Emptiable
14763 * Schema Component Constraint:
14861 * @pctxt: the schema parser context
15002 typeDef->baseType = xmlSchemaGetType(ctxt->schema,
15026 typeDef->subtypes = xmlSchemaGetType(ctxt->schema,
15067 WXS_MODEL_GROUPDEF_CAST xmlSchemaGetNamedComponent(ctxt->schema,
15111 * @ctxt: the schema parser context
15129 * Schema Component Constraint: Simple Type Definition Properties Correct
15213 * @ctxt: the schema parser context
15216 * Schema Component Constraint:
15681 * @ctxt: the schema parser context
15698 * Definition Schema Components (?3.14.6).
15760 * @pctxt: the schema parser context
15765 * Schema Component Constraint: Element Default Valid (Immediate)
15785 * Schema Component Constraint: Element Default Valid (Immediate)
15841 * @ctxt: the schema parser context
15844 *.(4.6) Constraints on Complex Type Definition Schema Components
15845 * Schema Component Constraint:
15861 * Schema Component (?3.4.1), modulo the impact of Missing
15986 * @ctxt: the schema parser context
15991 * Schema Component Constraint:
16084 * @ctxt: the schema parser context
16087 * (3.4.6) Constraints on Complex Type Definition Schema Components
16088 * Schema Component Constraint:
16196 * if created the type via a schema construction API.
16338 * @ctxt: the schema parser context
16341 * (3.4.6) Constraints on Complex Type Definition Schema Components
16342 * Schema Component Constraint:
16350 * In XML Schema 1.1 this will be:
16538 * @ctxt: the schema parser context
16541 * (3.4.6) Constraints on Complex Type Definition Schema Components
16566 * @ctxt: the schema parser context
16570 * Schema Representation Constraint:
16717 * Definition Schema Components (?3.4.6);"
16733 * @ctxt: the schema parser context
16736 * (3.9.6) Constraints on Particle Schema Components
16737 * Schema Component Constraint:
16759 * @ctxt: the schema parser context
16763 * (3.9.6) Constraints on Particle Schema Components
16764 * Schema Component Constraint:
16866 * @ctxt: the schema parser context
16870 * (3.9.6) Constraints on Particle Schema Components
16871 * Schema Component Constraint:
16910 * @ctxt: the schema parser context
16914 * (3.9.6) Constraints on Particle Schema Components
16915 * Schema Component Constraint:
16936 * @ctxt: the schema parser context
16940 * (3.9.6) Constraints on Particle Schema Components
16941 * Schema Component Constraint:
16988 schema parser context
16991 * (3.9.6) Constraints on Particle Schema Components
16992 * Schema Component Constraint:
17026 * @ctxt: the schema parser context
17030 * (3.9.6) Constraints on Particle Schema Components
17031 * Schema Component Constraint:
17080 * @ctxt: the schema parser context
17084 * (3.9.6) Constraints on Particle Schema Components
17085 * Schema Component Constraint:
17186 * Schema Component Constraint: Simple Type Restriction (Facets)
17739 * "http://lists.w3.org/Archives/Public/www-xml-schema-comments/2005JulSep/0287.html"
18022 * 3.14.6 Constraints on Simple Type Definition Schema Components
18059 * Schema Components (?3.14.6)."
18062 * Schema Component Constraint: Simple Type Definition Properties Correct
18068 * Schema Component Constraint: Derivation Valid (Restriction, Simple)
18085 * Schema Component Constraint: Simple Type Restriction (Facets)
18198 content = xmlSchemaAddType(pctxt, pctxt->schema,
18202 content = xmlSchemaAddType(pctxt, pctxt->schema,
18210 * to have it somehow anchored in the schema doc.
18340 xmlSchemaAddModelGroup(pctxt, pctxt->schema,
18465 xmlSchemaAddModelGroup(pctxt, pctxt->schema,
18561 * @typeDecl: the schema type definition
18562 * @ctxt: the schema parser context
18590 * @typeDecl: the schema type definition
18591 * @pctxt: the schema parser context or NULL
18630 /* 4.3.5.5 Constraints on enumeration Schema Components
18631 * Schema Component Constraint: enumeration valid restriction
18802 * @typeDecl: the schema type definition
18803 * @ctxt: the schema parser context
18821 * Temporarily assign the "schema" to the validation context
18828 pctxt->vctxt->schema = pctxt->schema;
18834 pctxt->vctxt->schema = NULL;
18914 * Schema Component Constraint: Model Group Correct
18963 * Schema Component Constraint:
19064 * Schema Representation Constraint:
19072 * (Schema Document) (?3.15.3) is applied to a ?QName? arising from
19199 * to any node in the schema, we will anchor it on
19202 tmpWild = xmlSchemaAddWildcard(pctxt, pctxt->schema,
19320 * Schema Component Constraint:
19331 * Group Definition Schema Component (?3.6.1), modulo the impact of
19414 * @attrgrpDecl: the schema attribute definition
19415 * @ctxt: the schema parser context
19428 group = xmlSchemaGetAttributeGroup(ctxt->schema,
19445 * @item: an schema attribute declaration/use
19446 * @ctxt: a schema parser context
19450 * Schema Component Constraint:
19466 * Declaration Schema Component (?3.2.1), modulo the impact of
19545 * @ctxt: a schema parser context
19549 * Schema Component Constraint:
19564 * Declaration Schema Component (?3.3.1), modulo the impact of Missing
19720 * @ctxt: a schema parser context
19724 * Schema Component Constraint:
19839 * @pctxt: the schema parser context
19844 * Schema Component Constraint: Element Declarations Consistent
19955 * @item: an schema element declaration/particle
19956 * @ctxt: a schema parser context
20013 refItem = xmlSchemaGetNamedComponent(ctxt->schema,
20152 ause->attrDecl = xmlSchemaGetAttributeDecl(ctxt->schema,
20171 * Schema Component Constraint:
20188 * described in the property tableau in The Attribute Use Schema
20302 type = xmlSchemaGetType(ctxt->schema, item->typeName,
20326 * @ctxt: the schema parser context
20330 * Schema Component Constraint:
20341 xmlSchemaGetIDC(pctxt->schema, idc->ref->name,
20399 if (xmlSchemaGetAttributeDecl(pctxt->schema, prohib->name,
20436 * schema graph starting with the redefined schema.
20437 * NOTE: According to this schema bug entry:
20438 * http://lists.w3.org/Archives/Public/www-xml-schema-comments/2005OctDec/0019.html
20440 * from the <redefine>d schema _document_ or the schema; the latter
20442 * <redefine>d schema. Currenlty we latter approach is used.
20467 * redefined schema.
20481 "the redefined schema",
20633 * Group Definition Schema Components (?3.7.2) must be a
20644 * per XML Representation of Attribute Group Definition Schema
20684 table = &(WXS_IMPBUCKET((c))->schema->slot); \
20686 table = &(WXS_INCBUCKET((c))->ownerImport->schema->slot); }
20689 * Add global components to the schema's hash tables.
20824 * Definition Schema Components (?3.7.2) must be a ?valid
20839 * Now that we have parsed *all* the schema document(s) and converted
20840 * them to schema components, we can resolve references, apply component
21184 * Schema Component Constraint: Element Declarations Consistent
21256 * @ctxt: a schema validation context
21258 * parse a schema definition resource and build an internal
21261 * Returns the internal XML Schema structure built from the resource or
21272 * This one is used if the schema to be parsed was specified via
21286 /* Create the *main* schema. */
21291 * Create the schema constructor.
21302 * Locate and add the schema document.
21313 /* TODO: Error code, actually we failed to *locate* the schema. */
21317 "Failed to locate the main schema resource at '%s'",
21322 "Failed to locate the main schema resource",
21335 ctxt->schema = mainSchema;
21356 ctxt->schema = NULL;
21374 ctxt->schema = NULL;
21380 * @ctxt: a schema validation context
21403 * @ctxt: a schema parser context
21424 * @ctxt: a XMl-Schema parser context
21550 * @pctxt: a schema parser context
21551 * @vctxt: a schema validation context
21552 * @schema: the existing schema
21554 * @nsName: the namespace name of the new schema
21555 * @location: the location of the schema
21557 * Expands an existing schema by an additional schema.
21559 * Returns 0 if the new schema is correct, a positive error code
21564 xmlSchemaPtr schema,
21573 if ((vctxt == NULL) || (schema == NULL))
21588 * Acquire the schema document.
21595 * XML_SCHEMA_SCHEMA_MAIN if it is the first schema document.
21613 * The first located schema will be handled as if all other
21614 * schemas imported by XSI were imported by this first schema.
21621 * if the schema cannot be located?
21626 * We will reuse the parser context for every schema imported
21633 ret = xmlSchemaParseNewDocWithContext(pctxt, schema, bucket);
21645 * For every XSI acquired schema (and its sub-schemata) we will
21651 * Not nice, but we need somehow to channel the schema parser
21690 * @vctxt: a schema validation context
21692 * Expands an existing schema by an additional schema using
21697 * Returns 0 if the new schema is correct, a positive error code
21740 count++; /* TODO: Don't use the schema's dict. */
21741 nsname = xmlDictLookup(vctxt->schema->dict, cur, end - cur);
21767 count++; /* TODO: Don't use the schema's dict. */
21768 location = xmlDictLookup(vctxt->schema->dict, cur, end - cur);
21770 ret = xmlSchemaAssembleByLocation(vctxt, vctxt->schema,
21840 * This one works on the schema of the validation context.
21844 xmlSchemaPtr schema,
21852 if (vctxt && (vctxt->schema == NULL)) {
21854 "a schema is needed on the validation context");
21884 if (xmlSchemaGetNotation(schema, localName, nsName) != NULL) {
21896 if (xmlSchemaGetNotation(schema, value, NULL) != NULL) {
21984 * @imported: the imported schema
21986 * Creates an augmented IDC definition for the imported schema.
21990 if (imported->schema->idcDef != NULL) {
21991 xmlHashScan(imported->schema->idcDef ,
24046 * @vctxt: the schema validation context
24260 * XML Schema 1.0 spec. Use the whitespace type of the base type.
24469 * 1 It is schema-valid with respect to that definition as defined
24518 * to lookup in the hashtable of NOTATION declarations of the schema.
24525 ((xmlSchemaValidCtxtPtr) actxt)->schema,
24546 ((xmlSchemaParserCtxtPtr) actxt)->schema, node,
24847 * Schema-Validity Assessment (Element) (cvc-assess-elt)
24882 *localType = xmlSchemaGetType(vctxt->schema, local, nsName);
24931 * which adds to the string dict of the schema. So this would
24932 * change the schema and we don't want this. We don't need
25236 * attribute information item with respect to Schema-Validity
25349 iattr->decl = xmlSchemaGetAttributeDecl(vctxt->schema,
25556 * http://lists.w3.org/Archives/Public/www-xml-schema-comments/2005JulSep/0406.html
25639 * will be removed in XML Schema 1.1.
25797 decl = xmlSchemaGetElem(vctxt->schema,
25814 * SPEC Validation Rule: Schema-Validity Assessment (Element)
25836 * SPEC Validation Rule: Schema-Validity Assessment (Element)
25862 * Schema Component Constraint: Element Default Valid (Immediate)
26129 * relevant if canonical or not. Additionally XML Schema 1.1
26471 vctxt->inode->decl = xmlSchemaGetElem(vctxt->schema,
26501 * an element information item's schema validity may be laxly
26800 * dynamic schema construction.
26816 * Augment the IDC definitions for the main schema and all imported ones
26817 * NOTE: main schema is the first in the imported list
26819 xmlHashScan(vctxt->schema->schemasImports,(xmlHashScanner)xmlSchemaAugmentImportedIDC, vctxt);
26848 vctxt->inode->decl = xmlSchemaGetElem(vctxt->schema,
27428 * @schema: a precompiled XML Schemas
27430 * Create an XML Schemas validation context based on the given schema.
27435 xmlSchemaNewValidCtxt(xmlSchemaPtr schema)
27448 ret->schema = schema;
27454 * @ctxt: the schema validation context
27456 * Free the resources associated to the schema validation context;
27559 * @ctxt: the schema validation context
27561 * Free the resources associated to the schema validation context
27645 * @ctxt: the schema validation context
27662 * @ctxt: a schema validation context
27685 * @ctxt: a schema validation context
27707 * @ctxt: a XML-Schema validation context
27735 * @ctxt: a schema validation context
27768 * @ctxt: a schema validation context
27896 "this XML Schema processor is not supported (yet). Please "
27965 * Create a schema + parser if necessary.
27967 if (vctxt->schema == NULL) {
27972 * If not schema was given then we will create a schema
27973 * dynamically using XSI schema locations.
27975 * Create the schema parser context.
27983 * Create the schema.
27985 vctxt->schema = xmlSchemaNewSchema(pctxt);
27986 if (vctxt->schema == NULL)
27989 * Create the schema construction context.
27994 pctxt->constructor->mainSchema = vctxt->schema;
28001 * Augment the IDC definitions for the main schema and all imported ones
28002 * NOTE: main schema if the first in the imported list
28004 xmlHashScan(vctxt->schema->schemasImports,(xmlHashScanner)xmlSchemaAugmentImportedIDC, vctxt);
28012 if (vctxt->schema != NULL) {
28013 xmlSchemaFree(vctxt->schema);
28014 vctxt->schema = NULL;
28061 * @ctxt: a schema validation context
28075 if (ctxt->schema == NULL)
28086 * @ctxt: a schema validation context
28456 * @ctxt: a schema validation context
28635 * @ctxt: a schema validation context
28723 * @ctxt: a schema validation context
28755 * @ctxt: a schema validation context
28757 * allow access to the parser context of the schema validation context
28759 * Returns the parser context of the schema validation context or NULL