44 #include "private/qxmlutils_p.h" 58 #include <QtCore/QFile> 59 #include <QtXmlPatterns/QXmlQuery> 153 :
m_parser(parser), m_machine(namePool)
167 for (
int i = 0; i < tokens.
count(); ++i)
170 m_parser->
error(QtXmlPatterns::tr(
"Can not process unknown element %1, expected elements are: %2.")
176 if (!m_machine.proceed(token)) {
180 for (
int i = 0; i < tokens.
count(); ++i)
183 m_parser->
error(QtXmlPatterns::tr(
"Element %1 is not allowed in this scope, possible elements are: %2.")
192 if (!m_machine.inEndState()) {
196 for (
int i = 0; i < tokens.
count(); ++i)
199 m_parser->
error(QtXmlPatterns::tr(
"Child element is missing in that scope, possible child elements are: %1.")
220 for (
int i = 0; i < particles.
count(); ++i) {
224 refParticles.
append(particles.
at(i));
254 , m_context(context.
data())
255 , m_parserContext(parserContext.
data())
256 , m_namePool(m_parserContext->namePool().
data())
257 , m_namespaceSupport(*m_namePool)
342 error(QtXmlPatterns::tr(
"Document is not a XML schema."));
364 error(QtXmlPatterns::tr(
"%1 attribute of %2 element contains invalid content: {%3} is not a value of type %4.")
370 error(QtXmlPatterns::tr(
"%1 attribute of %2 element contains invalid content: {%3}.")
396 error(QtXmlPatterns::tr(
"Target namespace %1 of included schema is different from the target namespace %2 as defined by the including schema.")
410 error(QtXmlPatterns::tr(
"Target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema.")
421 error(QtXmlPatterns::tr(
"Target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema.")
455 for (
int i = 0; i < blockDefaultList.
count(); ++i) {
456 const QString value = blockDefaultList.
at(i);
472 for (
int i = 0; i < finalDefaultList.
count(); ++i) {
473 const QString value = finalDefaultList.
at(i);
590 QUrl url(schemaLocation);
664 error(QtXmlPatterns::tr(
"%1 element is not allowed to have the same %2 attribute value as the target namespace %3.")
672 error(QtXmlPatterns::tr(
"%1 element without %2 attribute is not allowed inside schema without target namespace.")
682 QUrl url(schemaLocation);
705 parser.setTargetNamespace(importNamespace);
721 if (!importNamespace.
isEmpty()) {
812 redefinedSimpleTypes.
append(type);
821 redefinedComplexTypes.
append(type);
833 redefinedGroups.
append(group);
836 redefinedAttributeGroups.
append(group);
844 bool locationMustResolve =
false;
845 if (!redefinedSimpleTypes.
isEmpty() || !redefinedComplexTypes.
isEmpty() ||
846 !redefinedGroups.
isEmpty() || !redefinedAttributeGroups.
isEmpty()) {
847 locationMustResolve =
true;
850 QUrl url(schemaLocation);
897 for (
int i = 0; i < redefinedSimpleTypes.
count(); ++i) {
904 for (
int j = 0; j < contextSimpleTypes.
count(); ++j) {
941 for (
int i = 0; i < contextSimpleTypes.
count(); ++i) {
946 for (
int i = 0; i < redefinedComplexTypes.
count(); ++i) {
953 for (
int j = 0; j < contextComplexTypes.
count(); ++j) {
990 for (
int i = 0; i < redefinedGroups.
count(); ++i) {
998 int sameNameCounter = 0;
999 for (
int i = 0; i < particles.count(); ++i) {
1002 referencedParticle = particles.at(i);
1013 if (sameNameCounter > 1) {
1020 for (
int j = 0; j < contextGroups.
count(); ++j) {
1022 contextGroup = contextGroups.
at(j);
1027 if (!contextGroup) {
1032 if (sameNameCounter == 1) {
1040 referencedParticle->
setTerm(contextGroup);
1064 for (
int i = 0; i < redefinedAttributeGroups.
count(); ++i) {
1072 int sameNameCounter = 0;
1073 for (
int j = 0; j < group->attributeUses().count(); ++j) {
1075 if (attributeUse->isReference()) {
1083 if (sameNameCounter > 1) {
1090 for (
int j = 0; j < contextAttributeGroups.
count(); ++j) {
1093 baseGroup = contextGroup;
1103 if (sameNameCounter == 1) {
1112 for (
int j = 0; j < group->attributeUses().count(); ++j) {
1114 if (attributeUse->isReference()) {
1129 contextAttributeGroups.
removeAll(baseGroup);
1132 if (sameNameCounter == 0) {
1144 contextAttributeGroups.
removeAll(baseGroup);
1149 for (
int i = 0; i < contextComplexTypes.
count(); ++i) {
1154 for (
int i = 0; i < contextGroups.
count(); ++i) {
1159 for (
int i = 0; i < contextAttributeGroups.
count(); ++i) {
1165 for (
int i = 0; i < contextElements.count(); ++i) {
1170 for (
int i = 0; i < contextAttributes.count(); ++i) {
1175 for (
int i = 0; i < contextNotations.count(); ++i) {
1212 annotation->addApplicationInformation(info);
1215 annotation->addDocumentation(documentation);
1246 info->setSource(source);
1277 return documentation;
1282 documentation->setSource(source);
1292 return documentation;
1306 return documentation;
1391 simpleType->
setName(objectName);
1485 bool hasBaseAttribute =
false;
1486 bool hasBaseTypeSpecified =
false;
1494 hasBaseAttribute =
true;
1495 hasBaseTypeSpecified =
true;
1522 if (hasBaseAttribute) {
1523 error(QtXmlPatterns::tr(
"%1 element is not allowed inside %2 element if %3 attribute is present.")
1534 hasBaseTypeSpecified =
true;
1567 enumerationFacets.
append(facet);
1573 patternFacets.
append(facet);
1576 assertionFacets.
append(facet);
1583 if (!hasBaseTypeSpecified) {
1584 error(QtXmlPatterns::tr(
"%1 element has neither %2 attribute nor %3 child element.")
1592 if (!patternFacets.
isEmpty()) {
1597 for (
int i = 0; i < patternFacets.
count(); ++i)
1598 multiValue << patternFacets.
at(i)->multiValue();
1600 patternFacet->setMultiValue(multiValue);
1601 addFacet(patternFacet, facets, ptr);
1605 if (!enumerationFacets.
isEmpty()) {
1610 for (
int i = 0; i < enumerationFacets.
count(); ++i)
1611 multiValue << enumerationFacets.
at(i)->multiValue();
1613 enumerationFacet->setMultiValue(multiValue);
1614 addFacet(enumerationFacet, facets, ptr);
1618 if (!assertionFacets.
isEmpty()) {
1623 for (
int i = 0; i < assertionFacets.
count(); ++i)
1624 assertions << assertionFacets.
at(i)->assertions();
1626 assertionFacet->setAssertions(assertions);
1627 addFacet(assertionFacet, facets, ptr);
1647 bool hasItemTypeAttribute =
false;
1648 bool hasItemTypeSpecified =
false;
1656 hasItemTypeAttribute =
true;
1657 hasItemTypeSpecified =
true;
1680 if (hasItemTypeAttribute) {
1681 error(QtXmlPatterns::tr(
"%1 element is not allowed inside %2 element if %3 attribute is present.")
1692 hasItemTypeSpecified =
true;
1702 if (!hasItemTypeSpecified) {
1703 error(QtXmlPatterns::tr(
"%1 element has neither %2 attribute nor %3 child element.")
1715 defaultFacet->setFixed(
true);
1718 facets.
insert(defaultFacet->type(), defaultFacet);
1734 bool hasMemberTypesSpecified =
false;
1740 for (
int i = 0; i < memberTypes.
count(); ++i) {
1743 typeNames.
append(typeName);
1748 hasMemberTypesSpecified =
true;
1776 memberTypes.
append(type);
1788 hasMemberTypesSpecified =
true;
1791 if (!hasMemberTypesSpecified) {
1792 error(QtXmlPatterns::tr(
"%1 element has neither %2 attribute nor %3 child element.")
1822 facet->setFixed(
false);
1833 facet->setValue(
string);
1854 facet->addAnnotation(annotation);
1886 facet->setFixed(
false);
1897 facet->setValue(
string);
1918 facet->addAnnotation(annotation);
1950 facet->setFixed(
false);
1961 facet->setValue(
string);
1982 facet->addAnnotation(annotation);
2014 facet->setFixed(
false);
2025 facet->setValue(
string);
2046 facet->addAnnotation(annotation);
2078 facet->setFixed(
false);
2087 facet->setValue(integer);
2108 facet->addAnnotation(annotation);
2140 facet->setFixed(
false);
2149 facet->setValue(integer);
2170 facet->addAnnotation(annotation);
2202 facet->setFixed(
false);
2211 facet->setValue(integer);
2232 facet->addAnnotation(annotation);
2264 facet->setFixed(
false);
2273 facet->setValue(integer);
2294 facet->addAnnotation(annotation);
2326 facet->setFixed(
false);
2335 facet->setValue(integer);
2356 facet->addAnnotation(annotation);
2378 facet->setFixed(
false);
2390 multiValue << string;
2391 facet->setMultiValue(multiValue);
2413 facet->addAnnotation(annotation);
2445 facet->setFixed(
false);
2460 facet->setValue(
string);
2482 facet->addAnnotation(annotation);
2514 multiValue << string;
2515 facet->setMultiValue(multiValue);
2536 facet->addAnnotation(annotation);
2567 bool hasTypeSpecified =
false;
2568 bool hasComplexContent =
false;
2591 complexType->
setName(objectName);
2593 bool effectiveMixed =
false;
2603 effectiveMixed = value->
as<
Boolean>()->value();
2626 if (effectiveMixed) {
2627 error(QtXmlPatterns::tr(
"%1 element with %2 child element must not have a %3 attribute.")
2635 hasTypeSpecified =
true;
2639 hasTypeSpecified =
true;
2641 effectiveMixed = (effectiveMixed || mixed);
2642 hasComplexContent =
true;
2645 complexType->
contentType()->setOpenContent(openContent);
2646 hasComplexContent =
true;
2651 complexType->
contentType()->setParticle(particle);
2656 hasComplexContent =
true;
2661 complexType->
contentType()->setParticle(particle);
2666 hasComplexContent =
true;
2671 complexType->
contentType()->setParticle(particle);
2676 hasComplexContent =
true;
2681 complexType->
contentType()->setParticle(particle);
2686 hasComplexContent =
true;
2694 hasComplexContent =
true;
2702 hasComplexContent =
true;
2710 hasComplexContent =
true;
2722 if (!hasTypeSpecified) {
2725 hasComplexContent =
true;
2728 if (hasComplexContent ==
true) {
2741 bool hasTypeSpecified =
false;
2742 bool hasComplexContent =
true;
2748 bool effectiveMixed =
false;
2758 effectiveMixed = value->
as<
Boolean>()->value();
2782 hasTypeSpecified =
true;
2786 hasTypeSpecified =
true;
2788 effectiveMixed = (effectiveMixed || mixed);
2789 hasComplexContent =
true;
2792 complexType->
contentType()->setOpenContent(openContent);
2793 hasComplexContent =
true;
2798 complexType->
contentType()->setParticle(particle);
2803 hasComplexContent =
true;
2808 complexType->
contentType()->setParticle(particle);
2813 hasComplexContent =
true;
2818 complexType->
contentType()->setParticle(particle);
2823 hasComplexContent =
true;
2828 complexType->
contentType()->setParticle(particle);
2833 hasComplexContent =
true;
2841 hasComplexContent =
true;
2849 hasComplexContent =
true;
2857 hasComplexContent =
true;
2869 if (!hasTypeSpecified) {
2872 hasComplexContent =
true;
2875 if (hasComplexContent ==
true) {
2890 bool hasEmptyContent =
false;
2892 hasEmptyContent =
true;
2894 if (complexType->
contentType()->particle()->term()->isModelGroup()) {
2898 hasEmptyContent =
true;
2901 hasEmptyContent =
true;
2904 if ((complexType->
contentType()->particle()->maximumOccursUnbounded() ==
false) && (complexType->
contentType()->particle()->maximumOccurs() == 0))
2905 hasEmptyContent =
true;
3002 addFacet(facet, facets, complexType);
3005 addFacet(facet, facets, complexType);
3008 addFacet(facet, facets, complexType);
3011 addFacet(facet, facets, complexType);
3014 addFacet(facet, facets, complexType);
3017 addFacet(facet, facets, complexType);
3020 addFacet(facet, facets, complexType);
3023 addFacet(facet, facets, complexType);
3026 addFacet(facet, facets, complexType);
3029 enumerationFacets.
append(facet);
3032 addFacet(facet, facets, complexType);
3035 patternFacets.
append(facet);
3038 assertionFacets.
append(facet);
3060 if (!patternFacets.
isEmpty()) {
3065 for (
int i = 0; i < patternFacets.
count(); ++i)
3066 multiValue << patternFacets.
at(i)->multiValue();
3068 patternFacet->setMultiValue(multiValue);
3069 addFacet(patternFacet, facets, complexType);
3073 if (!enumerationFacets.
isEmpty()) {
3078 for (
int i = 0; i < enumerationFacets.
count(); ++i)
3079 multiValue << enumerationFacets.
at(i)->multiValue();
3081 enumerationFacet->setMultiValue(multiValue);
3082 addFacet(enumerationFacet, facets, complexType);
3086 if (!assertionFacets.
isEmpty()) {
3091 for (
int i = 0; i < assertionFacets.
count(); ++i)
3092 assertions << assertionFacets.
at(i)->assertions();
3094 assertionFacet->setAssertions(assertions);
3095 addFacet(assertionFacet, facets, complexType);
3228 bool hasContent =
false;
3246 complexType->
contentType()->setOpenContent(openContent);
3252 complexType->
contentType()->setParticle(particle);
3258 complexType->
contentType()->setParticle(particle);
3264 complexType->
contentType()->setParticle(particle);
3270 complexType->
contentType()->setParticle(particle);
3314 bool hasContent =
false;
3332 complexType->
contentType()->setOpenContent(openContent);
3338 complexType->
contentType()->setParticle(particle);
3344 complexType->
contentType()->setParticle(particle);
3350 complexType->
contentType()->setParticle(particle);
3356 complexType->
contentType()->setParticle(particle);
3394 assertion->setTest(expression);
3417 assertion->addAnnotation(annotation);
3472 openContent->addAnnotation(annotation);
3476 openContent->setWildcard(wildcard);
3562 reference->setReferenceName(referenceName);
3582 reference->addAnnotation(annotation);
3629 error(QtXmlPatterns::tr(
"%1 attribute of %2 element must be %3 or %4.")
3637 particles.
append(particle);
3665 error(QtXmlPatterns::tr(
"%1 attribute of %2 element must have a value of %3.")
3672 error(QtXmlPatterns::tr(
"%1 attribute of %2 element must have a value of %3 or %4.")
3706 error(QtXmlPatterns::tr(
"%1 attribute of %2 element must have a value of %3 or %4.")
3714 particles.
append(particle);
3762 particles.
append(particle);
3768 particles.
append(particle);
3773 particles.
append(particle);
3778 particles.
append(particle);
3783 particles.
append(particle);
3836 particles.
append(particle);
3842 particles.
append(particle);
3847 particles.
append(particle);
3852 particles.
append(particle);
3857 particles.
append(particle);
3905 particles.
append(particle);
3911 particles.
append(particle);
3916 particles.
append(particle);
3921 particles.
append(particle);
3926 particles.
append(particle);
3979 particles.
append(particle);
3985 particles.
append(particle);
3990 particles.
append(particle);
3995 particles.
append(particle);
4000 particles.
append(particle);
4025 error(QtXmlPatterns::tr(
"%1 element must not have %2 and %3 attribute together.")
4052 error(QtXmlPatterns::tr(
"Content of %1 attribute of %2 element must not be from namespace %3.")
4059 error(QtXmlPatterns::tr(
"%1 attribute of %2 element must not be %3.")
4065 attribute->
setName(objectName);
4067 bool hasTypeAttribute =
false;
4068 bool hasTypeSpecified =
false;
4071 hasTypeAttribute =
true;
4077 hasTypeSpecified =
true;
4100 if (hasTypeAttribute) {
4101 error(QtXmlPatterns::tr(
"%1 element with %2 child element must not have a %3 attribute.")
4111 hasTypeSpecified =
true;
4121 if (!hasTypeSpecified) {
4137 bool hasRefAttribute =
false;
4138 bool hasTypeAttribute =
false;
4139 bool hasTypeSpecified =
false;
4147 attributeUse = reference;
4148 hasRefAttribute =
true;
4154 error(QtXmlPatterns::tr(
"%1 element must not have %2 and %3 attribute together.")
4158 return attributeUse;
4161 if (hasRefAttribute) {
4163 error(QtXmlPatterns::tr(
"%1 element must not have %2 and %3 attribute together.")
4167 return attributeUse;
4170 error(QtXmlPatterns::tr(
"%1 element must not have %2 and %3 attribute together.")
4174 return attributeUse;
4177 error(QtXmlPatterns::tr(
"%1 element must not have %2 and %3 attribute together.")
4181 return attributeUse;
4192 attributeUse->valueConstraint()->setValue(value);
4197 attributeUse->valueConstraint()->setValue(value);
4206 return attributeUse;
4217 error(QtXmlPatterns::tr(
"%1 attribute of %2 element must have the value %3 because the %4 attribute is set.")
4222 return attributeUse;
4228 attributeUse->setAttribute(attribute);
4233 attribute->
scope()->setParent(parent);
4236 if (hasRefAttribute) {
4242 attributeReference->setReferenceName(referenceName);
4252 return attributeUse;
4274 error(QtXmlPatterns::tr(
"Content of %1 attribute of %2 element must not be from namespace %3.")
4278 return attributeUse;
4281 error(QtXmlPatterns::tr(
"%1 attribute of %2 element must not be %3.")
4285 return attributeUse;
4288 attribute->
setName(objectName);
4292 hasTypeAttribute =
true;
4298 hasTypeSpecified =
true;
4301 if (attributeUse->valueConstraint()) {
4307 attribute->
valueConstraint()->setValue(attributeUse->valueConstraint()->value());
4308 attribute->
valueConstraint()->setLexicalForm(attributeUse->valueConstraint()->lexicalForm());
4332 if (hasTypeAttribute) {
4333 error(QtXmlPatterns::tr(
"%1 element with %2 child element must not have a %3 attribute.")
4339 if (hasRefAttribute) {
4340 error(QtXmlPatterns::tr(
"%1 element with %2 child element must not have a %3 attribute.")
4350 hasTypeSpecified =
true;
4360 if (!hasTypeSpecified) {
4366 return attributeUse;
4379 attributeGroup->
setName(objectName);
4404 warning(QtXmlPatterns::tr(
"Specifying use='prohibited' inside an attribute group has no effect."));
4422 return attributeGroup;
4439 attributeReference->setReferenceName(referenceName);
4459 attributeReference->addAnnotation(annotation);
4468 return attributeReference;
4481 bool hasTypeAttribute =
false;
4482 bool hasTypeSpecified =
false;
4483 bool hasSubstitutionGroup =
false;
4504 error(QtXmlPatterns::tr(
"%1 element must not have %2 and %3 attribute together.")
4546 hasTypeAttribute =
true;
4547 hasTypeSpecified =
true;
4555 if (substitutionGroups.
isEmpty()) {
4560 for (
int i = 0; i < substitutionGroups.
count(); ++i) {
4569 elementNames.
append(elementName);
4574 hasSubstitutionGroup =
true;
4599 if (hasTypeAttribute) {
4600 error(QtXmlPatterns::tr(
"%1 element with %2 child element must not have a %3 attribute.")
4614 hasTypeSpecified =
true;
4616 if (hasTypeAttribute) {
4617 error(QtXmlPatterns::tr(
"%1 element with %2 child element must not have a %3 attribute.")
4631 hasTypeSpecified =
true;
4634 alternatives.
append(alternative);
4652 if (!hasTypeSpecified) {
4653 if (hasSubstitutionGroup)
4659 if (!alternatives.
isEmpty()) {
4662 for (
int i = 0; i < alternatives.
count(); ++i) {
4663 if (alternatives.
at(i)->
test())
4664 element->
typeTable()->addAlternative(alternatives.
at(i));
4666 if (i == (alternatives.
count() - 1)) {
4667 if (!alternatives.
at(i)->
test()) {
4668 element->
typeTable()->setDefaultTypeDefinition(alternatives.
at(i));
4671 if (element->
type())
4676 element->
typeTable()->setDefaultTypeDefinition(alternative);
4691 bool hasRefAttribute =
false;
4692 bool hasTypeAttribute =
false;
4693 bool hasTypeSpecified =
false;
4699 hasRefAttribute =
true;
4705 if (hasRefAttribute) {
4707 error(QtXmlPatterns::tr(
"%1 element must not have %2 and %3 attribute together.")
4713 error(QtXmlPatterns::tr(
"%1 element must not have %2 and %3 attribute together.")
4719 error(QtXmlPatterns::tr(
"%1 element must not have %2 and %3 attribute together.")
4725 error(QtXmlPatterns::tr(
"%1 element must not have %2 and %3 attribute together.")
4731 error(QtXmlPatterns::tr(
"%1 element must not have %2 and %3 attribute together.")
4737 error(QtXmlPatterns::tr(
"%1 element must not have %2 and %3 attribute together.")
4743 error(QtXmlPatterns::tr(
"%1 element must not have %2 and %3 attribute together.")
4757 error(QtXmlPatterns::tr(
"%1 element must have either %2 or %3 attribute.")
4764 if (hasRefAttribute) {
4770 reference->setReferenceName(referenceName);
4776 element->
scope()->setParent(parent);
4820 error(QtXmlPatterns::tr(
"%1 element must not have %2 and %3 attribute together.")
4845 hasTypeAttribute =
true;
4846 hasTypeSpecified =
true;
4874 if (hasRefAttribute) {
4875 error(QtXmlPatterns::tr(
"%1 element with %2 child element must not have a %3 attribute.")
4880 }
else if (hasTypeAttribute) {
4881 error(QtXmlPatterns::tr(
"%1 element with %2 child element must not have a %3 attribute.")
4895 hasTypeSpecified =
true;
4897 if (hasRefAttribute) {
4898 error(QtXmlPatterns::tr(
"%1 element with %2 child element must not have a %3 attribute.")
4903 }
else if (hasTypeAttribute) {
4904 error(QtXmlPatterns::tr(
"%1 element with %2 child element must not have a %3 attribute.")
4918 hasTypeSpecified =
true;
4920 if (hasRefAttribute) {
4921 error(QtXmlPatterns::tr(
"%1 element with %2 child element must not have a %3 attribute.")
4929 alternatives.
append(alternative);
4931 if (hasRefAttribute) {
4932 error(QtXmlPatterns::tr(
"%1 element with %2 child element must not have a %3 attribute.")
4942 if (hasRefAttribute) {
4943 error(QtXmlPatterns::tr(
"%1 element with %2 child element must not have a %3 attribute.")
4953 if (hasRefAttribute) {
4954 error(QtXmlPatterns::tr(
"%1 element with %2 child element must not have a %3 attribute.")
4971 if (!hasTypeSpecified && !hasRefAttribute)
4974 if (!hasRefAttribute && !alternatives.
isEmpty()) {
4977 for (
int i = 0; i < alternatives.
count(); ++i) {
4978 if (alternatives.
at(i)->
test())
4979 element->
typeTable()->addAlternative(alternatives.
at(i));
4981 if (i == (alternatives.
count() - 1)) {
4982 if (!alternatives.
at(i)->
test()) {
4983 element->
typeTable()->setDefaultTypeDefinition(alternatives.
at(i));
4986 if (element->
type())
4991 element->
typeTable()->setDefaultTypeDefinition(alternative);
5011 constraint->
setName(objectName);
5061 constraint->
setName(objectName);
5111 constraint->
setName(objectName);
5247 bool hasTypeSpecified =
false;
5255 alternative->
setTest(expression);
5264 hasTypeSpecified =
true;
5293 hasTypeSpecified =
true;
5301 hasTypeSpecified =
true;
5310 if (!hasTypeSpecified) {
5311 error(QtXmlPatterns::tr(
"%1 element must have either %2 attribute or %3 or %4 as child element.")
5332 notation->setName(objectName);
5334 bool hasOptionalAttribute =
false;
5344 notation->setPublicId(publicId);
5347 hasOptionalAttribute =
true;
5359 notation->setSystemId(systemId);
5362 hasOptionalAttribute =
true;
5365 if (!hasOptionalAttribute) {
5366 error(QtXmlPatterns::tr(
"%1 element requires either %2 or %3 attribute.")
5385 error(QtXmlPatterns::tr(
"Text or entity references not allowed inside %1 element").arg(
formatElement(
"notation.")));
5398 notation->addAnnotation(annotation);
5426 error(QtXmlPatterns::tr(
"%1 attribute of %2 element must contain %3, %4 or a list of URIs.")
5447 for (
int i = 0; i < newValues.
count(); ++i) {
5459 for (
int i = 0; i < newValues.
count(); ++i) {
5460 const QString stringValue = newValues.
at(i);
5538 error(QtXmlPatterns::tr(
"%1 attribute of %2 element must contain %3, %4 or a list of URIs.")
5559 for (
int i = 0; i < newValues.
count(); ++i) {
5571 for (
int i = 0; i < newValues.
count(); ++i) {
5572 const QString stringValue = newValues.
at(i);
5717 error(QtXmlPatterns::tr(
"%1 attribute of %2 element has larger value than %3 attribute.")
5742 error(QtXmlPatterns::tr(
"Prefix of qualified name %1 is not defined.").arg(
formatKeyword(qualifiedName)));
5799 for (
int i = 0; i < values.
count(); i++) {
5803 return SchemaType::DerivationConstraints();
5807 error(QtXmlPatterns::tr(
"%1 attribute of %2 element must either contain %3 or the other values.")
5811 return SchemaType::DerivationConstraints();
5823 return allowedConstraints;
5827 SchemaType::DerivationConstraints constraints;
5830 constraints |= SchemaType::RestrictionConstraint;
5832 constraints |= SchemaType::ExtensionConstraint;
5834 constraints |= SchemaType::ListConstraint;
5836 constraints |= SchemaType::UnionConstraint;
5860 for (
int i = 0; i < values.
count(); i++) {
5864 return NamedSchemaComponent::BlockingConstraints();
5868 error(QtXmlPatterns::tr(
"%1 attribute of %2 element must either contain %3 or the other values.")
5872 return NamedSchemaComponent::BlockingConstraints();
5884 return allowedConstraints;
5888 NamedSchemaComponent::BlockingConstraints constraints;
5891 constraints |= NamedSchemaComponent::RestrictionConstraint;
5893 constraints |= NamedSchemaComponent::ExtensionConstraint;
5895 constraints |= NamedSchemaComponent::SubstitutionConstraint;
5907 for (
int i = 0; i < namespaceBindings.
count(); ++i) {
5909 emptyName = namespaceBindings.
at(i);
5914 QString xpathDefaultNamespace;
5976 for (
int i = 0; i < namespaceBindings.
count(); ++i) {
5999 error(QtXmlPatterns::tr(
"Component with ID %1 has been defined previously.").arg(
formatData(value)));
6108 if (facets.
contains(facet->type())) {
6113 facets.
insert(facet->type(), facet);
TypeTable::Ptr typeTable() const
const QString & stringForLocalName(const QXmlName::LocalNameCode code) const
Error error() const
Returns the type of the current error, or NoError if no error occurred.
XsdSchemaParser(const XsdSchemaContext::Ptr &context, const XsdSchemaParserContext::Ptr &parserContext, QIODevice *device)
void addElement(const XsdElement::Ptr &element)
Match an assertion (Assertion Definition)
XsdTerm::Ptr parseLocalElement(const XsdParticle::Ptr &particle, const NamedSchemaComponent::Ptr &parent)
void setDefaultNamespace(const AnyURI::Ptr &defaultNamespace)
void warning(const QString &message) const
Convenience function for calling ReportContext::warning().
Represents a XSD facet object.
void addType(const SchemaType::Ptr &type)
void setName(const QXmlName &name)
QSet< QXmlName > m_builtinTypeNames
QString toString() const
Returns a copy of the string reference as a QString object.
void parseDefaultOpenContent()
QString displayName(const QXmlName qName) const
static const AtomicType::Ptr xsID
XsdModelGroup::Ptr parseLocalSequence(const XsdParticle::Ptr &particle, const NamedSchemaComponent::Ptr &parent)
XsdWildcard::Ptr parseAnyAttribute()
void addAttribute(const XsdAttribute::Ptr &attribute)
Represents a XSD simpleType object.
virtual QNetworkAccessManager * networkAccessManager() const
NamespaceSet m_redefinedSchemas
virtual TypeCategory category() const
void addSubstitutionGroupAffiliation(const XsdElement::Ptr &element, const QList< QXmlName > &elementName, const QSourceLocation &location)
bool isValid() const
Returns true if the URL is valid; otherwise returns false.
Represents a XSD element object.
static mach_timebase_info_data_t info
static QString absentNamespace()
TagValidationHandler(XsdTagScope::Type tag, XsdSchemaParser *parser, const NamePool::Ptr &namePool)
Represents a XSD attribute object.
Represents a XSD model group object.
Any namespace is allowed.
static bool isValidUri(const QString &string)
#define QT_END_NAMESPACE
This macro expands to.
QSet< T > toSet() const
Returns a QSet object with the data contained in this QList.
The model group is a choice.
XsdFacet::Ptr parseAssertionFacet()
XsdElement::Ptr element(const QXmlName &name) const
Match a minimum inclusive (Minimum Inclusive Definition)
XsdAttributeGroup::Ptr attributeGroup(const QXmlName name) const
void setItemType(const AnySimpleType::Ptr &type)
XsdFacet::Ptr parseMaxLengthFacet()
void clear()
Removes all items from the hash.
Represents a XSD identity constraint object.
virtual bool isSimpleType() const
The attribute has a default value set.
The QRegExp class provides pattern matching using regular expressions.
qint64 lineNumber() const
Returns the current line number, starting with 1.
void parseSchema(ParserType parserType)
XsdAttribute::Ptr parseGlobalAttribute()
void parseSelector(const XsdIdentityConstraint::Ptr &ptr)
void addIdentityConstraint(const XsdIdentityConstraint::Ptr &constraint)
QString formatKeyword(const QString &keyword)
XsdSchemaContext * m_context
XsdTerm::Ptr parseReferredGroup(const XsdParticle::Ptr &particle)
XsdFacet::Ptr parseFractionDigitsFacet()
void parseComplexContentExtension(const XsdComplexType::Ptr &complexType)
virtual bool hasError() const
The element is defined locally as child of a complex type or model group definition.
bool open(OpenMode flags)
Opens the file using OpenMode mode, returning true if successful; otherwise false.
The attribute use has a fixed value set.
void addSimpleListType(const XsdSimpleType::Ptr &simpleType, const QXmlName &typeName, const QSourceLocation &location)
void parseList(const XsdSimpleType::Ptr &ptr)
XsdAnnotation::Ptr parseAnnotation()
QString readXPathAttribute(const QString &attributeName, XPathType type, const char *elementName)
void addRedefinedAttributeGroups(const XsdAttributeGroup::Ptr &redefinedGroup, const XsdAttributeGroup::Ptr &group)
QueryLanguage
Specifies whether you want QXmlQuery to interpret the input to setQuery() as an XQuery or as an XSLT ...
A smart pointer very similar to std::auto_ptr.
XsdModelGroup::Ptr parseChoice(const NamedSchemaComponent::Ptr &parent)
XsdFacet::Ptr parseMinLengthFacet()
static NodeName toToken(const QString &value)
QString formatType(const NamePool::Ptr &np, const T &type)
Formats ItemType and SequenceType.
The QNetworkReply class contains the data and headers for a request sent with QNetworkAccessManager.
XsdTerm::Ptr term() const
void setContext(const NamedSchemaComponent::Ptr &component)
void setSelector(const XsdXPathExpression::Ptr &selector)
XsdSchema::Ptr schema() const
XsdIdentityConstraint::Ptr identityConstraint(const QXmlName &name) const
XsdIdentityConstraint::Ptr parseKey()
void setQuery(const QString &sourceCode, const QUrl &documentURI=QUrl())
This is an overloaded member function, provided for convenience. It differs from the above function o...
XsdComplexType::OpenContent::Ptr parseOpenContent()
void parseSimpleContent(const XsdComplexType::Ptr &complexType)
void setDerivationConstraints(const SchemaType::DerivationConstraints &constraints)
static AtomicValue::Ptr fromLexical(const NamePool::Ptr &np, const QString &strNumeric)
XsdComplexType::Ptr parseLocalComplexType()
ValueConstraint::Ptr valueConstraint() const
void addAttributeUse(const XsdAttributeUse::Ptr &use)
void setParticles(const XsdParticle::List &particles)
bool isEndElement() const
Returns true if tokenType() equals EndElement ; otherwise returns false.
The attribute is not allowed to be there.
void setUri(const QUrl &newUri)
Sets the URI to newUri.
XsdSchemaResolver::Ptr resolver() const
void validateIdAttribute(const char *elementName)
void addIdentityConstraint(const XsdIdentityConstraint::Ptr &constraint)
The attribute can be there but doesn't need to.
The model group contains elements only.
void addAttributeGroup(const XsdAttributeGroup::Ptr &group)
StorageType storedValue() const
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
XsdDocumentation::Ptr parseDocumentation()
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void setLine(qint64 newLine)
Sets the line number to newLine.
QStringRef name() const
Returns the local name of a StartElement, EndElement, or an EntityReference.
QXmlName::NamespaceCode allocateNamespace(const QString &uri)
bool isValid() const
Returns true if this query is valid.
void setIsAbstract(bool abstract)
Represents a XSD wildcard object.
int count(const T &t) const
Returns the number of occurrences of value in the list.
NamespaceSet m_includedSchemas
const QLatin1String XSI("http://www.w3.org/2001/XMLSchema-instance")
void setMinimumOccurs(unsigned int occurrence)
void addField(const XsdXPathExpression::Ptr &field)
Represents a XSD complexType object.
NamedSchemaComponent::BlockingConstraints readBlockingConstraintAttribute(const NamedSchemaComponent::BlockingConstraints &allowedConstraints, const char *elementName)
QExplicitlySharedDataPointer< XsdAttributeUse > Ptr
QString m_xpathDefaultNamespace
void addAdditionalNamespaceBinding(const QXmlName &binding)
XsdSimpleType::List simpleTypes() const
void resolveComplexContentType(const XsdComplexType::Ptr &complexType, bool effectiveMixed)
bool atEnd() const
Returns true if the reader has read until the end of the XML document, or if an error() has occurred ...
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
static QString toString(NodeName token)
XsdFacet::Ptr parseWhiteSpaceFacet()
void setSubstitutionGroupExclusions(const SchemaType::DerivationConstraints &exclusions)
QSourceLocation currentSourceLocation() const
The attribute use has a default value set.
A helper class for attribute reference resolving.
bool hasAttribute(const QString &namespaceURI, const QString &localName) const
Returns true if the current element has an attribute whose name is namespaceURI and local name is loc...
QXmlName createAnonymousName(const QString &targetNamespace) const
XsdModelGroup::List elementGroups() const
bool isCharacters() const
Returns true if tokenType() equals Characters ; otherwise returns false.
XsdSchemaParserContext * m_parserContext
The reference points to an attribute group.
The constraint is a keyref constraint.
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
XsdIdentityConstraint::Ptr parseKeyRef(const XsdElement::Ptr &element)
void setType(const AnySimpleType::Ptr &type)
bool isRelative() const
Returns true if the URL is relative; otherwise returns false.
void setDerivationMethod(DerivationMethod method)
XsdAttributeUse::Ptr parseLocalAttribute(const NamedSchemaComponent::Ptr &parent)
QExplicitlySharedDataPointer< XsdIdCache > Ptr
QString prefix(const QXmlNamePool &query) const
Returns the prefix.
void addIncludedSchemas(const NamespaceSet &schemas)
The QXmlNamePool class is a table of shared strings referenced by instances of QXmlName.
bool m_defaultOpenContentAppliesToEmpty
ContentType::Ptr contentType() const
void addKeyReference(const XsdElement::Ptr &element, const XsdIdentityConstraint::Ptr &keyRef, const QXmlName &name, const QSourceLocation &location)
Match a maximum exclusive (Maximum Exclusive Definition)
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
void setProcessContents(ProcessContents contents)
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
void setDefaultOpenContent(const XsdComplexType::OpenContent::Ptr &openContent, bool appliesToEmpty)
void addElement(const XsdElement::Ptr &element)
SchemaType::Ptr type() const
QExplicitlySharedDataPointer< XsdSchemaContext > Ptr
Q_CORE_EXPORT QTextStream & fixed(QTextStream &s)
void setMaximumOccurs(unsigned int occurrence)
The element has a default value set.
Match an enumeration (Enumeration Definition)
static const SchemaType::Ptr xsAnyType
static AtomicValue::Ptr fromLexical(const QString &val)
QStringRef namespaceUri() const
Returns the namespaceUri of a StartElement or EndElement.
void addIdentityConstraint(const XsdIdentityConstraint::Ptr &constraint)
static XsdParticle::List collectGroupRef(const XsdModelGroup::Ptr &group)
void parseComplexContent(const XsdComplexType::Ptr &complexType, bool *mixed)
T * data() const
Returns a pointer to the shared data object.
void append(const T &t)
Inserts value at the end of the list.
XsdAttributeUse::Ptr parseReferredAttributeGroup()
unsigned int maximumOccurs() const
No constraints at all: the item must simply be well-formed XML.
The reference points to a model group.
void addRedefinedGroups(const XsdModelGroup::Ptr &redefinedGroup, const XsdModelGroup::Ptr &group)
QLocale::Language language
#define QT_BEGIN_NAMESPACE
This macro expands to.
void addImportedSchemas(const NamespaceSet &schemas)
const TCastTarget * as() const
ComponentLocationHash m_componentLocationHash
QSet< T > & intersect(const QSet< T > &other)
QString m_elementFormDefault
Match the minimum length (Minimum Length Definition)
void addNotation(const XsdNotation::Ptr ¬ation)
void addAnnotation(const XsdAnnotation::Ptr &annotation)
static bool isEmpty(const char *str)
There must be a top-level declaration for the item available, or the item must have an xsi:type...
XsdIdCache::Ptr m_idCache
unsigned int minimumOccurs() const
void setFacets(const XsdFacet::Hash &facets)
XsdParticle::List particles() const
XsdComplexType::OpenContent::Ptr m_defaultOpenContent
XsdFacet::Ptr parseTotalDigitsFacet()
static QString formatElement(const QString &element)
Formats element name.
void setExpression(const QString &expression)
Namespaces in the namespaces set are not allowed.
bool contains(const T &value) const
void setColumn(qint64 newColumn)
Sets the column number to newColumn.
QList< T > toList() const
void parseSimpleContentExtension(const XsdComplexType::Ptr &complexType)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
A helper class for automatically handling namespace scopes of elements.
void addAllGroupCheck(const XsdReference::Ptr &reference)
bool parseMinMaxConstraint(const XsdParticle::Ptr &particle, const char *tagName)
void setTargetNamespaceExtended(const QString &targetNamespace)
void setWxsSuperType(const SchemaType::Ptr &type)
QString readQNameAttribute(const QString &typeAttribute, const char *elementName)
The resource loader will report no error and return an empty QNetworkReply.
Represents a XSD assertion object.
Represents a XSD particle object.
void setIncludedSchemas(const NamespaceSet &schemas)
const T & at(int i) const
Returns the item at index position i in the list.
XsdModelGroup::Ptr elementGroup(const QXmlName &name) const
The attribute must be there.
const QLatin1String XML("http://www.w3.org/XML/1998/namespace")
The QStringList class provides a list of strings.
void validateElement(const XsdTagScope::Type name) const
XsdNotation::Ptr notation(const QXmlName &name) const
bool isEntityReference() const
Returns true if tokenType() equals EntityReference ; otherwise returns false.
The namespace for the internal API of QtXmlPatterns.
A context for schema parsing.
The element has a fixed value set.
QString m_attributeFormDefault
XsdApplicationInformation::Ptr parseAppInfo()
const_iterator insert(const T &value)
The QSourceLocation class identifies a location in a resource by URI, line, and column.
XsdXPathExpression::Ptr test() const
static const char * data(const QByteArray &arr)
void setDerivationMethod(DerivationMethod method)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
XsdNotation::List notations() const
Represents a XSD annotation object.
void setIsAbstract(bool abstract)
QExplicitlySharedDataPointer< XsdParticle > Ptr
XsdFacet::Ptr parseMinInclusiveFacet()
Represents the XSD attributeGroup object.
Represents a XSD notation object, which should not be confused with the atomic type xs:NOTATION...
An element name to process.
const T * ptr(const T &t)
XsdFacet::Ptr parseLengthFacet()
void setWildcard(const XsdWildcard::Ptr &wildcard)
Describes the value constraint of an attribute.
void addId(const QString &id)
void setName(const QXmlName &name)
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
void setTerm(const XsdTerm::Ptr &term)
void addAttributeUse(const XsdAttributeUse::Ptr &use)
void addComplexBaseType(const XsdComplexType::Ptr &complexType, const QXmlName &baseName, const QSourceLocation &location, const XsdFacet::Hash &facets=XsdFacet::Hash())
void addRedefinedSchemas(const NamespaceSet &schemas)
void setDocumentURI(const QUrl &uri)
XsdComplexType::List complexTypes() const
static QString formatData(const QString &data)
void addSubstitutionGroupType(const XsdElement::Ptr &element)
void setTargetNamespace(const QXmlName::NamespaceCode code)
QExplicitlySharedDataPointer< XsdFacet > Ptr
void setMemberTypes(const AnySimpleType::List &types)
Base class for tokenizers that reads XML formats. This is XSLTTokenizer, and the W3C XML Schema parse...
SchemaType::Ptr type(const QXmlName &name) const
void setType(const SchemaType::Ptr &type)
QExplicitlySharedDataPointer< OpenContent > Ptr
void addAssertion(const XsdAssertion::Ptr &assertion)
QXmlName baseTypeNameOfType(const SchemaType::Ptr &type) const
XsdFacet::Ptr parseMinExclusiveFacet()
virtual QXmlName name(const NamePool::Ptr &namePool) const
void setNamespaceBindings(const QList< QXmlName > &bindings)
Match a whitespace rule (White Space Definition)
Match a maximum inclusive (Maximum Inclusive Definition)
void copyDataTo(const XsdSchemaResolver::Ptr &other) const
void setWxsSuperType(const SchemaType::Ptr &type)
bool isStartElement() const
Returns true if tokenType() equals StartElement ; otherwise returns false.
QHash< XsdTagScope::Type, XsdStateMachine< XsdSchemaToken::NodeName > > m_stateMachines
static const AtomicType::Ptr xsNonNegativeInteger
void setContext(const NamedSchemaComponent::Ptr &component)
QString m_targetNamespace
The constraint is an unique constraint.
virtual void error(const QString &msg)
QString localName(const QXmlNamePool &query) const
Returns the local name.
Implements the value instance of the xs:boolean type.
Match some double digits (Fraction Digits Definition)
QStringRef qualifiedName() const
Returns the qualified name of a StartElement or EndElement;.
static AnyURI::Ptr fromLexical(const QString &value, const TReportContext &context, const SourceLocationReflection *const r)
Constructs a xs:anyURI value from the lexical representation value.
Represents instances of derived xs:string types, such as xs:normalizedString.
static QNetworkReply * load(const QUrl &uri, QNetworkAccessManager *const networkManager, const ReportContext::Ptr &context, ErrorHandling handling=FailOnError)
Helper function that do NetworkAccessDelegator::get(), but does it blocked.
The complex type has only simple type content (e.g. text, number etc.)
Match a minimum exclusive (Minimum Exclusive Definition)
QString join(const QString &sep) const
Joins all the string list's strings into a single string with each element separated by the given sep...
void parseUnknownDocumentation()
void addEnumerationFacetValue(const AtomicValue::Ptr &facetValue, const NamespaceSupport &namespaceSupport)
void addElementGroup(const XsdModelGroup::Ptr &group)
void addComponentLocationHash(const QHash< NamedSchemaComponent::Ptr, QSourceLocation > &hash)
XsdAttributeGroup::Ptr parseNamedAttributeGroup()
NamespaceCode namespaceURI() const
Match some integer digits (Total Digits Definition)
XsdStateMachine< XsdSchemaToken::NodeName > m_machine
XsdModelGroup::Ptr parseNamedGroup()
bool maximumOccursUnbounded() const
NamespaceConstraint::Ptr namespaceConstraint() const
XsdComplexType::Ptr parseGlobalComplexType()
void setCategory(TypeCategory category)
The QXmlName class represents the name of an XML node, in an efficient, namespace-aware way...
void setRedefinedSchemas(const NamespaceSet &schemas)
XsdSimpleType::Ptr parseGlobalSimpleType()
void setDisallowedSubstitutions(const BlockingConstraints &substitutions)
The QFile class provides an interface for reading from and writing to files.
static const AtomicType::Ptr xsQName
QString trimmed(QString source)
virtual bool isReference() const
The reference points to an attribute use.
QString readNameAttribute(const char *elementName)
void setIsNillable(bool nillable)
XsdAlternative::Ptr parseAlternative()
void parseComplexContentRestriction(const XsdComplexType::Ptr &complexType)
QString simplified() const Q_REQUIRED_RESULT
Returns a string that has whitespace removed from the start and the end, and that has each sequence o...
Match the exact length (Length Definition)
XsdSchemaParser * m_parser
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
void setCompositor(ModelCompositor compositor)
void removeSimpleRestrictionBase(const XsdSimpleType::Ptr &type)
void addAnonymousType(const SchemaType::Ptr &type)
qint64 columnNumber() const
Returns the current column number, starting with 0.
static const SchemaType::Ptr xsAnySimpleType
Implements the parsing of XML schema file.
Match a regular expression (Pattern Definition)
static QTestResult::TestLocation location
void setAttributeWildcard(const XsdWildcard::Ptr &wildcard)
void convertName(const QString &qualified, NamespaceSupport::NameType type, QXmlName &name)
void setCategory(Category category)
Describes the scope of an attribute.
const QString & stringForNamespace(const QXmlName::NamespaceCode code) const
Represents a XSD attribute use object.
void setScope(const Scope::Ptr &scope)
QXmlStreamNamespaceDeclarations namespaceDeclarations() const
If the state() is StartElement , this function returns the element's namespace declarations.
XsdWildcard::Ptr parseAny(const XsdParticle::Ptr &particle)
XsdAssertion::Ptr parseAssertion(const XsdSchemaToken::NodeName &nodeName, const XsdTagScope::Type &tag)
void addAnonymousType(const SchemaType::Ptr &type)
QXmlName allocateQName(const QString &uri, const QString &localName, const QString &prefix=QString())
XsdModelGroup::Ptr parseAll(const NamedSchemaComponent::Ptr &parent)
void addFacet(const XsdFacet::Ptr &facet, XsdFacet::Hash &facets, const SchemaType::Ptr &type)
void attributeContentError(const char *attributeName, const char *elementName, const QString &value, const SchemaType::Ptr &type=SchemaType::Ptr())
XsdAttribute::List attributes() const
void setImportedSchemas(const NamespaceSet &schemas)
The element is defined globally as child of the schema object.
ValueConstraint::Ptr valueConstraint() const
XsdFacet::Ptr parseEnumerationFacet()
virtual bool isModelGroup() const
bool hasId(const QString &id) const
QExplicitlySharedDataPointer< XsdElement > Ptr
void setScope(const Scope::Ptr &scope)
void setTargetNamespace(const QString &targetNamespace)
XsdAttribute::Ptr attribute(const QXmlName &name) const
A helper class for element and group reference resolving.
QString readAttribute(const QString &localName, const QString &namespaceURI=QString()) const
Returns the value for attribute by name name.
XsdNotation::Ptr parseNotation()
bool parse(ParserType parserType=TopLevelParser)
~ElementNamespaceHandler()
NamespaceSet m_importedSchemas
bool exactMatch(const QString &str) const
Returns true if str is matched exactly by this regular expression; otherwise returns false...
void addElementGroup(const XsdModelGroup::Ptr &group)
XsdAttributeGroup::List attributeGroups() const
static const AtomicType::Ptr xsBoolean
static const AtomicType::Ptr xsNCName
void parseSimpleRestriction(const XsdSimpleType::Ptr &ptr)
void setValueConstraint(const ValueConstraint::Ptr &constraint)
void parseSimpleContentRestriction(const XsdComplexType::Ptr &complexType)
static const AtomicType::Ptr xsPositiveInteger
void addAttributeType(const XsdAttribute::Ptr &attribute, const QXmlName &typeName, const QSourceLocation &location)
The attribute is defined locally as child of a complex type or attribute group definition.
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
Represents instances of derived xs:integer types, such as xs:byte.
XsdModelGroup::Ptr parseSequence(const NamedSchemaComponent::Ptr &parent)
void addElementType(const XsdElement::Ptr &element, const QXmlName &typeName, const QSourceLocation &location)
XsdSchemaResolver * m_schemaResolver
void addNotation(const XsdNotation::Ptr ¬ation)
QExplicitlySharedDataPointer< XsdReference > Ptr
static QString formatURI(const NamePool::Ptr &np, const QXmlName::NamespaceCode &uri)
Formats uri, that's considered to be a URI, for display.
ModelCompositor compositor() const
Namespaces in the namespaces set are allowed.
XsdFacet::Ptr parseMaxInclusiveFacet()
If the item has a uniquely determined declaration available, it must be valid with respect to that de...
Represents a XSD alternative object.
XsdSimpleType::Ptr parseLocalSimpleType()
void setProhibitedSubstitutions(const BlockingConstraints &substitutions)
QList< QXmlName > namespaceBindings() const
QString readNamespaceAttribute(const QString &attributeName, const char *elementName)
static QString formatAttribute(const QString &attribute)
Formats attribute name.
QXmlName m_defaultAttributes
QStringRef text() const
Returns the text of Characters , Comment , DTD , or EntityReference.
QString errorString() const
Returns the error message that was set with raiseError().
void addSimpleUnionTypes(const XsdSimpleType::Ptr &simpleType, const QList< QXmlName > &typeNames, const QSourceLocation &location)
The attribute has a fixed value set.
static bool isQName(const QString &qName)
QUrl resolved(const QUrl &relative) const
Returns the result of the merge of this URL with relative.
The attribute is defined globally as child of the schema object.
void addType(const SchemaType::Ptr &type)
void setupStateMachines()
The resource loader will report the error via the report context.
void validate(XsdSchemaToken::NodeName token)
bool isAnyAttributeAllowed() const
The QIODevice class is the base interface class of all I/O devices in Qt.
void parseUnion(const XsdSimpleType::Ptr &ptr)
void removeComplexBaseType(const XsdComplexType::Ptr &type)
void setType(const SchemaType::Ptr &type)
Represents a XSD documentation object.
XsdXPathExpression::Ptr readXPathExpression(const char *elementName)
void addAttributeGroup(const XsdAttributeGroup::Ptr &group)
The complex type has further elements or attributes but no text as content.
void parseField(const XsdIdentityConstraint::Ptr &ptr)
void addAlternativeType(const XsdAlternative::Ptr &alternative, const QXmlName &typeName, const QSourceLocation &location)
void setTypeTable(const TypeTable::Ptr &table)
SchemaType::DerivationConstraints readDerivationConstraintAttribute(const SchemaType::DerivationConstraints &allowedConstraints, const char *elementName)
void setupBuiltinTypeNames()
XsdModelGroup::Ptr parseLocalAll(const XsdParticle::Ptr &particle, const NamedSchemaComponent::Ptr &parent)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
QExplicitlySharedDataPointer< XsdAttributeReference > Ptr
static bool isNCName(const QStringRef &ncName)
Determines whether c is a valid instance of production [4]NCName in the XML 1.0 Namespaces specificat...
The complex type has no further content.
NamespaceSupport m_namespaceSupport
The model group is a sequence.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
bool processName(const QString &qualifiedName, NameType type, QXmlName &name) const
void addComplexContentType(const XsdComplexType::Ptr &complexType, const XsdParticle::Ptr &content, bool mixed)
Represents a XSD assertion object.
The reference points to an element.
static const AtomicType::Ptr xsAnyURI
bool isSchemaTag(XsdSchemaToken::NodeName tag, XsdSchemaToken::NodeName token, XsdSchemaToken::NodeName namespaceToken) const
void setTest(const XsdXPathExpression::Ptr &test)
void setPrefixes(const QXmlStreamNamespaceDeclarations &declarations)
ElementNamespaceHandler(const XsdSchemaToken::NodeName &tag, XsdSchemaParser *parser)
virtual QXmlName name(const NamePool::Ptr &namePool) const
XsdFacet::Ptr parseMaxExclusiveFacet()
virtual QXmlName name(const NamePool::Ptr &np) const =0
Returns the name of the type.
XsdElement::List elements() const
Describes the open content object of a complex type.
void setMaximumOccursUnbounded(bool unbounded)
bool isNull() const
Returns true if this QXmlName is not initialized with a valid combination of {namespace URI}...
Match the maximum length (Maximum Length Definition)
The QXmlQuery class performs XQueries on XML data, or on non-XML data modeled to look like XML...
Helper class for keeping track of all existing IDs in a schema.
XsdSchemaParser * m_parser
static const AtomicType::Ptr xsToken
void setValueConstraint(const ValueConstraint::Ptr &constraint)
The constraint is a key constraint.
void addAttribute(const XsdAttribute::Ptr &attribute)
XsdIdentityConstraint::Ptr parseUnique()
static AtomicValue::Ptr fromLexical(const NamePool::Ptr &np, const QString &lexical)
XsdModelGroup::Ptr parseLocalChoice(const XsdParticle::Ptr &particle, const NamedSchemaComponent::Ptr &parent)
The QList class is a template class that provides lists.
void addSimpleRestrictionBase(const XsdSimpleType::Ptr &simpleType, const QXmlName &baseName, const QSourceLocation &location)
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
XsdElement::Ptr parseGlobalElement()
XsdFacet::Ptr parsePatternFacet()
void setTargetNamespace(const QString &targetNamespace)
void removeAt(int i)
Removes the item at index position i.