Examples of XMLContentModel


Examples of org.apache.xerces.validators.common.XMLContentModel

            return null;

        int chunk = contentSpecIndex >> CHUNK_SHIFT;
        int index = contentSpecIndex & CHUNK_MASK;

        XMLContentModel contentModel = fContentSpecValidator[chunk][index];

        // If we have one, just return that. Otherwise, gotta create one
        if (contentModel != null)
            return contentModel;

        if (contentType == XMLElementDecl.TYPE_SIMPLE) {
            return null;
        }

        // Get the type of content this element has
        int expendedIndex = convertContentSpecTree(contentSpecIndex);

        XMLContentSpec  contentSpec = new XMLContentSpec();
        getContentSpec( expendedIndex, contentSpec );

        // And create the content model according to the spec type

        if ( contentType == XMLElementDecl.TYPE_MIXED_SIMPLE ) {
              //
              //  just create a mixed content model object. This type of
              //  content model is optimized for simple mixed content validation.
              //

              Vector vQName = new Vector();
              ChildrenList children = new ChildrenList();
              contentSpecTree(expendedIndex, contentSpec, children);
              contentModel = new MixedContentModel(children.qname,
                                                   children.type,
                                                   0, children.length, false, isDTD());
        }
        else if (contentType == XMLElementDecl.TYPE_MIXED_COMPLEX) {
              //
              // For Schema, we need a more complex model.   Create a child model as
              // per the element-only case, unless there are actually no children in
              // the model.  If that's the case, we can use the Mixed Content Model for
              // DTDs.
              contentModel = createChildModel(expendedIndex, true);
        }


        else if (contentType == XMLElementDecl.TYPE_CHILDREN) {
            //  This method will create an optimal model for the complexity
            //  of the element's defined model. If it's simple, it will create
            //  a SimpleContentModel object. If it's a simple list, it will
            //  create a SimpleListContentModel object. If it's complex, it
            //  will create a DFAContentModel object.
            //
            contentModel = createChildModel(expendedIndex, false);
        } else {
            throw new CMException(ImplementationMessages.VAL_CST);
        }

        // Add the new model to the content model for this element

        fContentSpecValidator[chunk][index] = contentModel;

        //build it  ..... in XMLValidator
        if (contentModel != null)
            contentModel.setSubstitutionGroupComparator(comparator);

        return contentModel;
    }
View Full Code Here

Examples of org.apache.xerces.validators.common.XMLContentModel

        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }

    private XMLContentModel[][] resize(XMLContentModel array[][], int newsize) {
        XMLContentModel newarray[][] = new XMLContentModel[newsize][];
        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }
View Full Code Here

Examples of org.apache.xerces.validators.common.XMLContentModel

        // if it's not there, we create a new one, do UPA checking,
        // then throw it away. because UPA checking might result in NFA,
        // but we need DFA for further checking
        if (checkUniqueParticleAttribution) {
            checkingUPA = true;
            XMLContentModel contentModel = super.getContentModel(contentSpecIndex, contentType, comparator);
            checkingUPA = false;

            if (contentModel != null) {
                contentModel.checkUniqueParticleAttribution(this);
                clearContentModel(contentSpecIndex);
            }
        }

        return super.getContentModel(contentSpecIndex, contentType, comparator);
View Full Code Here

Examples of org.apache.xerces.validators.common.XMLContentModel

            return null;

        int chunk = elementDeclIndex >> CHUNK_SHIFT;
        int index = elementDeclIndex & CHUNK_MASK;

        XMLContentModel contentModel    =  fElementDeclContentModelValidator[chunk][index];

        // If we have one, just return that. Otherwise, gotta create one
        if (contentModel != null)
            return contentModel;
View Full Code Here

Examples of org.apache.xerces.validators.common.XMLContentModel

        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }

    private XMLContentModel[][] resize(XMLContentModel array[][], int newsize) {
        XMLContentModel newarray[][] = new XMLContentModel[newsize][];
        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }
View Full Code Here

Examples of org.apache.xerces.validators.common.XMLContentModel

            return null;

        int chunk = elementDeclIndex >> CHUNK_SHIFT;
        int index = elementDeclIndex & CHUNK_MASK;

        XMLContentModel contentModel    =  fElementDeclContentModelValidator[chunk][index];

        // If we have one, just return that. Otherwise, gotta create one
        if (contentModel != null)
            return contentModel;
View Full Code Here

Examples of org.apache.xerces.validators.common.XMLContentModel

        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }

    private XMLContentModel[][] resize(XMLContentModel array[][], int newsize) {
        XMLContentModel newarray[][] = new XMLContentModel[newsize][];
        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }
View Full Code Here

Examples of org.apache.xerces.validators.common.XMLContentModel

            return null;

        int chunk = elementDeclIndex >> CHUNK_SHIFT;
        int index = elementDeclIndex & CHUNK_MASK;

        XMLContentModel contentModel    =  fElementDeclContentModelValidator[chunk][index];

        // If we have one, just return that. Otherwise, gotta create one
        if (contentModel != null)
            return contentModel;
View Full Code Here

Examples of org.apache.xerces.validators.common.XMLContentModel

        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }

    private XMLContentModel[][] resize(XMLContentModel array[][], int newsize) {
        XMLContentModel newarray[][] = new XMLContentModel[newsize][];
        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }
View Full Code Here

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

        }
         else if (contentSpec == fStringPool.addSymbol("MIXED")
              ||  contentSpec == fStringPool.addSymbol("CHILDREN"))
        {
            // Get the content model for this element, faulting it in if needed
            XMLContentModel cmElem = null;
            try
            {
                cmElem = getContentModel(elementIndex);
                return cmElem.validateContent(childCount, children);
            }

            catch(CMException excToCatch)
            {
                int majorCode = excToCatch.getErrorCode();
                fErrorReporter.reportError(fErrorReporter.getLocator(),
                                           ImplementationMessages.XERCES_IMPLEMENTATION_DOMAIN,
                                           majorCode,
                                           0,
                                           null,
                                           XMLErrorReporter.ERRORTYPE_FATAL_ERROR);
            }
        }
         else if (contentSpec == -1)
        {
            Object[] args = { fStringPool.toString(elementTypeIndex) };
            fErrorReporter.reportError(fErrorReporter.getLocator(),
                                       XMLMessages.XML_DOMAIN,
                                       XMLMessages.MSG_ELEMENT_NOT_DECLARED,
                                       XMLMessages.VC_ELEMENT_VALID,
                                       args,
                                       XMLErrorReporter.ERRORTYPE_RECOVERABLE_ERROR);
        }
         else if (contentSpec == fStringPool.addSymbol("DATATYPE"))
        {

            XMLContentModel cmElem = null;
            try {
                cmElem = getContentModel(elementIndex);
                return cmElem.validateContent(1, new int[] { fStringPool.addString(fDatatypeBuffer.toString()) });
            } catch (CMException cme) {
                System.out.println("Internal Error in datatype validation");
            } catch (InvalidDatatypeValueException idve) {
                reportSchemaError(SchemaMessageProvider.DatatypeError,
                                  new Object [] { idve.getMessage() });
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.