Package org.apache.xerces.validators.dtd

Examples of org.apache.xerces.validators.dtd.SimpleContentModel


            //
            //  Its a single leaf, so its an 'a' type of content model, i.e.
            //  just one instance of one element. That one is definitely a
            //  simple content model.
            //
            return new SimpleContentModel(specNode.value, -1, specNode.type);
        }
         else if ((specNode.type == XMLContentSpecNode.CONTENTSPECNODE_CHOICE)
              ||  (specNode.type == XMLContentSpecNode.CONTENTSPECNODE_SEQ))
        {
            //
            //  Lets see if both of the children are leafs. If so, then it
            //  it has to be a simple content model
            //
            XMLContentSpecNode specLeft = new XMLContentSpecNode();
            XMLContentSpecNode specRight = new XMLContentSpecNode();
            fElementDeclPool.getContentSpecNode(specNode.value, specLeft);
            fElementDeclPool.getContentSpecNode(specNode.otherValue, specRight);

            if ((specLeft.type == XMLContentSpecNode.CONTENTSPECNODE_LEAF)
            &&  (specRight.type == XMLContentSpecNode.CONTENTSPECNODE_LEAF))
            {
                //
                //  Its a simple choice or sequence, so we can do a simple
                //  content model for it.
                //
                return new SimpleContentModel
                (
                    specLeft.value
                    , specRight.value
                    , specNode.type
                );
            }
        }
         else if ((specNode.type == XMLContentSpecNode.CONTENTSPECNODE_ZERO_OR_ONE)
              ||  (specNode.type == XMLContentSpecNode.CONTENTSPECNODE_ZERO_OR_MORE)
              ||  (specNode.type == XMLContentSpecNode.CONTENTSPECNODE_ONE_OR_MORE))
        {
            //
            //  Its a repetition, so see if its one child is a leaf. If so
            //  its a repetition of a single element, so we can do a simple
            //  content model for that.
            //
            XMLContentSpecNode specLeft = new XMLContentSpecNode();
            fElementDeclPool.getContentSpecNode(specNode.value, specLeft);

            if (specLeft.type == XMLContentSpecNode.CONTENTSPECNODE_LEAF)
            {
                //
                //  It is, so we can create a simple content model here that
                //  will check for this repetition. We pass -1 for the unused
                //  right node.
                //
                return new SimpleContentModel(specLeft.value, -1, specNode.type);
            }
        }
         else
        {
            throw new CMException(ImplementationMessages.VAL_CST);
View Full Code Here


            //
            //  Its a single leaf, so its an 'a' type of content model, i.e.
            //  just one instance of one element. That one is definitely a
            //  simple content model.
            //
            return new SimpleContentModel(specNode.value, -1, specNode.type);
        }
         else if ((specNode.type == XMLContentSpecNode.CONTENTSPECNODE_CHOICE)
              ||  (specNode.type == XMLContentSpecNode.CONTENTSPECNODE_SEQ))
        {
            //
            //  Lets see if both of the children are leafs. If so, then it
            //  it has to be a simple content model
            //
            XMLContentSpecNode specLeft = new XMLContentSpecNode();
            XMLContentSpecNode specRight = new XMLContentSpecNode();
            fElementDeclPool.getContentSpecNode(specNode.value, specLeft);
            fElementDeclPool.getContentSpecNode(specNode.otherValue, specRight);

            if ((specLeft.type == XMLContentSpecNode.CONTENTSPECNODE_LEAF)
            &&  (specRight.type == XMLContentSpecNode.CONTENTSPECNODE_LEAF))
            {
                //
                //  Its a simple choice or sequence, so we can do a simple
                //  content model for it.
                //
                return new SimpleContentModel
                (
                    specLeft.value
                    , specRight.value
                    , specNode.type
                );
            }
        }
         else if ((specNode.type == XMLContentSpecNode.CONTENTSPECNODE_ZERO_OR_ONE)
              ||  (specNode.type == XMLContentSpecNode.CONTENTSPECNODE_ZERO_OR_MORE)
              ||  (specNode.type == XMLContentSpecNode.CONTENTSPECNODE_ONE_OR_MORE))
        {
            //
            //  Its a repetition, so see if its one child is a leaf. If so
            //  its a repetition of a single element, so we can do a simple
            //  content model for that.
            //
            XMLContentSpecNode specLeft = new XMLContentSpecNode();
            fElementDeclPool.getContentSpecNode(specNode.value, specLeft);

            if (specLeft.type == XMLContentSpecNode.CONTENTSPECNODE_LEAF)
            {
                //
                //  It is, so we can create a simple content model here that
                //  will check for this repetition. We pass -1 for the unused
                //  right node.
                //
                return new SimpleContentModel(specLeft.value, -1, specNode.type);
            }
        }
         else
        {
            throw new CMException(ImplementationMessages.VAL_CST);
View Full Code Here

TOP

Related Classes of org.apache.xerces.validators.dtd.SimpleContentModel

Copyright © 2018 www.massapicom. 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.