Package org.apache.xerces.validators.dtd

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


        int retVal = 0;
        try
        {
            // Get the content model for this element
            final XMLContentModel cmElem = getContentModel(elementIndex);

            // And delegate this call to it
            retVal = cmElem.whatCanGoHere(fullyValid, info);
        }

        catch(CMException excToCatch)
        {
            // REVISIT - Translate caught error to the public error handler interface
View Full Code Here

    //  it will be created.
    //
    public XMLContentModel getContentModel(int elementIndex) throws CMException
    {
        // See if a content model already exists first
        XMLContentModel cmRet = fElementDeclPool.getContentModel(elementIndex);

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

        }
         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

        int retVal = 0;
        try
        {
            // Get the content model for this element
            final XMLContentModel cmElem = getContentModel(elementIndex);

            // And delegate this call to it
            retVal = cmElem.whatCanGoHere(fullyValid, info);
        }

        catch(CMException excToCatch)
        {
            // REVISIT - Translate caught error to the public error handler interface
View Full Code Here

    //  it will be created.
    //
    public XMLContentModel getContentModel(int elementIndex) throws CMException
    {
        // See if a content model already exists first
        XMLContentModel cmRet = fElementDeclPool.getContentModel(elementIndex);

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

TOP

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

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.