Changeset 846 for trunk/src/xmlpatterns/schema
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/xmlpatterns/schema/qxsdparticlechecker.cpp
r561 r846 345 345 bool XsdParticleChecker::isUPAConform(const XsdParticle::Ptr &particle, const NamePool::Ptr &namePool) 346 346 { 347 348 /** 349 * In case we encounter an <xsd:all> element, don't construct a state machine, but use the approach 350 * described at http://www.w3.org/TR/xmlschema-1/#non-ambig 351 * Reason: For n elements inside the <xsd:all>, represented in the NDA, the state machine 352 * constructs n! states in the DFA, which does not scale. 353 */ 354 if (particle->term()->isModelGroup()) { 355 const XsdModelGroup::Ptr group(particle->term()); 356 if (group->compositor() == XsdModelGroup::AllCompositor) 357 return isUPAConformXsdAll(particle, namePool); 358 } 359 347 360 /** 348 361 * The algorithm is implemented like described in http://www.ltg.ed.ac.uk/~ht/XML_Europe_2003.html#S2.2 … … 412 425 } 413 426 427 return true; 428 } 429 430 bool XsdParticleChecker::isUPAConformXsdAll(const XsdParticle::Ptr &particle, const NamePool::Ptr &namePool) 431 { 432 /** 433 * see http://www.w3.org/TR/xmlschema-1/#non-ambig 434 */ 435 const XsdModelGroup::Ptr group(particle->term()); 436 const XsdParticle::List particles = group->particles(); 437 const int count = particles.count(); 438 for (int left = 0; left < count; ++left) { 439 for (int right = left+1; right < count; ++right) { 440 if (termMatches(particles.at(left)->term(), particles.at(right)->term(), namePool)) 441 return false; 442 } 443 } 414 444 return true; 415 445 } -
trunk/src/xmlpatterns/schema/qxsdparticlechecker_p.h
r561 r846 86 86 87 87 /** 88 * Checks whether the given @p particle, which must be an xsd:all element, 89 * is valid according the UPA (http://www.w3.org/TR/xmlschema-1/#cos-nonambig) constraint. 90 * For xsd:all elements, we do not want to construct a state machine. 91 */ 92 static bool isUPAConformXsdAll(const XsdParticle::Ptr &particle, const NamePool::Ptr &namePool); 93 94 /** 88 95 * Checks whether the given @p particle subsumes the given @p derivedParticle. 89 96 * (http://www.w3.org/TR/xmlschema-1/#cos-particle-restrict) -
trunk/src/xmlpatterns/schema/qxsdschemachecker_setup.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/xmlpatterns/schema/qxsdschemaparser.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 915 915 916 916 // 3) remove the base type resolving job from the resolver as 917 // we have set the base type here explicit ely917 // we have set the base type here explicitly 918 918 m_parserContext->resolver()->removeSimpleRestrictionBase(redefinedType); 919 919 … … 964 964 965 965 // 3) remove the base type resolving job from the resolver as 966 // we have set the base type here explicit ely966 // we have set the base type here explicitly 967 967 m_parserContext->resolver()->removeComplexBaseType(redefinedType); 968 968 … … 5782 5782 SchemaType::DerivationConstraints XsdSchemaParser::readDerivationConstraintAttribute(const SchemaType::DerivationConstraints &allowedConstraints, const char *elementName) 5783 5783 { 5784 // first convert the flags into strings for easier comparis ion5784 // first convert the flags into strings for easier comparison 5785 5785 QSet<QString> allowedContent; 5786 5786 if (allowedConstraints & SchemaType::RestrictionConstraint) … … 5845 5845 NamedSchemaComponent::BlockingConstraints XsdSchemaParser::readBlockingConstraintAttribute(const NamedSchemaComponent::BlockingConstraints &allowedConstraints, const char *elementName) 5846 5846 { 5847 // first convert the flags into strings for easier comparis ion5847 // first convert the flags into strings for easier comparison 5848 5848 QSet<QString> allowedContent; 5849 5849 if (allowedConstraints & NamedSchemaComponent::RestrictionConstraint) -
trunk/src/xmlpatterns/schema/qxsdschemaparser_setup.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 54 54 * XML parent tag occur in the right order. 55 55 * 56 * To validate the occur ence of XML tags one need a regular expression that describes56 * To validate the occurrence of XML tags one need a regular expression that describes 57 57 * which tags can appear how often in what context. For example the regular expression 58 58 * of the global <em>attribute</em> tag in XML Schema is (annotation?, simpleType?). -
trunk/src/xmlpatterns/schema/qxsdstatemachine_p.h
r561 r846 139 139 * Continues execution of the machine with the given input @p transition. 140 140 * 141 * @return @c true if the transition was successful l, @c false otherwise.141 * @return @c true if the transition was successful, @c false otherwise. 142 142 */ 143 143 bool proceed(TransitionType transition); … … 155 155 * to find the right transition to use. 156 156 * 157 * @return @c true if the transition was successful l, @c false otherwise.157 * @return @c true if the transition was successful, @c false otherwise. 158 158 */ 159 159 template <typename InputType> -
trunk/src/xmlpatterns/schema/qxsdtypechecker.cpp
r561 r846 172 172 XsdTypeChecker::~XsdTypeChecker() 173 173 { 174 delete m_reflection; 174 175 } 175 176
Note:
See TracChangeset
for help on using the changeset viewer.