Changeset 846 for trunk/src/xmlpatterns/schema/qxsdparticlechecker.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 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 }
Note:
See TracChangeset
for help on using the changeset viewer.