com.sun.org.apache.xerces.internal.impl.xs.SubstitutionGroupHandler Java Examples

The following examples show how to use com.sun.org.apache.xerces.internal.impl.xs.SubstitutionGroupHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: XSDFACM.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
Example #2
Source File: XSDFACM.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
Example #3
Source File: XSDFACM.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
Example #4
Source File: XSDFACM.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
Example #5
Source File: XSDFACM.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
Example #6
Source File: XSDFACM.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
Example #7
Source File: XSDFACM.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
Example #8
Source File: XSDFACM.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
Example #9
Source File: XSAllCM.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * The method corresponds to one transition in the content model.
 *
 * @param elementName
 * @param currentState  Current state
 * @return an element decl object
 */
public Object oneTransition (QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler) {

    // error state
    if (currentState[0] < 0) {
        currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
        return findMatchingDecl(elementName, subGroupHandler);
    }

    // seen child
    currentState[0] = STATE_CHILD;

    Object matchingDecl = null;

    for (int i = 0; i < fNumElements; i++) {
        // we only try to look for a matching decl if we have not seen
        // this element yet.
        if (currentState[i+1] != STATE_START)
            continue;
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null) {
            // found the decl, mark this element as "seen".
            currentState[i+1] = STATE_VALID;
            return matchingDecl;
        }
    }

    // couldn't find the decl, change to error state.
    currentState[0] = XSCMValidator.FIRST_ERROR;
    return findMatchingDecl(elementName, subGroupHandler);
}
 
Example #10
Source File: XSAllCM.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;
    for (int i = 0; i < fNumElements; i++) {
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null)
            break;
    }
    return matchingDecl;
}
 
Example #11
Source File: XSAllCM.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;
    for (int i = 0; i < fNumElements; i++) {
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null)
            break;
    }
    return matchingDecl;
}
 
Example #12
Source File: XSAllCM.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * check whether this content violates UPA constraint.
 *
 * @param subGroupHandler the substitution group handler
 * @return true if this content model contains other or list wildcard
 */
public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler) throws XMLSchemaException {
    // check whether there is conflict between any two leaves
    for (int i = 0; i < fNumElements; i++) {
        for (int j = i+1; j < fNumElements; j++) {
            if (XSConstraints.overlapUPA(fAllElements[i], fAllElements[j], subGroupHandler)) {
                // REVISIT: do we want to report all errors? or just one?
                throw new XMLSchemaException("cos-nonambig", new Object[]{fAllElements[i].toString(),
                                                                          fAllElements[j].toString()});
            }
        }
    }

    return false;
}
 
Example #13
Source File: XSEmptyCM.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * The method corresponds to one transaction in the content model.
 *
 * @param elementName the qualified name of the element
 * @param currentState Current state
 * @param subGroupHandler the substitution group handler
 * @return element index corresponding to the element from the Schema grammar
 */
public Object oneTransition (QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler){

    // error state
    if (currentState[0] < 0) {
        currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
        return null;
    }

    currentState[0] = XSCMValidator.FIRST_ERROR;
    return null;
}
 
Example #14
Source File: XSAllCM.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * check whether this content violates UPA constraint.
 *
 * @param subGroupHandler the substitution group handler
 * @return true if this content model contains other or list wildcard
 */
public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler) throws XMLSchemaException {
    // check whether there is conflict between any two leaves
    for (int i = 0; i < fNumElements; i++) {
        for (int j = i+1; j < fNumElements; j++) {
            if (XSConstraints.overlapUPA(fAllElements[i], fAllElements[j], subGroupHandler)) {
                // REVISIT: do we want to report all errors? or just one?
                throw new XMLSchemaException("cos-nonambig", new Object[]{fAllElements[i].toString(),
                                                                          fAllElements[j].toString()});
            }
        }
    }

    return false;
}
 
Example #15
Source File: XSAllCM.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * The method corresponds to one transition in the content model.
 *
 * @param elementName
 * @param currentState  Current state
 * @return an element decl object
 */
public Object oneTransition (QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler) {

    // error state
    if (currentState[0] < 0) {
        currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
        return findMatchingDecl(elementName, subGroupHandler);
    }

    // seen child
    currentState[0] = STATE_CHILD;

    Object matchingDecl = null;

    for (int i = 0; i < fNumElements; i++) {
        // we only try to look for a matching decl if we have not seen
        // this element yet.
        if (currentState[i+1] != STATE_START)
            continue;
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null) {
            // found the decl, mark this element as "seen".
            currentState[i+1] = STATE_VALID;
            return matchingDecl;
        }
    }

    // couldn't find the decl, change to error state.
    currentState[0] = XSCMValidator.FIRST_ERROR;
    return findMatchingDecl(elementName, subGroupHandler);
}
 
Example #16
Source File: XSAllCM.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * The method corresponds to one transition in the content model.
 *
 * @param elementName
 * @param currentState  Current state
 * @return an element decl object
 */
public Object oneTransition (QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler) {

    // error state
    if (currentState[0] < 0) {
        currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
        return findMatchingDecl(elementName, subGroupHandler);
    }

    // seen child
    currentState[0] = STATE_CHILD;

    Object matchingDecl = null;

    for (int i = 0; i < fNumElements; i++) {
        // we only try to look for a matching decl if we have not seen
        // this element yet.
        if (currentState[i+1] != STATE_START)
            continue;
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null) {
            // found the decl, mark this element as "seen".
            currentState[i+1] = STATE_VALID;
            return matchingDecl;
        }
    }

    // couldn't find the decl, change to error state.
    currentState[0] = XSCMValidator.FIRST_ERROR;
    return findMatchingDecl(elementName, subGroupHandler);
}
 
Example #17
Source File: XSAllCM.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;
    for (int i = 0; i < fNumElements; i++) {
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null)
            break;
    }
    return matchingDecl;
}
 
Example #18
Source File: XSAllCM.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;
    for (int i = 0; i < fNumElements; i++) {
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null)
            break;
    }
    return matchingDecl;
}
 
Example #19
Source File: XSAllCM.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * check whether this content violates UPA constraint.
 *
 * @param subGroupHandler the substitution group handler
 * @return true if this content model contains other or list wildcard
 */
public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler) throws XMLSchemaException {
    // check whether there is conflict between any two leaves
    for (int i = 0; i < fNumElements; i++) {
        for (int j = i+1; j < fNumElements; j++) {
            if (XSConstraints.overlapUPA(fAllElements[i], fAllElements[j], subGroupHandler)) {
                // REVISIT: do we want to report all errors? or just one?
                throw new XMLSchemaException("cos-nonambig", new Object[]{fAllElements[i].toString(),
                                                                          fAllElements[j].toString()});
            }
        }
    }

    return false;
}
 
Example #20
Source File: XSAllCM.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * The method corresponds to one transition in the content model.
 *
 * @param elementName
 * @param currentState  Current state
 * @return an element decl object
 */
public Object oneTransition (QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler) {

    // error state
    if (currentState[0] < 0) {
        currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
        return findMatchingDecl(elementName, subGroupHandler);
    }

    // seen child
    currentState[0] = STATE_CHILD;

    Object matchingDecl = null;

    for (int i = 0; i < fNumElements; i++) {
        // we only try to look for a matching decl if we have not seen
        // this element yet.
        if (currentState[i+1] != STATE_START)
            continue;
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null) {
            // found the decl, mark this element as "seen".
            currentState[i+1] = STATE_VALID;
            return matchingDecl;
        }
    }

    // couldn't find the decl, change to error state.
    currentState[0] = XSCMValidator.FIRST_ERROR;
    return findMatchingDecl(elementName, subGroupHandler);
}
 
Example #21
Source File: XSAllCM.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * check whether this content violates UPA constraint.
 *
 * @param subGroupHandler the substitution group handler
 * @return true if this content model contains other or list wildcard
 */
public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler) throws XMLSchemaException {
    // check whether there is conflict between any two leaves
    for (int i = 0; i < fNumElements; i++) {
        for (int j = i+1; j < fNumElements; j++) {
            if (XSConstraints.overlapUPA(fAllElements[i], fAllElements[j], subGroupHandler)) {
                // REVISIT: do we want to report all errors? or just one?
                throw new XMLSchemaException("cos-nonambig", new Object[]{fAllElements[i].toString(),
                                                                          fAllElements[j].toString()});
            }
        }
    }

    return false;
}
 
Example #22
Source File: XSEmptyCM.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * The method corresponds to one transaction in the content model.
 *
 * @param elementName the qualified name of the element
 * @param currentState Current state
 * @param subGroupHandler the substitution group handler
 * @return element index corresponding to the element from the Schema grammar
 */
public Object oneTransition (QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler){

    // error state
    if (currentState[0] < 0) {
        currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
        return null;
    }

    currentState[0] = XSCMValidator.FIRST_ERROR;
    return null;
}
 
Example #23
Source File: XSAllCM.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;
    for (int i = 0; i < fNumElements; i++) {
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null)
            break;
    }
    return matchingDecl;
}
 
Example #24
Source File: XSAllCM.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * The method corresponds to one transition in the content model.
 *
 * @param elementName
 * @param currentState  Current state
 * @return an element decl object
 */
public Object oneTransition (QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler) {

    // error state
    if (currentState[0] < 0) {
        currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
        return findMatchingDecl(elementName, subGroupHandler);
    }

    // seen child
    currentState[0] = STATE_CHILD;

    Object matchingDecl = null;

    for (int i = 0; i < fNumElements; i++) {
        // we only try to look for a matching decl if we have not seen
        // this element yet.
        if (currentState[i+1] != STATE_START)
            continue;
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null) {
            // found the decl, mark this element as "seen".
            currentState[i+1] = STATE_VALID;
            return matchingDecl;
        }
    }

    // couldn't find the decl, change to error state.
    currentState[0] = XSCMValidator.FIRST_ERROR;
    return findMatchingDecl(elementName, subGroupHandler);
}
 
Example #25
Source File: XSAllCM.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * check whether this content violates UPA constraint.
 *
 * @param subGroupHandler the substitution group handler
 * @return true if this content model contains other or list wildcard
 */
public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler) throws XMLSchemaException {
    // check whether there is conflict between any two leaves
    for (int i = 0; i < fNumElements; i++) {
        for (int j = i+1; j < fNumElements; j++) {
            if (XSConstraints.overlapUPA(fAllElements[i], fAllElements[j], subGroupHandler)) {
                // REVISIT: do we want to report all errors? or just one?
                throw new XMLSchemaException("cos-nonambig", new Object[]{fAllElements[i].toString(),
                                                                          fAllElements[j].toString()});
            }
        }
    }

    return false;
}
 
Example #26
Source File: XSEmptyCM.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * The method corresponds to one transaction in the content model.
 *
 * @param elementName the qualified name of the element
 * @param currentState Current state
 * @param subGroupHandler the substitution group handler
 * @return element index corresponding to the element from the Schema grammar
 */
public Object oneTransition (QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler){

    // error state
    if (currentState[0] < 0) {
        currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
        return null;
    }

    currentState[0] = XSCMValidator.FIRST_ERROR;
    return null;
}
 
Example #27
Source File: XSAllCM.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;
    for (int i = 0; i < fNumElements; i++) {
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null)
            break;
    }
    return matchingDecl;
}
 
Example #28
Source File: XSAllCM.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * The method corresponds to one transition in the content model.
 *
 * @param elementName
 * @param currentState  Current state
 * @return an element decl object
 */
public Object oneTransition (QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler) {

    // error state
    if (currentState[0] < 0) {
        currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
        return findMatchingDecl(elementName, subGroupHandler);
    }

    // seen child
    currentState[0] = STATE_CHILD;

    Object matchingDecl = null;

    for (int i = 0; i < fNumElements; i++) {
        // we only try to look for a matching decl if we have not seen
        // this element yet.
        if (currentState[i+1] != STATE_START)
            continue;
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null) {
            // found the decl, mark this element as "seen".
            currentState[i+1] = STATE_VALID;
            return matchingDecl;
        }
    }

    // couldn't find the decl, change to error state.
    currentState[0] = XSCMValidator.FIRST_ERROR;
    return findMatchingDecl(elementName, subGroupHandler);
}
 
Example #29
Source File: XSAllCM.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * check whether this content violates UPA constraint.
 *
 * @param subGroupHandler the substitution group handler
 * @return true if this content model contains other or list wildcard
 */
public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler) throws XMLSchemaException {
    // check whether there is conflict between any two leaves
    for (int i = 0; i < fNumElements; i++) {
        for (int j = i+1; j < fNumElements; j++) {
            if (XSConstraints.overlapUPA(fAllElements[i], fAllElements[j], subGroupHandler)) {
                // REVISIT: do we want to report all errors? or just one?
                throw new XMLSchemaException("cos-nonambig", new Object[]{fAllElements[i].toString(),
                                                                          fAllElements[j].toString()});
            }
        }
    }

    return false;
}
 
Example #30
Source File: XSEmptyCM.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * The method corresponds to one transaction in the content model.
 *
 * @param elementName the qualified name of the element
 * @param currentState Current state
 * @param subGroupHandler the substitution group handler
 * @return element index corresponding to the element from the Schema grammar
 */
public Object oneTransition (QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler){

    // error state
    if (currentState[0] < 0) {
        currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
        return null;
    }

    currentState[0] = XSCMValidator.FIRST_ERROR;
    return null;
}