MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlSchemaCheckRCaseNSSubset

Function xmlSchemaCheckRCaseNSSubset

ThirdParty/libxml2/vtklibxml2/xmlschemas.c:16984–17018  ·  view source on GitHub ↗

* xmlSchemaCheckRCaseNSSubset: * @ctxt: the schema parser context * @r: the restricting wildcard particle * @b: the base wildcard particle * * (3.9.6) Constraints on Particle Schema Components * Schema Component Constraint: * Particle Derivation OK (Any:Any -- NSSubset) * (rcase-NSSubset) * * STATUS: complete * * Returns 0 if the constraints are satisfied, a positive * error code if

Source from the content-addressed store, hash-verified

16982 * error code if not and -1 if an internal error occurred.
16983 */
16984static int
16985xmlSchemaCheckRCaseNSSubset(xmlSchemaParserCtxtPtr ctxt,
16986 xmlSchemaParticlePtr r,
16987 xmlSchemaParticlePtr b,
16988 int isAnyTypeBase)
16989{
16990 /* TODO: Error codes (rcase-NSSubset). */
16991 /*
16992 * SPEC (1) "R's occurrence range is a valid restriction of B's
16993 * occurrence range as defined by Occurrence Range OK ($3.9.6)."
16994 */
16995 if (xmlSchemaCheckParticleRangeOK(r->minOccurs, r->maxOccurs,
16996 b->minOccurs, b->maxOccurs))
16997 return (1);
16998 /*
16999 * SPEC (2) "R's {namespace constraint} must be an intensional subset
17000 * of B's {namespace constraint} as defined by Wildcard Subset ($3.10.6)."
17001 */
17002 if (xmlSchemaCheckCOSNSSubset((xmlSchemaWildcardPtr) r->children,
17003 (xmlSchemaWildcardPtr) b->children))
17004 return (1);
17005 /*
17006 * SPEC (3) "Unless B is the content model wildcard of the `ur-type
17007 * definition`, R's {process contents} must be identical to or stronger
17008 * than B's {process contents}, where strict is stronger than lax is
17009 * stronger than skip."
17010 */
17011 if (! isAnyTypeBase) {
17012 if ( ((xmlSchemaWildcardPtr) r->children)->processContents <
17013 ((xmlSchemaWildcardPtr) b->children)->processContents)
17014 return (1);
17015 }
17016
17017 return (0);
17018}
17019
17020/**
17021 * xmlSchemaCheckCOSParticleRestrict:

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected