Home | History | Annotate | Download | only in libxml2

Lines Matching full: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");
4279 * @particle: the schema particle
4286 xmlSchemaContentModelDump(xmlSchemaParticlePtr particle, FILE * output, int depth)
4293 if (particle == NULL)
4299 if (particle->children == NULL) {
4300 fprintf(output, "MISSING particle term\n");
4303 term = particle->children;
4331 if (particle->minOccurs != 1)
4332 fprintf(output, " min: %d", particle->minOccurs);
4333 if (particle->maxOccurs >= UNBOUNDED)
4335 else if (particle->maxOccurs != 1)
4336 fprintf(output, " max: %d", particle->maxOccurs);
4346 if (particle->next != NULL)
4347 xmlSchemaContentModelDump((xmlSchemaParticlePtr) particle->next,
5501 * Adds an XML schema particle component.
5515 fprintf(stderr, "Adding particle component\n");
5520 xmlSchemaPErrMemory(ctxt, "allocating particle component",
6845 * TODO: Maybe we should better not create the particle,
6850 * 3.9.6 Schema Component Constraint: Particle Correct
6884 * Parsea a XML schema <any> element. A particle and wildcard
6889 * Returns the particle or NULL in case of error or if minOccurs==maxOccurs==0
6895 xmlSchemaParticlePtr particle;
6962 * Create the particle.
6964 particle = xmlSchemaAddParticle(ctxt, node, min, max);
6965 if (particle == NULL)
6967 particle->annot = annot;
6968 particle
6970 return (particle);
8452 * Returns the element declaration or a particle; NULL in case
8453 * of an error or if the particle has minOccurs==maxOccurs==0.
8460 xmlSchemaParticlePtr particle = NULL;
8499 * Skip particle part if a global declaration.
8504 * The particle part ==================================================
8509 particle = xmlSchemaAddParticle(ctxt, node, min, max);
8510 if (particle == NULL)
8573 * Create the reference item and attach it to the particle.
8579 particle->children = (xmlSchemaTreeItemPtr) refer;
8580 particle->annot = annot;
8582 * Add the particle to pending components, since the reference
8585 WXS_ADD_PENDING(ctxt, particle);
8586 return ((xmlSchemaBasicItemPtr) particle);
8825 particle->children = (xmlSchemaTreeItemPtr) decl;
8826 return ((xmlSchemaBasicItemPtr) particle);
8832 if (particle != NULL)
8833 particle->annot = NULL;
9344 * We will return a particle component with a qname-component or
11193 * @particleNeeded: if a a model group with a particle
11218 xmlSchemaParticlePtr particle = NULL;
11244 * Create a particle
11246 particle = xmlSchemaAddParticle(ctxt, node, min, max);
11247 if (particle == NULL)
11249 particle->children = (xmlSchemaTreeItemPtr) item;
11462 return ((xmlSchemaTreeItemPtr) particle);
12556 xmlSchemaParticlePtr particle, int counter, xmlAutomataStatePtr end)
12564 elemDecl = (xmlSchemaElementPtr) particle->children;
12573 xmlSchemaPErr(pctxt, WXS_ITEM_NODE(particle),
12598 } else if (particle->maxOccurs == 1) {
12630 int maxOccurs = particle->maxOccurs == UNBOUNDED ?
12631 UNBOUNDED : particle->maxOccurs - 1;
12632 int minOccurs = particle->minOccurs < 1 ? 0 : particle->minOccurs - 1;
12658 if (particle->minOccurs == 0) {
12673 xmlSchemaParticlePtr particle)
12677 if (((xmlSchemaElementPtr) particle->children)->flags &
12682 ret = xmlSchemaBuildContentModelForSubstGroup(ctxt, particle, -1, NULL);
12687 elemDecl = (xmlSchemaElementPtr) particle->children;
12691 if (particle->maxOccurs == 1) {
12695 } else if ((particle->maxOccurs >= UNBOUNDED) &&
12696 (particle->minOccurs < 2)) {
12705 int maxOccurs = particle->maxOccurs == UNBOUNDED ?
12706 UNBOUNDED : particle->maxOccurs - 1;
12707 int minOccurs = particle->minOccurs < 1 ?
12708 0 : particle->minOccurs - 1;
12718 if (particle->minOccurs == 0) {
12729 * @particle: the particle component
12738 xmlSchemaParticlePtr particle)
12742 if (particle == NULL) {
12743 PERROR_INT("xmlSchemaBuildAContentModel", "particle is NULL");
12746 if (particle->children == NULL) {
12748 * Just return in this case. A missing "term" of the particle
12754 switch (particle->children->type) {
12760 wild = (xmlSchemaWildcardPtr) particle->children;
12765 if (particle->maxOccurs == 1) {
12803 particle->maxOccurs == UNBOUNDED ? UNBOUNDED :
12804 particle->maxOccurs - 1;
12806 particle->minOccurs < 1 ? 0 : particle->minOccurs - 1;
12837 if (particle->minOccurs == 0) {
12845 ret = xmlSchemaBuildContentModelForElement(pctxt, particle);
12855 if ((particle->minOccurs == 1) && (particle->maxOccurs == 1)) {
12856 sub = particle->children->children;
12867 if (particle->maxOccurs >= UNBOUNDED) {
12868 if (particle->minOccurs > 1) {
12877 particle->minOccurs - 1, UNBOUNDED);
12879 sub = particle->children->children;
12901 sub = particle->children->children;
12917 if (particle->minOccurs == 0) {
12923 } else if ((particle->maxOccurs > 1)
12924 || (particle->minOccurs > 1)) {
12933 particle->minOccurs - 1,
12934 particle->maxOccurs - 1);
12936 sub = particle->children->children;
12949 if ((particle->minOccurs == 0) || (ret == 1)) {
12955 sub = particle->children->children;
12971 if (particle->minOccurs == 0) {
12992 if (particle->maxOccurs == 1) {
12993 sub = particle->children->children;
13005 int maxOccurs = particle->maxOccurs == UNBOUNDED ?
13006 UNBOUNDED : particle->maxOccurs - 1;
13008 particle->minOccurs < 1 ? 0 : particle->minOccurs - 1;
13019 sub = particle->children->children;
13034 if (particle->minOccurs == 0) {
13048 sub = (xmlSchemaParticlePtr) particle->children->children;
13064 "<element> particle has no term");
13109 if (particle->minOccurs == 0) {
13129 WXS_ITEM_TYPE_NAME(particle->children), NULL);
13200 * or particle, which has an element declaration as it's
14642 * @particle: the particle
14650 xmlSchemaGetParticleTotalRangeMin(xmlSchemaParticlePtr particle)
14652 if ((particle->children == NULL) ||
14653 (particle->minOccurs == 0))
14655 if (particle->children->type == XML_SCHEMA_TYPE_CHOICE) {
14658 (xmlSchemaParticlePtr) particle->children->children;
14674 return (particle->minOccurs * min);
14679 (xmlSchemaParticlePtr) particle->children->children;
14691 return (particle->minOccurs * sum);
14698 * @particle: the particle
14706 xmlSchemaGetParticleTotalRangeMax(xmlSchemaParticlePtr particle)
14708 if ((particle->children == NULL) ||
14709 (particle->children->children == NULL))
14711 if (particle->children->type == XML_SCHEMA_TYPE_CHOICE) {
14714 (xmlSchemaParticlePtr) particle->children->children;
14730 return (particle->maxOccurs * max);
14735 (xmlSchemaParticlePtr) particle->children->children;
14747 if ((cur > 0) && (particle->maxOccurs == UNBOUNDED))
14752 return (particle->maxOccurs * sum);
14759 * @particle: the particle
14761 * Schema Component Constraint: Particle Emptiable
14762 * Checks whether the given particle is emptiable.
14767 xmlSchemaIsParticleEmptiable(xmlSchemaParticlePtr particle)
14772 if ((particle == NULL) || (particle->minOccurs == 0) ||
14773 (particle->children == NULL))
14779 if (WXS_IS_MODEL_GROUP(particle->children)) {
14780 if (xmlSchemaGetParticleTotalRangeMin(particle) == 0)
15074 * The ball of letters below means, that if we have a particle
15104 /* Remove the particle. */
15107 /* Remove the particle. */
15112 * particle's {term}.
15119 * "1.2 the {term} property of a particle with
15128 "The particle's {max occurs} must be 1, since the "
15826 * type}'s particle must be `emptiable` as defined by
15827 * Particle Emptiable ($3.9.6)."
15837 "and a particle emptiable", NULL);
16124 * (1.4.3.2.2.2) "Particle Valid (Extension)"
16281 * definition itself must specify a particle.
16286 "The content type must specify a particle", NULL);
16317 * URGENT TODO SPEC (1.4.3.2.2.2) "The particle of the
16319 * of the {base type definition}'s particle, as defined
16320 * in Particle Valid (Extension) ($3.9.6)."
16322 * NOTE that we won't check "Particle Valid (Extension)",
16487 * and have a particle which is `emptiable` as defined in
16488 * Particle Emptiable ($3.9.6)."
16496 "a simple type or 'mixed' and an emptiable particle", NULL);
16516 * definition} must be elementOnly or mixed and have a particle
16517 * which is `emptiable` as defined in Particle Emptiable ($3.9.6)."
16526 "particle", NULL);
16549 * SPEC (5.4.2) "The particle of the complex type definition itself
16550 * must be a `valid restriction` of the particle of the {content
16551 * type} of the {base type definition} as defined in Particle Valid
16686 * is mixed and a particle emptiable.
16727 "mixed content and particle emptiable. The base type "
16766 * (3.9.6) Constraints on Particle Schema Components
16790 * @r: the restricting element declaration particle
16791 * @b: the base element declaration particle
16793 * (3.9.6) Constraints on Particle Schema Components
16795 * Particle Restriction OK (Elt:Elt -- NameAndTypeOK)
16897 * @r: the restricting element declaration particle
16898 * @b: the base wildcard particle
16900 * (3.9.6) Constraints on Particle Schema Components
16902 * Particle Derivation OK (Elt:Any -- NSCompat)
16917 * SPEC "For an element declaration particle to be a `valid restriction`
16918 * of a wildcard particle all of the following must be true:"
16941 * @r: the restricting element declaration particle
16942 * @b: the base model group particle
16944 * (3.9.6) Constraints on Particle Schema Components
16946 * Particle Derivation OK (Elt:All/Choice/Sequence -- RecurseAsIfGroup)
16967 * @r: the restricting wildcard particle
16968 * @b: the base wildcard particle
16970 * (3.9.6) Constraints on Particle Schema Components
16972 * Particle Derivation OK (Any:Any -- NSSubset)
17021 * (3.9.6) Constraints on Particle Schema Components
17023 * Particle Valid (Restriction) (cos-particle-restrict)
17044 * SPEC (1) "They are the same particle."
17057 * @r: the model group particle
17058 * @b: the base wildcard particle
17060 * (3.9.6) Constraints on Particle Schema Components
17062 * Particle Derivation OK (All/Choice/Sequence:Any --
17081 * SPEC "For a group particle to be a `valid restriction` of a
17082 * wildcard particle..."
17086 * Particle Valid (Restriction) ($3.9.6)."
17111 * @r: the <all> or <sequence> model group particle
17112 * @b: the base <all> or <sequence> model group particle
17114 * (3.9.6) Constraints on Particle Schema Components
17116 * Particle Derivation OK (All:All,Sequence:Sequence --
17137 * SPEC "For an all or sequence group particle to be a `valid
17138 * restriction` of another group particle with the same {compositor}..."
18029 "mixed as emptiable particle\n");
18270 * an emptiable particle, then a simple type definition which
18328 xmlSchemaParticlePtr particle =
18340 if ((particle == NULL) ||
18341 ((particle->type == XML_SCHEMA_TYPE_PARTICLE) &&
18342 ((particle->children->type == XML_SCHEMA_TYPE_ALL) ||
18343 (particle->children->type == XML_SCHEMA_TYPE_SEQUENCE) ||
18344 ((particle->children->type == XML_SCHEMA_TYPE_CHOICE) &&
18345 (particle->minOccurs == 0))) &&
18346 ( ((xmlSchemaTreeItemPtr) particle->children)->children == NULL))) {
18350 * a particle whose properties are as follows:..."
18353 * minOccurs/maxOccurs = 1 (i.e. a "particle emptiable").
18357 if ((particle == NULL) ||
18358 (particle->children->type != XML_SCHEMA_TYPE_SEQUENCE)) {
18360 * Create the particle.
18362 particle = xmlSchemaAddParticle(pctxt,
18364 if (particle == NULL)
18369 particle->children = (xmlSchemaTreeItemPtr)
18372 if (particle->children == NULL)
18375 type->subtypes = (xmlSchemaTypePtr) particle;
18387 * SPEC (2.2) "otherwise the particle corresponding to the
18485 * Create the particle.
18487 particle = xmlSchemaAddParticle(pctxt,
18489 if (particle == NULL)
18494 particle->children = (xmlSchemaTreeItemPtr)
18497 if (particle->children == NULL)
18499 WXS_TYPE_CONTENTTYPE(type) = (xmlSchemaTypePtr) particle;
18501 * SPEC "the particle of the {content type} of
18503 * Create a duplicate of the base type's particle
18506 particle->children->children =
18511 if (particle->children->children == NULL)
18513 particle = (xmlSchemaParticlePtr)
18514 particle->children->children;
18515 particle->children =
18520 particle->next = effectiveContent;
18523 * new-particle
18525 * new-particle
18527 * this-particle
18541 particle->children->children =
18877 * @particle: the first particle
18882 * Returns the particle with the circular model group definition reference,
18887 xmlSchemaTreeItemPtr particle)
18893 for (; particle != NULL; particle = particle->next) {
18894 term = particle->children;
18901 return (particle);
18946 * of a group there must not be at any depth a particle whose {term}
18988 * of the referencing particle.
19001 xmlSchemaParticlePtr particle = WXS_MODELGROUP_PARTICLE(mg);
19003 while (particle != NULL) {
19004 if ((WXS_PARTICLE_TERM(particle) == NULL) ||
19005 ((WXS_PARTICLE_TERM(particle))->type !=
19008 particle = WXS_PTC_CAST particle->next;
19011 if (WXS_MODELGROUPDEF_MODEL(WXS_PARTICLE_TERM(particle)) == NULL) {
19013 * TODO: Remove the particle.
19015 WXS_PARTICLE_TERM(particle) = NULL;
19016 particle = WXS_PTC_CAST particle->next;
19020 * Assign the model group to the {term} of the particle.
19022 WXS_PARTICLE_TERM(particle) =
19023 WXS_TREE_CAST WXS_MODELGROUPDEF_MODEL(WXS_PARTICLE_TERM(particle));
19025 particle = WXS_PTC_CAST particle->next;
19871 * @ctxtParticle: the first particle of the context component
19872 * @searchParticle: the element declaration particle to be analysed
19893 * Just return in this case. A missing "term" of the particle
19953 sub = WXS_PARTICLE_TERM(particle)->children; (xmlSchemaParticlePtr)
19985 * @item: an schema element declaration/particle
20011 * @particle: a particle component
20022 xmlSchemaParticlePtr particle = WXS_MODELGROUP_PARTICLE(mg);
20029 while (particle != NULL) {
20030 if ((WXS_PARTICLE_TERM(particle) == NULL) ||
20031 ((WXS_PARTICLE_TERM(particle))->type !=
20036 ref = WXS_QNAME_CAST WXS_PARTICLE_TERM(particle);
20041 particle->children = NULL;
20047 NULL, WXS_ITEM_NODE(particle), "ref", ref->name,
20049 /* TODO: remove the particle. */
20054 /* TODO: remove the particle. */
20058 * itself to the "term" of the particle. This will ease
20072 * (1.2) "the {term} property of a particle [... of] the "
20078 WXS_ITEM_NODE(particle), NULL,
20083 /* TODO: remove the particle. */
20086 particle->children = (xmlSchemaTreeItemPtr) refItem;
20092 particle->children = (xmlSchemaTreeItemPtr) refItem;
20095 particle = WXS_PTC_CAST particle->next;
20665 * group definition in I, as defined in Particle Valid
20839 * (local components), and those particle components need a bucket
20856 * in I, as defined in Particle Valid (Restriction) ($3.9.6)."
20889 * - the term of the particle (e.g. a model group)
21001 * Such a reference is reflected by a particle at the component
25903 * type}'s particle must be `emptiable` as defined by
25904 * Particle Emptiable ($3.9.6)."
25914 "or mixed content and a particle emptiable");
26624 * particle, as defined in Element Sequence Locally Valid
26625 * (Particle) ($3.9.4)."