Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/xmlpatterns/schema/qxsdparticlechecker.cpp

    r561 r846  
    345345bool XsdParticleChecker::isUPAConform(const XsdParticle::Ptr &particle, const NamePool::Ptr &namePool)
    346346{
     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
    347360    /**
    348361     * The algorithm is implemented like described in http://www.ltg.ed.ac.uk/~ht/XML_Europe_2003.html#S2.2
     
    412425    }
    413426
     427    return true;
     428}
     429
     430bool 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    }
    414444    return true;
    415445}
  • trunk/src/xmlpatterns/schema/qxsdparticlechecker_p.h

    r561 r846  
    8686
    8787            /**
     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            /**
    8895             * Checks whether the given @p particle subsumes the given @p derivedParticle.
    8996             * (http://www.w3.org/TR/xmlschema-1/#cos-particle-restrict)
  • trunk/src/xmlpatterns/schema/qxsdschemachecker_setup.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/xmlpatterns/schema/qxsdschemaparser.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    915915
    916916                // 3) remove the base type resolving job from the resolver as
    917                 //    we have set the base type here explicitely
     917                //    we have set the base type here explicitly
    918918                m_parserContext->resolver()->removeSimpleRestrictionBase(redefinedType);
    919919
     
    964964
    965965                // 3) remove the base type resolving job from the resolver as
    966                 //    we have set the base type here explicitely
     966                //    we have set the base type here explicitly
    967967                m_parserContext->resolver()->removeComplexBaseType(redefinedType);
    968968
     
    57825782SchemaType::DerivationConstraints XsdSchemaParser::readDerivationConstraintAttribute(const SchemaType::DerivationConstraints &allowedConstraints, const char *elementName)
    57835783{
    5784     // first convert the flags into strings for easier comparision
     5784    // first convert the flags into strings for easier comparison
    57855785    QSet<QString> allowedContent;
    57865786    if (allowedConstraints & SchemaType::RestrictionConstraint)
     
    58455845NamedSchemaComponent::BlockingConstraints XsdSchemaParser::readBlockingConstraintAttribute(const NamedSchemaComponent::BlockingConstraints &allowedConstraints, const char *elementName)
    58465846{
    5847     // first convert the flags into strings for easier comparision
     5847    // first convert the flags into strings for easier comparison
    58485848    QSet<QString> allowedContent;
    58495849    if (allowedConstraints & NamedSchemaComponent::RestrictionConstraint)
  • trunk/src/xmlpatterns/schema/qxsdschemaparser_setup.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    5454 * XML parent tag occur in the right order.
    5555 *
    56  * To validate the occurence of XML tags one need a regular expression that describes
     56 * To validate the occurrence of XML tags one need a regular expression that describes
    5757 * which tags can appear how often in what context. For example the regular expression
    5858 * of the global <em>attribute</em> tag in XML Schema is (annotation?, simpleType?).
  • trunk/src/xmlpatterns/schema/qxsdstatemachine_p.h

    r561 r846  
    139139             * Continues execution of the machine with the given input @p transition.
    140140             *
    141              * @return @c true if the transition was successfull, @c false otherwise.
     141             * @return @c true if the transition was successful, @c false otherwise.
    142142             */
    143143            bool proceed(TransitionType transition);
     
    155155             *       to find the right transition to use.
    156156             *
    157              * @return @c true if the transition was successfull, @c false otherwise.
     157             * @return @c true if the transition was successful, @c false otherwise.
    158158             */
    159159            template <typename InputType>
  • trunk/src/xmlpatterns/schema/qxsdtypechecker.cpp

    r561 r846  
    172172XsdTypeChecker::~XsdTypeChecker()
    173173{
     174    delete m_reflection;
    174175}
    175176
Note: See TracChangeset for help on using the changeset viewer.