Home | History | Annotate | Download | only in libxml2

Lines Matching defs:particle

656  * A particle component.
664 xmlSchemaTreeItemPtr next; /* next particle */
685 xmlSchemaTreeItemPtr children; /* first particle (OR "element decl" OR "wildcard") */
1140 return(BAD_CAST "particle");
4258 * @particle: the schema particle
4265 xmlSchemaContentModelDump(xmlSchemaParticlePtr particle, FILE * output, int depth)
4272 if (particle == NULL)
4278 if (particle->children == NULL) {
4279 fprintf(output, "MISSING particle term\n");
4282 term = particle->children;
4310 if (particle->minOccurs != 1)
4311 fprintf(output, " min: %d", particle->minOccurs);
4312 if (particle->maxOccurs >= UNBOUNDED)
4314 else if (particle->maxOccurs != 1)
4315 fprintf(output, " max: %d", particle->maxOccurs);
4325 if (particle->next != NULL)
4326 xmlSchemaContentModelDump((xmlSchemaParticlePtr) particle->next,
5480 * Adds an XML schema particle component.
5494 fprintf(stderr, "Adding particle component\n");
5499 xmlSchemaPErrMemory(ctxt, "allocating particle component",
6824 * TODO: Maybe we should better not create the particle,
6829 * 3.9.6 Schema Component Constraint: Particle Correct
6863 * Parsea a XML schema <any> element. A particle and wildcard
6868 * Returns the particle or NULL in case of error or if minOccurs==maxOccurs==0
6874 xmlSchemaParticlePtr particle;
6941 * Create the particle.
6943 particle = xmlSchemaAddParticle(ctxt, node, min, max);
6944 if (particle == NULL)
6946 particle->annot = annot;
6947 particle->children = (xmlSchemaTreeItemPtr) wild;
6949 return (particle);
8431 * Returns the element declaration or a particle; NULL in case
8432 * of an error or if the particle has minOccurs==maxOccurs==0.
8439 xmlSchemaParticlePtr particle = NULL;
8478 * Skip particle part if a global declaration.
8483 * The particle part ==================================================
8488 particle = xmlSchemaAddParticle(ctxt, node, min, max);
8489 if (particle == NULL)
8552 * Create the reference item and attach it to the particle.
8558 particle->children = (xmlSchemaTreeItemPtr) refer;
8559 particle->annot = annot;
8561 * Add the particle to pending components, since the reference
8564 WXS_ADD_PENDING(ctxt, particle);
8565 return ((xmlSchemaBasicItemPtr) particle);
8804 particle->children = (xmlSchemaTreeItemPtr) decl;
8805 return ((xmlSchemaBasicItemPtr) particle);
8811 if (particle != NULL)
8812 particle->annot = NULL;
9323 * We will return a particle component with a qname-component or
11172 * @particleNeeded: if a a model group with a particle
11197 xmlSchemaParticlePtr particle = NULL;
11223 * Create a particle
11225 particle = xmlSchemaAddParticle(ctxt, node, min, max);
11226 if (particle == NULL)
11228 particle->children = (xmlSchemaTreeItemPtr) item;
11441 return ((xmlSchemaTreeItemPtr) particle);
12535 xmlSchemaParticlePtr particle, int counter, xmlAutomataStatePtr end)
12543 elemDecl = (xmlSchemaElementPtr) particle->children;
12552 xmlSchemaPErr(pctxt, WXS_ITEM_NODE(particle),
12577 } else if (particle->maxOccurs == 1) {
12609 int maxOccurs = particle->maxOccurs == UNBOUNDED ?
12610 UNBOUNDED : particle->maxOccurs - 1;
12611 int minOccurs = particle->minOccurs < 1 ? 0 : particle->minOccurs - 1;
12637 if (particle->minOccurs == 0) {
12652 xmlSchemaParticlePtr particle)
12656 if (((xmlSchemaElementPtr) particle->children)->flags &
12661 ret = xmlSchemaBuildContentModelForSubstGroup(ctxt, particle, -1, NULL);
12666 elemDecl = (xmlSchemaElementPtr) particle->children;
12670 if (particle->maxOccurs == 1) {
12674 } else if ((particle->maxOccurs >= UNBOUNDED) &&
12675 (particle->minOccurs < 2)) {
12684 int maxOccurs = particle->maxOccurs == UNBOUNDED ?
12685 UNBOUNDED : particle->maxOccurs - 1;
12686 int minOccurs = particle->minOccurs < 1 ?
12687 0 : particle->minOccurs - 1;
12697 if (particle->minOccurs == 0) {
12708 * @particle: the particle component
12717 xmlSchemaParticlePtr particle)
12721 if (particle == NULL) {
12722 PERROR_INT("xmlSchemaBuildAContentModel", "particle is NULL");
12725 if (particle->children == NULL) {
12727 * Just return in this case. A missing "term" of the particle
12733 switch (particle->children->type) {
12739 wild = (xmlSchemaWildcardPtr) particle->children;
12744 if (particle->maxOccurs == 1) {
12782 particle->maxOccurs == UNBOUNDED ? UNBOUNDED :
12783 particle->maxOccurs - 1;
12785 particle->minOccurs < 1 ? 0 : particle->minOccurs - 1;
12816 if (particle->minOccurs == 0) {
12824 ret = xmlSchemaBuildContentModelForElement(pctxt, particle);
12834 if ((particle->minOccurs == 1) && (particle->maxOccurs == 1)) {
12835 sub = particle->children->children;
12846 if (particle->maxOccurs >= UNBOUNDED) {
12847 if (particle->minOccurs > 1) {
12856 particle->minOccurs - 1, UNBOUNDED);
12858 sub = particle->children->children;
12880 sub = particle->children->children;
12896 if (particle->minOccurs == 0) {
12902 } else if ((particle->maxOccurs > 1)
12903 || (particle->minOccurs > 1)) {
12912 particle->minOccurs - 1,
12913 particle->maxOccurs - 1);
12915 sub = particle->children->children;
12928 if ((particle->minOccurs == 0) || (ret == 1)) {
12934 sub = particle->children->children;
12941 if (particle->minOccurs == 0) {
12962 if (particle->maxOccurs == 1) {
12963 sub = particle->children->children;
12975 int maxOccurs = particle->maxOccurs == UNBOUNDED ?
12976 UNBOUNDED : particle->maxOccurs - 1;
12978 particle->minOccurs < 1 ? 0 : particle->minOccurs - 1;
12989 sub = particle->children->children;
13004 if (particle->minOccurs == 0) {
13018 sub = (xmlSchemaParticlePtr) particle->children->children;
13034 "<element> particle has no term");
13079 if (particle->minOccurs == 0) {
13099 WXS_ITEM_TYPE_NAME(particle->children), NULL);
13170 * or particle, which has an element declaration as it's
14612 * @particle: the particle
14620 xmlSchemaGetParticleTotalRangeMin(xmlSchemaParticlePtr particle)
14622 if ((particle->children == NULL) ||
14623 (particle->minOccurs == 0))
14625 if (particle->children->type == XML_SCHEMA_TYPE_CHOICE) {
14628 (xmlSchemaParticlePtr) particle->children->children;
14644 return (particle->minOccurs * min);
14649 (xmlSchemaParticlePtr) particle->children->children;
14661 return (particle->minOccurs * sum);
14668 * @particle: the particle
14676 xmlSchemaGetParticleTotalRangeMax(xmlSchemaParticlePtr particle)
14678 if ((particle->children == NULL) ||
14679 (particle->children->children == NULL))
14681 if (particle->children->type == XML_SCHEMA_TYPE_CHOICE) {
14684 (xmlSchemaParticlePtr) particle->children->children;
14700 return (particle->maxOccurs * max);
14705 (xmlSchemaParticlePtr) particle->children->children;
14717 if ((cur > 0) && (particle->maxOccurs == UNBOUNDED))
14722 return (particle->maxOccurs * sum);
14729 * @particle: the particle
14731 * Schema Component Constraint: Particle Emptiable
14732 * Checks whether the given particle is emptiable.
14737 xmlSchemaIsParticleEmptiable(xmlSchemaParticlePtr particle)
14742 if ((particle == NULL) || (particle->minOccurs == 0) ||
14743 (particle->children == NULL))
14749 if (WXS_IS_MODEL_GROUP(particle->children)) {
14750 if (xmlSchemaGetParticleTotalRangeMin(particle) == 0)
15044 * The ball of letters below means, that if we have a particle
15074 /* Remove the particle. */
15077 /* Remove the particle. */
15082 * particle's {term}.
15089 * "1.2 the {term} property of a particle with
15098 "The particle's {max occurs} must be 1, since the "
15796 * type}'s particle must be ?emptiable? as defined by
15797 * Particle Emptiable (?3.9.6)."
15807 "and a particle emptiable", NULL);
16094 * (1.4.3.2.2.2) "Particle Valid (Extension)"
16251 * definition itself must specify a particle.
16256 "The content type must specify a particle", NULL);
16287 * URGENT TODO SPEC (1.4.3.2.2.2) "The particle of the
16289 * of the {base type definition}'s particle, as defined
16290 * in Particle Valid (Extension) (?3.9.6)."
16292 * NOTE that we won't check "Particle Valid (Extension)",
16457 * and have a particle which is ?emptiable? as defined in
16458 * Particle Emptiable (?3.9.6)."
16466 "a simple type or 'mixed' and an emptiable particle", NULL);
16486 * definition} must be elementOnly or mixed and have a particle
16487 * which is ?emptiable? as defined in Particle Emptiable (?3.9.6)."
16496 "particle", NULL);
16519 * SPEC (5.4.2) "The particle of the complex type definition itself
16520 * must be a ?valid restriction? of the particle of the {content
16521 * type} of the {base type definition} as defined in Particle Valid
16656 * is mixed and a particle emptiable.
16697 "mixed content and particle emptiable. The base type "
16736 * (3.9.6) Constraints on Particle Schema Components
16760 * @r: the restricting element declaration particle
16761 * @b: the base element declaration particle
16763 * (3.9.6) Constraints on Particle Schema Components
16765 * Particle Restriction OK (Elt:Elt -- NameAndTypeOK)
16867 * @r: the restricting element declaration particle
16868 * @b: the base wildcard particle
16870 * (3.9.6) Constraints on Particle Schema Components
16872 * Particle Derivation OK (Elt:Any -- NSCompat)
16887 * SPEC "For an element declaration particle to be a ?valid restriction?
16888 * of a wildcard particle all of the following must be true:"
16911 * @r: the restricting element declaration particle
16912 * @b: the base model group particle
16914 * (3.9.6) Constraints on Particle Schema Components
16916 * Particle Derivation OK (Elt:All/Choice/Sequence -- RecurseAsIfGroup)
16937 * @r: the restricting wildcard particle
16938 * @b: the base wildcard particle
16940 * (3.9.6) Constraints on Particle Schema Components
16942 * Particle Derivation OK (Any:Any -- NSSubset)
16991 * (3.9.6) Constraints on Particle Schema Components
16993 * Particle Valid (Restriction) (cos-particle-restrict)
17014 * SPEC (1) "They are the same particle."
17027 * @r: the model group particle
17028 * @b: the base wildcard particle
17030 * (3.9.6) Constraints on Particle Schema Components
17032 * Particle Derivation OK (All/Choice/Sequence:Any --
17051 * SPEC "For a group particle to be a ?valid restriction? of a
17052 * wildcard particle..."
17056 * Particle Valid (Restriction) (?3.9.6)."
17081 * @r: the <all> or <sequence> model group particle
17082 * @b: the base <all> or <sequence> model group particle
17084 * (3.9.6) Constraints on Particle Schema Components
17086 * Particle Derivation OK (All:All,Sequence:Sequence --
17107 * SPEC "For an all or sequence group particle to be a ?valid
17108 * restriction? of another group particle with the same {compositor}..."
17999 "mixed as emptiable particle\n");
18240 * an emptiable particle, then a simple type definition which
18298 xmlSchemaParticlePtr particle =
18310 if ((particle == NULL) ||
18311 ((particle->type == XML_SCHEMA_TYPE_PARTICLE) &&
18312 ((particle->children->type == XML_SCHEMA_TYPE_ALL) ||
18313 (particle->children->type == XML_SCHEMA_TYPE_SEQUENCE) ||
18314 ((particle->children->type == XML_SCHEMA_TYPE_CHOICE) &&
18315 (particle->minOccurs == 0))) &&
18316 ( ((xmlSchemaTreeItemPtr) particle->children)->children == NULL))) {
18320 * a particle whose properties are as follows:..."
18323 * minOccurs/maxOccurs = 1 (i.e. a "particle emptiable").
18327 if ((particle == NULL) ||
18328 (particle->children->type != XML_SCHEMA_TYPE_SEQUENCE)) {
18330 * Create the particle.
18332 particle = xmlSchemaAddParticle(pctxt,
18334 if (particle == NULL)
18339 particle->children = (xmlSchemaTreeItemPtr)
18342 if (particle->children == NULL)
18345 type->subtypes = (xmlSchemaTypePtr) particle;
18357 * SPEC (2.2) "otherwise the particle corresponding to the
18455 * Create the particle.
18457 particle = xmlSchemaAddParticle(pctxt,
18459 if (particle == NULL)
18464 particle->children = (xmlSchemaTreeItemPtr)
18467 if (particle->children == NULL)
18469 WXS_TYPE_CONTENTTYPE(type) = (xmlSchemaTypePtr) particle;
18471 * SPEC "the particle of the {content type} of
18473 * Create a duplicate of the base type's particle
18476 particle->children->children =
18481 if (particle->children->children == NULL)
18483 particle = (xmlSchemaParticlePtr)
18484 particle->children->children;
18485 particle->children =
18490 particle->next = effectiveContent;
18493 * new-particle
18495 * new-particle
18497 * this-particle
18511 particle->children->children =
18847 * @particle: the first particle
18852 * Returns the particle with the circular model group definition reference,
18857 xmlSchemaTreeItemPtr particle)
18863 for (; particle != NULL; particle = particle->next) {
18864 term = particle->children;
18871 return (particle);
18916 * of a group there must not be at any depth a particle whose {term}
18958 * of the referencing particle.
18971 xmlSchemaParticlePtr particle = WXS_MODELGROUP_PARTICLE(mg);
18973 while (particle != NULL) {
18974 if ((WXS_PARTICLE_TERM(particle) == NULL) ||
18975 ((WXS_PARTICLE_TERM(particle))->type !=
18978 particle = WXS_PTC_CAST particle->next;
18981 if (WXS_MODELGROUPDEF_MODEL(WXS_PARTICLE_TERM(particle)) == NULL) {
18983 * TODO: Remove the particle.
18985 WXS_PARTICLE_TERM(particle) = NULL;
18986 particle = WXS_PTC_CAST particle->next;
18990 * Assign the model group to the {term} of the particle.
18992 WXS_PARTICLE_TERM(particle) =
18993 WXS_TREE_CAST WXS_MODELGROUPDEF_MODEL(WXS_PARTICLE_TERM(particle));
18995 particle = WXS_PTC_CAST particle->next;
19841 * @ctxtParticle: the first particle of the context component
19842 * @searchParticle: the element declaration particle to be analysed
19863 * Just return in this case. A missing "term" of the particle
19923 sub = WXS_PARTICLE_TERM(particle)->children; (xmlSchemaParticlePtr)
19955 * @item: an schema element declaration/particle
19981 * @particle: a particle component
19992 xmlSchemaParticlePtr particle = WXS_MODELGROUP_PARTICLE(mg);
19999 while (particle != NULL) {
20000 if ((WXS_PARTICLE_TERM(particle) == NULL) ||
20001 ((WXS_PARTICLE_TERM(particle))->type !=
20006 ref = WXS_QNAME_CAST WXS_PARTICLE_TERM(particle);
20011 particle->children = NULL;
20017 NULL, WXS_ITEM_NODE(particle), "ref", ref->name,
20019 /* TODO: remove the particle. */
20024 /* TODO: remove the particle. */
20028 * itself to the "term" of the particle. This will ease
20042 * (1.2) "the {term} property of a particle [... of] the "
20048 WXS_ITEM_NODE(particle), NULL,
20053 /* TODO: remove the particle. */
20056 particle->children = (xmlSchemaTreeItemPtr) refItem;
20062 particle->children = (xmlSchemaTreeItemPtr) refItem;
20065 particle = WXS_PTC_CAST particle->next;
20635 * group definition in I, as defined in Particle Valid
20809 * (local components), and those particle components need a bucket
20826 * in I, as defined in Particle Valid (Restriction) (?3.9.6)."
20859 * - the term of the particle (e.g. a model group)
20971 * Such a reference is reflected by a particle at the component
25873 * type}'s particle must be ?emptiable? as defined by
25874 * Particle Emptiable (?3.9.6)."
25884 "or mixed content and a particle emptiable");
26577 * particle, as defined in Element Sequence Locally Valid
26578 * (Particle) (?3.9.4)."