Examples of QNameSet


Examples of org.apache.xmlbeans.QNameSet

                    + QNameHelper.pretty( attrName ) );

            return;
        }

        QNameSet attrWildcardSet = state._attrModel.getWildcardSet();

        if (!attrWildcardSet.contains( attrName ))
        {
            emitFieldError(
                event,
                "Attribute not allowed: " + QNameHelper.pretty( attrName ) );
View Full Code Here

Examples of org.apache.xmlbeans.QNameSet

        else
        {
            candidateSplay = s.getFinishSplay();
            candidatePos = 0;

            QNameSet endSet = null;
           
            loop:
            for ( Splay t = candidateSplay ; ; )
            {
                for ( ; ; )
                {
                    t = t.prevSplay();
                   
                    if (t == s)
                        break loop;
                   
                    if (t.isContainer())
                        break;

                    if (t.isEnd())
                    {
                        t = t.getContainer();
                        break;
                    }
                }

                if (XmlBeans.ASSERTS)
                    XmlBeans.assertTrue( t.isContainer() );

                if (t.getName().equals( qname ))
                    break;

                if (endSet == null)
                    endSet = get_element_ending_delimiters( qname );

                if (endSet.contains( t.getName() ))
                    candidateSplay = t;
            }
        }
       
        return insertElement( qname, candidateSplay, candidatePos );
View Full Code Here

Examples of org.apache.xmlbeans.QNameSet

                    String nsText;
                    if (nsList == null)
                        nsText = "##any";
                    else
                        nsText = nsList.getStringValue();
                    QNameSet wcset = QNameSet.forWildcardNamespaceString(nsText, targetNamespace);
                   
                    if (baseModel != null && !extension)
                    {
                        if (baseModel.getWildcardSet() == null)
                        {
                            state.error("A restriction cannot add anyAttribute when the base type does not have anyAttribute", XmlErrorContext.DUPLICATE_ANY_ATTRIBUTE, xsdwc);
                            continue; // ignore the extra wildcard
                        }
                        else if (!baseModel.getWildcardSet().containsAll(wcset))
                        {
                            state.error("The anyAttribute namespace='" + nsText + "' is not a subset of the base type anyAttribute", XmlErrorContext.DUPLICATE_ANY_ATTRIBUTE, xsdwc);
                            continue; // ignore the restriction
                        }
                    }
                   
                    int wcprocess = translateWildcardProcess(xsdwc.xgetProcessContents());
                    if (result.getWildcardProcess() == SchemaAttributeModel.NONE)
                    {
                        result.setWildcardSet(wcset);
                        result.setWildcardProcess(wcprocess);
                    }
                    else
                    {
                        if (extension)
                        {
                            result.setWildcardSet(wcset.union(result.getWildcardSet()));
                            result.setWildcardProcess(wcprocess);
                        }
                        else
                        {
                            result.setWildcardSet(wcset.intersect(result.getWildcardSet()));
                            // keep old process
                        }
                    }
                    break;
                }
View Full Code Here

Examples of org.apache.xmlbeans.QNameSet

            if (!allowElt)
                state.error("Must be a sequence, choice or all here", XmlErrorContext.EXPLICIT_GROUP_NEEDED, parseTree);
            Any parseAny = (Any)parseTree;
            sPart = new SchemaParticleImpl();
            sPart.setParticleType(SchemaParticle.WILDCARD);
            QNameSet wcset;
            NamespaceList nslist = parseAny.xgetNamespace();
            if (nslist == null)
                wcset = QNameSet.ALL;
            else
                wcset = QNameSet.forWildcardNamespaceString(nslist.getStringValue(), targetNamespace);
View Full Code Here

Examples of org.apache.xmlbeans.QNameSet

        if (canloop && deterministic && !excludenext.isDisjoint(start))
        {
            // we have a possible looping nondeterminism.
            // let's take some time now to see if it's actually caused
            // by non-unique-particle-attribute or not.
            QNameSet suspectSet = excludenext.intersect(start);
           
            // compute the set of all particles that could start this group
            Map startMap = new HashMap();
            particlesMatchingStart(partImpl, suspectSet, startMap, new QNameSetBuilder());
           
View Full Code Here

Examples of org.apache.xmlbeans.QNameSet

            SchemaParticle part = (SchemaParticle)i.next();
            if (part.getParticleType() == SchemaParticle.WILDCARD)
            {
                if (afterMap.containsKey(part))
                {
                    QNameSet startSet = (QNameSet)startMap.get(part);
                    QNameSet afterSet = (QNameSet)afterMap.get(part);
                    if (!startSet.containsAll(afterSet))
                        return false;
                }
            }
            afterMap.remove(part);
View Full Code Here

Examples of org.apache.xmlbeans.QNameSet

        options.setLoadSubstituteNamespaces(NAMESPACE_UPDATES);
        return options;
    }

    public static void registerSubstitutionGroupElements(QName substitutionGroup, QNameSet substitutions) {
        QNameSet oldSubstitutions = substitutionGroups.get(substitutionGroup);
        if (oldSubstitutions != null) {
            substitutions = oldSubstitutions.union(substitutions);
        }
        substitutionGroups.put(substitutionGroup, substitutions);
    }
View Full Code Here

Examples of org.apache.xmlbeans.QNameSet

        }
        substitutionGroups.put(substitutionGroup, substitutions);
    }

    public static void unregisterSubstitutionGroupElements(QName substitutionGroup, QNameSet substitutions) {
        QNameSet oldSubstitutions = substitutionGroups.get(substitutionGroup);
        if (oldSubstitutions != null && substitutions != null) {
            QNameSet difference = oldSubstitutions.intersect(substitutions.inverse());
            substitutionGroups.put(substitutionGroup, difference);
        }
    }
View Full Code Here

Examples of org.apache.xmlbeans.QNameSet

    public static QNameSet getQNameSetForSubstitutionGroup(QName substitutionGroup) {
        return substitutionGroups.get(substitutionGroup);
    }

    public static XmlObject[] selectSubstitutionGroupElements(QName substitutionGroup, XmlObject container) {
        QNameSet substitutionGroupMembers = getQNameSetForSubstitutionGroup(substitutionGroup);
        if (substitutionGroupMembers == null) {
            return NO_ELEMENTS;
        }
        return container.selectChildren(substitutionGroupMembers);
    }
View Full Code Here

Examples of org.apache.xmlbeans.QNameSet

                        XmlValidationError validationError = (XmlValidationError) o;
                        List<QName> expected = validationError.getExpectedQNames();
                        QName actual = validationError.getOffendingQName();
                        if (expected != null) {
                            for (QName expectedQName : expected) {
                                QNameSet substitutions = getQNameSetForSubstitutionGroup(expectedQName);
                                if (substitutions != null && substitutions.contains(actual)) {
                                    iterator.remove();
                                    break;
                                }
                            }
                        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.