Home | History | Annotate | Download | only in libxml2

Lines Matching refs:particle

656  * A particle component.
664 xmlSchemaTreeItemPtr next; /* next particle */
685 xmlSchemaTreeItemPtr children; /* first particle (OR "element decl" OR "wildcard") */
1145 return(BAD_CAST "particle");
4292 * @particle: the schema particle
4299 xmlSchemaContentModelDump(xmlSchemaParticlePtr particle, FILE * output, int depth)
4306 if (particle == NULL)
4312 if (particle->children == NULL) {
4313 fprintf(output, "MISSING particle term\n");
4316 term = particle->children;
4344 if (particle->minOccurs != 1)
4345 fprintf(output, " min: %d", particle->minOccurs);
4346 if (particle->maxOccurs >= UNBOUNDED)
4348 else if (particle->maxOccurs != 1)
4349 fprintf(output, " max: %d", particle->maxOccurs);
4359 if (particle->next != NULL)
4360 xmlSchemaContentModelDump((xmlSchemaParticlePtr) particle->next,
5514 * Adds an XML schema particle component.
5528 fprintf(stderr, "Adding particle component\n");
5533 xmlSchemaPErrMemory(ctxt, "allocating particle component",
6858 * TODO: Maybe we should better not create the particle,
6863 * 3.9.6 Schema Component Constraint: Particle Correct
6897 * Parsea a XML schema <any> element. A particle and wildcard
6902 * Returns the particle or NULL in case of error or if minOccurs==maxOccurs==0
6908 xmlSchemaParticlePtr particle;
6975 * Create the particle.
6977 particle = xmlSchemaAddParticle(ctxt, node, min, max);
6978 if (particle == NULL)
6980 particle->annot = annot;
6981 particle->children = (xmlSchemaTreeItemPtr) wild;
6983 return (particle);
8465 * Returns the element declaration or a particle; NULL in case
8466 * of an error or if the particle has minOccurs==maxOccurs==0.
8473 xmlSchemaParticlePtr particle = NULL;
8512 * Skip particle part if a global declaration.
8517 * The particle part ==================================================
8522 particle = xmlSchemaAddParticle(ctxt, node, min, max);
8523 if (particle == NULL)
8586 * Create the reference item and attach it to the particle.
8592 particle->children = (xmlSchemaTreeItemPtr) refer;
8593 particle->annot = annot;
8595 * Add the particle to pending components, since the reference
8598 WXS_ADD_PENDING(ctxt, particle);
8599 return ((xmlSchemaBasicItemPtr) particle);
8838 particle->children = (xmlSchemaTreeItemPtr) decl;
8839 return ((xmlSchemaBasicItemPtr) particle);
8845 if (particle != NULL)
8846 particle->annot = NULL;
9357 * We will return a particle component with a qname-component or
11206 * @particleNeeded: if a a model group with a particle
11231 xmlSchemaParticlePtr particle = NULL;
11257 * Create a particle
11259 particle = xmlSchemaAddParticle(ctxt, node, min, max);
11260 if (particle == NULL)
11262 particle->children = (xmlSchemaTreeItemPtr) item;
11475 return ((xmlSchemaTreeItemPtr) particle);
12569 xmlSchemaParticlePtr particle, int counter, xmlAutomataStatePtr end)
12577 elemDecl = (xmlSchemaElementPtr) particle->children;
12586 xmlSchemaPErr(pctxt, WXS_ITEM_NODE(particle),
12611 } else if (particle->maxOccurs == 1) {
12643 int maxOccurs = particle->maxOccurs == UNBOUNDED ?
12644 UNBOUNDED : particle->maxOccurs - 1;
12645 int minOccurs = particle->minOccurs < 1 ? 0 : particle->minOccurs - 1;
12671 if (particle->minOccurs == 0) {
12686 xmlSchemaParticlePtr particle)
12690 if (((xmlSchemaElementPtr) particle->children)->flags &
12695 ret = xmlSchemaBuildContentModelForSubstGroup(ctxt, particle, -1, NULL);
12700 elemDecl = (xmlSchemaElementPtr) particle->children;
12704 if (particle->maxOccurs == 1) {
12708 } else if ((particle->maxOccurs >= UNBOUNDED) &&
12709 (particle->minOccurs < 2)) {
12718 int maxOccurs = particle->maxOccurs == UNBOUNDED ?
12719 UNBOUNDED : particle->maxOccurs - 1;
12720 int minOccurs = particle->minOccurs < 1 ?
12721 0 : particle->minOccurs - 1;
12731 if (particle->minOccurs == 0) {
12742 * @particle: the particle component
12751 xmlSchemaParticlePtr particle)
12755 if (particle == NULL) {
12756 PERROR_INT("xmlSchemaBuildAContentModel", "particle is NULL");
12759 if (particle->children == NULL) {
12761 * Just return in this case. A missing "term" of the particle
12767 switch (particle->children->type) {
12773 wild = (xmlSchemaWildcardPtr) particle->children;
12778 if (particle->maxOccurs == 1) {
12816 particle->maxOccurs == UNBOUNDED ? UNBOUNDED :
12817 particle->maxOccurs - 1;
12819 particle->minOccurs < 1 ? 0 : particle->minOccurs - 1;
12850 if (particle->minOccurs == 0) {
12858 ret = xmlSchemaBuildContentModelForElement(pctxt, particle);
12868 if ((particle->minOccurs == 1) && (particle->maxOccurs == 1)) {
12869 sub = particle->children->children;
12880 if (particle->maxOccurs >= UNBOUNDED) {
12881 if (particle->minOccurs > 1) {
12890 particle->minOccurs - 1, UNBOUNDED);
12892 sub = particle->children->children;
12914 sub = particle->children->children;
12930 if (particle->minOccurs == 0) {
12936 } else if ((particle->maxOccurs > 1)
12937 || (particle->minOccurs > 1)) {
12946 particle->minOccurs - 1,
12947 particle->maxOccurs - 1);
12949 sub = particle->children->children;
12962 if ((particle->minOccurs == 0) || (ret == 1)) {
12968 sub = particle->children->children;
12984 if (particle->minOccurs == 0) {
13005 if (particle->maxOccurs == 1) {
13006 sub = particle->children->children;
13018 int maxOccurs = particle->maxOccurs == UNBOUNDED ?
13019 UNBOUNDED : particle->maxOccurs - 1;
13021 particle->minOccurs < 1 ? 0 : particle->minOccurs - 1;
13032 sub = particle->children->children;
13047 if (particle->minOccurs == 0) {
13061 sub = (xmlSchemaParticlePtr) particle
13077 "<element> particle has no term");
13122 if (particle->minOccurs == 0) {
13142 WXS_ITEM_TYPE_NAME(particle->children), NULL);
13213 * or particle, which has an element declaration as it's
14655 * @particle: the particle
14663 xmlSchemaGetParticleTotalRangeMin(xmlSchemaParticlePtr particle)
14665 if ((particle->children == NULL) ||
14666 (particle->minOccurs == 0))
14668 if (particle->children->type == XML_SCHEMA_TYPE_CHOICE) {
14671 (xmlSchemaParticlePtr) particle->children->children;
14687 return (particle->minOccurs * min);
14692 (xmlSchemaParticlePtr) particle->children->children;
14704 return (particle->minOccurs * sum);
14711 * @particle: the particle
14719 xmlSchemaGetParticleTotalRangeMax(xmlSchemaParticlePtr particle)
14721 if ((particle->children == NULL) ||
14722 (particle->children->children == NULL))
14724 if (particle->children->type == XML_SCHEMA_TYPE_CHOICE) {
14727 (xmlSchemaParticlePtr) particle->children->children;
14743 return (particle->maxOccurs * max);
14748 (xmlSchemaParticlePtr) particle->children->children;
14760 if ((cur > 0) && (particle->maxOccurs == UNBOUNDED))
14765 return (particle->maxOccurs * sum);
14772 * @particle: the particle
14774 * Schema Component Constraint: Particle Emptiable
14775 * Checks whether the given particle is emptiable.
14780 xmlSchemaIsParticleEmptiable(xmlSchemaParticlePtr particle)
14785 if ((particle == NULL) || (particle->minOccurs == 0) ||
14786 (particle->children == NULL))
14792 if (WXS_IS_MODEL_GROUP(particle->children)) {
14793 if (xmlSchemaGetParticleTotalRangeMin(particle) == 0)
15087 * The ball of letters below means, that if we have a particle
15117 /* Remove the particle. */
15120 /* Remove the particle. */
15125 * particle's {term}.
15132 * "1.2 the {term} property of a particle with
15141 "The particle's {max occurs} must be 1, since the "
15839 * type}'s particle must be `emptiable` as defined by
15840 * Particle Emptiable ($3.9.6)."
15850 "and a particle emptiable", NULL);
16137 * (1.4.3.2.2.2) "Particle Valid (Extension)"
16294 * definition itself must specify a particle.
16299 "The content type must specify a particle", NULL);
16330 * URGENT TODO SPEC (1.4.3.2.2.2) "The particle of the
16332 * of the {base type definition}'s particle, as defined
16333 * in Particle Valid (Extension) ($3.9.6)."
16335 * NOTE that we won't check "Particle Valid (Extension)",
16500 * and have a particle which is `emptiable` as defined in
16501 * Particle Emptiable ($3.9.6)."
16509 "a simple type or 'mixed' and an emptiable particle", NULL);
16529 * definition} must be elementOnly or mixed and have a particle
16530 * which is `emptiable` as defined in Particle Emptiable ($3.9.6)."
16539 "particle", NULL);
16562 * SPEC (5.4.2) "The particle of the complex type definition itself
16563 * must be a `valid restriction` of the particle of the {content
16564 * type} of the {base type definition} as defined in Particle Valid
16699 * is mixed and a particle emptiable.
16740 "mixed content and particle emptiable. The base type "
16779 * (3.9.6) Constraints on Particle Schema Components
16803 * @r: the restricting element declaration particle
16804 * @b: the base element declaration particle
16806 * (3.9.6) Constraints on Particle Schema Components
16808 * Particle Restriction OK (Elt:Elt -- NameAndTypeOK)
16910 * @r: the restricting element declaration particle
16911 * @b: the base wildcard particle
16913 * (3.9.6) Constraints on Particle Schema Components
16915 * Particle Derivation OK (Elt:Any -- NSCompat)
16930 * SPEC "For an element declaration particle to be a `valid restriction`
16931 * of a wildcard particle all of the following must be true:"
16954 * @r: the restricting element declaration particle
16955 * @b: the base model group particle
16957 * (3.9.6) Constraints on Particle Schema Components
16959 * Particle Derivation OK (Elt:All/Choice/Sequence -- RecurseAsIfGroup)
16980 * @r: the restricting wildcard particle
16981 * @b: the base wildcard particle
16983 * (3.9.6) Constraints on Particle Schema Components
16985 * Particle Derivation OK (Any:Any -- NSSubset)
17034 * (3.9.6) Constraints on Particle Schema Components
17036 * Particle Valid (Restriction) (cos-particle-restrict)
17057 * SPEC (1) "They are the same particle."
17070 * @r: the model group particle
17071 * @b: the base wildcard particle
17073 * (3.9.6) Constraints on Particle Schema Components
17075 * Particle Derivation OK (All/Choice/Sequence:Any --
17094 * SPEC "For a group particle to be a `valid restriction` of a
17095 * wildcard particle..."
17099 * Particle Valid (Restriction) ($3.9.6)."
17124 * @r: the <all> or <sequence> model group particle
17125 * @b: the base <all> or <sequence> model group particle
17127 * (3.9.6) Constraints on Particle Schema Components
17129 * Particle Derivation OK (All:All,Sequence:Sequence --
17150 * SPEC "For an all or sequence group particle to be a `valid
17151 * restriction` of another group particle with the same {compositor}..."
18042 "mixed as emptiable particle\n");
18283 * an emptiable particle, then a simple type definition which
18341 xmlSchemaParticlePtr particle =
18353 if ((particle == NULL) ||
18354 ((particle->type == XML_SCHEMA_TYPE_PARTICLE) &&
18355 ((particle->children->type == XML_SCHEMA_TYPE_ALL) ||
18356 (particle->children->type == XML_SCHEMA_TYPE_SEQUENCE) ||
18357 ((particle->children->type == XML_SCHEMA_TYPE_CHOICE) &&
18358 (particle->minOccurs == 0))) &&
18359 ( ((xmlSchemaTreeItemPtr) particle->children)->children == NULL))) {
18363 * a particle whose properties are as follows:..."
18366 * minOccurs/maxOccurs = 1 (i.e. a "particle emptiable").
18370 if ((particle == NULL) ||
18371 (particle->children->type != XML_SCHEMA_TYPE_SEQUENCE)) {
18373 * Create the particle.
18375 particle = xmlSchemaAddParticle(pctxt,
18377 if (particle == NULL)
18382 particle->children = (xmlSchemaTreeItemPtr)
18385 if (particle->children == NULL)
18388 type->subtypes = (xmlSchemaTypePtr) particle;
18400 * SPEC (2.2) "otherwise the particle corresponding to the
18498 * Create the particle.
18500 particle = xmlSchemaAddParticle(pctxt,
18502 if (particle == NULL)
18507 particle->children = (xmlSchemaTreeItemPtr)
18510 if (particle->children == NULL)
18512 WXS_TYPE_CONTENTTYPE(type) = (xmlSchemaTypePtr) particle;
18514 * SPEC "the particle of the {content type} of
18516 * Create a duplicate of the base type's particle
18519 particle->children->children =
18524 if (particle->children->children == NULL)
18526 particle = (xmlSchemaParticlePtr)
18527 particle->children->children;
18528 particle->children =
18533 particle->next = effectiveContent;
18536 * new-particle
18538 * new-particle
18540 * this-particle
18554 particle->children->children =
18890 * @particle: the first particle
18895 * Returns the particle with the circular model group definition reference,
18900 xmlSchemaTreeItemPtr particle)
18906 for (; particle != NULL; particle = particle->next) {
18907 term = particle->children;
18914 return (particle);
18959 * of a group there must not be at any depth a particle whose {term}
19001 * of the referencing particle.
19014 xmlSchemaParticlePtr particle = WXS_MODELGROUP_PARTICLE(mg);
19016 while (particle != NULL) {
19017 if ((WXS_PARTICLE_TERM(particle) == NULL) ||
19018 ((WXS_PARTICLE_TERM(particle))->type !=
19021 particle = WXS_PTC_CAST particle->next;
19024 if (WXS_MODELGROUPDEF_MODEL(WXS_PARTICLE_TERM(particle)) == NULL) {
19026 * TODO: Remove the particle.
19028 WXS_PARTICLE_TERM(particle) = NULL;
19029 particle = WXS_PTC_CAST particle->next;
19033 * Assign the model group to the {term} of the particle.
19035 WXS_PARTICLE_TERM(particle) =
19036 WXS_TREE_CAST WXS_MODELGROUPDEF_MODEL(WXS_PARTICLE_TERM(particle));
19038 particle = WXS_PTC_CAST particle->next;
19884 * @ctxtParticle: the first particle of the context component
19885 * @searchParticle: the element declaration particle to be analysed
19906 * Just return in this case. A missing "term" of the particle
19966 sub = WXS_PARTICLE_TERM(particle)->children; (xmlSchemaParticlePtr)
19998 * @item: an schema element declaration/particle
20024 * @particle: a particle component
20035 xmlSchemaParticlePtr particle = WXS_MODELGROUP_PARTICLE(mg);
20042 while (particle != NULL) {
20043 if ((WXS_PARTICLE_TERM(particle) == NULL) ||
20044 ((WXS_PARTICLE_TERM(particle))->type !=
20049 ref = WXS_QNAME_CAST WXS_PARTICLE_TERM(particle);
20054 particle->children = NULL;
20060 NULL, WXS_ITEM_NODE(particle), "ref", ref->name,
20062 /* TODO: remove the particle. */
20067 /* TODO: remove the particle. */
20071 * itself to the "term" of the particle. This will ease
20085 * (1.2) "the {term} property of a particle [... of] the "
20091 WXS_ITEM_NODE(particle), NULL,
20096 /* TODO: remove the particle. */
20099 particle->children = (xmlSchemaTreeItemPtr) refItem;
20105 particle->children = (xmlSchemaTreeItemPtr) refItem;
20108 particle = WXS_PTC_CAST particle->next;
20678 * group definition in I, as defined in Particle Valid
20852 * (local components), and those particle components need a bucket
20869 * in I, as defined in Particle Valid (Restriction) ($3.9.6)."
20902 * - the term of the particle (e.g. a model group)
21014 * Such a reference is reflected by a particle at the component
25916 * type}'s particle must be `emptiable` as defined by
25917 * Particle Emptiable ($3.9.6)."
25927 "or mixed content and a particle emptiable");
26637 * particle, as defined in Element Sequence Locally Valid
26638 * (Particle) ($3.9.4)."