Qt 4.8
Functions
qxsdschemaresolver.cpp File Reference
#include "qxsdschemaresolver_p.h"
#include "qderivedinteger_p.h"
#include "qderivedstring_p.h"
#include "qqnamevalue_p.h"
#include "qxsdattributereference_p.h"
#include "qxsdparticlechecker_p.h"
#include "qxsdreference_p.h"
#include "qxsdschemacontext_p.h"
#include "qxsdschemahelper_p.h"
#include "qxsdschemaparsercontext_p.h"
#include "qxsdschematypesfactory_p.h"

Go to the source code of this file.

Functions

bool hasCircularSubstitutionGroup (const XsdElement::Ptr &current, const XsdElement::Ptr &head, const NamePool::Ptr &namePool)
 
bool isSubstGroupHeadOf (const XsdElement::Ptr &head, const XsdElement::Ptr &element, const NamePool::Ptr &namePool)
 
bool isValidWildcardRestriction (const XsdWildcard::Ptr &wildcard, const XsdWildcard::Ptr &baseWildcard)
 

Function Documentation

◆ hasCircularSubstitutionGroup()

bool hasCircularSubstitutionGroup ( const XsdElement::Ptr current,
const XsdElement::Ptr head,
const NamePool::Ptr namePool 
)

Definition at line 1002 of file qxsdschemaresolver.cpp.

Referenced by QPatternist::XsdSchemaResolver::resolveSubstitutionGroupAffiliations().

1003 {
1004  if (current == head)
1005  return true;
1006  else {
1008  for (int i = 0; i < elements.count(); ++i) {
1009  if (hasCircularSubstitutionGroup(elements.at(i), head, namePool))
1010  return true;
1011  }
1012  }
1013 
1014  return false;
1015 }
XsdElement::List substitutionGroupAffiliations() const
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
bool hasCircularSubstitutionGroup(const XsdElement::Ptr &current, const XsdElement::Ptr &head, const NamePool::Ptr &namePool)
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
static const QTextHtmlElement elements[Html_NumElements]

◆ isSubstGroupHeadOf()

bool isSubstGroupHeadOf ( const XsdElement::Ptr head,
const XsdElement::Ptr element,
const NamePool::Ptr namePool 
)

Definition at line 1051 of file qxsdschemaresolver.cpp.

Referenced by QPatternist::XsdSchemaResolver::resolveSubstitutionGroups().

1052 {
1053  if (head->name(namePool) == element->name(namePool))
1054  return true;
1055 
1056  const XsdElement::List affiliations = element->substitutionGroupAffiliations();
1057  for (int i = 0; i < affiliations.count(); ++i) {
1058  if (isSubstGroupHeadOf(head, affiliations.at(i), namePool))
1059  return true;
1060  }
1061 
1062  return false;
1063 }
XsdElement::List substitutionGroupAffiliations() const
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
virtual QXmlName name(const NamePool::Ptr &namePool) const
bool isSubstGroupHeadOf(const XsdElement::Ptr &head, const XsdElement::Ptr &element, const NamePool::Ptr &namePool)

◆ isValidWildcardRestriction()

bool isValidWildcardRestriction ( const XsdWildcard::Ptr wildcard,
const XsdWildcard::Ptr baseWildcard 
)

Definition at line 1411 of file qxsdschemaresolver.cpp.

Referenced by QPatternist::XsdSchemaResolver::resolveAttributeInheritance().

1412 {
1413  if (wildcard->namespaceConstraint()->variety() == baseWildcard->namespaceConstraint()->variety()) {
1414  if (!XsdSchemaHelper::checkWildcardProcessContents(baseWildcard, wildcard))
1415  return false;
1416  }
1417 
1418  if (wildcard->namespaceConstraint()->variety() == XsdWildcard::NamespaceConstraint::Any &&
1419  baseWildcard->namespaceConstraint()->variety() != XsdWildcard::NamespaceConstraint::Any ) {
1420  return false;
1421  }
1422  if (baseWildcard->namespaceConstraint()->variety() == XsdWildcard::NamespaceConstraint::Not &&
1423  wildcard->namespaceConstraint()->variety() == XsdWildcard::NamespaceConstraint::Enumeration) {
1424  if (!baseWildcard->namespaceConstraint()->namespaces().intersect(wildcard->namespaceConstraint()->namespaces()).isEmpty())
1425  return false;
1426  }
1427  if (baseWildcard->namespaceConstraint()->variety() == XsdWildcard::NamespaceConstraint::Enumeration &&
1428  wildcard->namespaceConstraint()->variety() == XsdWildcard::NamespaceConstraint::Enumeration) {
1429  if (!wildcard->namespaceConstraint()->namespaces().subtract(baseWildcard->namespaceConstraint()->namespaces()).isEmpty())
1430  return false;
1431  }
1432 
1433  return true;
1434 }
static bool isEmpty(const char *str)
NamespaceConstraint::Ptr namespaceConstraint() const