Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlDocumentProperties


                XmlObject result = xmlObject.changeType(EjbJarDocument.type);
                validateDD(result);
                return (EjbJarDocument) result;
            }
            // deployment descriptor is probably in EJB 1.1 or 2.0 format
            XmlDocumentProperties xmlDocumentProperties = cursor.documentProperties();
            String publicId = xmlDocumentProperties.getDoctypePublicId();
            String cmpVersion;
            if ("-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN".equals(publicId)) {
                cmpVersion = "1.x";
            } else if ("-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN".equals(publicId)) {
                cmpVersion = null;//2.x is the default "2.x";
View Full Code Here


                XmlObject result = xmlObject.changeType(WebAppDocument.type);
                validateDD(result);
                return (WebAppDocument) result;
            }

            XmlDocumentProperties xmlDocumentProperties = cursor.documentProperties();
            String publicId = xmlDocumentProperties.getDoctypePublicId();
            if ("-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN".equals(publicId) ||
                    "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN".equals(publicId)) {
                XmlCursor moveable = xmlObject.newCursor();
                try {
                    moveable.toStartDoc();
View Full Code Here

    }


    public static boolean convertToSchema(XmlCursor cursor, String namespace, String schemaLocationURL, String version) {
        //remove dtd
        XmlDocumentProperties xmlDocumentProperties = cursor.documentProperties();
        xmlDocumentProperties.remove(XmlDocumentProperties.DOCTYPE_NAME);
        xmlDocumentProperties.remove(XmlDocumentProperties.DOCTYPE_PUBLIC_ID);
        xmlDocumentProperties.remove(XmlDocumentProperties.DOCTYPE_SYSTEM_ID);
        //convert namespace
        boolean isFirstStart = true;
        while (cursor.hasNextToken()) {
            if (cursor.isStart()) {
                if (namespace.equals(cursor.getName().getNamespaceURI())) {
View Full Code Here

        else
        {
            doc = FormValidationDocument.Factory.newInstance();
        }
       
        XmlDocumentProperties dp = doc.documentProperties();
       
        if ( dp.getDoctypeName() == null )
        {
            dp.setDoctypeName( "form-validation" )// NOI18N
        }

        if ( dp.getDoctypePublicId() == null )
        {
            if ( _validatorVersion.equals( ValidatorVersion.oneZero ) )
            {
                dp.setDoctypePublicId( "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN" );
            }
            else
            {
                dp.setDoctypePublicId( "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1//EN" );
            }
        }

        if ( dp.getDoctypeSystemId() == null )
        {
            if ( _validatorVersion.equals( ValidatorVersion.oneZero ) )
            {
                dp.setDoctypeSystemId( "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd" );
            }
            else
            {
                dp.setDoctypeSystemId( "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd" );
            }
        }
       
       
        FormValidationDocument.FormValidation formValidationElement = doc.getFormValidation();
View Full Code Here

       
        //
        // Write the DOCTYPE and all that good stuff.
        //
        XmlDocumentProperties docProps = doc.documentProperties();
       
        if ( docProps.getDoctypeName() == null )
        {
            docProps.setDoctypeName( "struts-config" )// NOI18N
        }
       
        if ( docProps.getDoctypePublicId() == null )
        {
            docProps.setDoctypePublicId( "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" )// NOI18N
        }
       
        if ( docProps.getDoctypeSystemId() == null )
        {
            docProps.setDoctypeSystemId( "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd" )// NOI18N
        }
       
       
        //
        // struts-config
View Full Code Here

                XmlObject result = xmlObject.changeType(EjbJarDocument.type);
                // XmlBeansUtil.validateDD(result);
                return (EjbJarDocument) result;
            }
            // deployment descriptor is probably in EJB 1.1 or 2.0 format
            XmlDocumentProperties xmlDocumentProperties = cursor.documentProperties();
            String publicId = xmlDocumentProperties.getDoctypePublicId();
            String cmpVersion;
            if ("-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN".equals(publicId)) {
                cmpVersion = "1.x";
            } else if ("-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN".equals(publicId)) {
                cmpVersion = null;//2.x is the default "2.x";
View Full Code Here

                XmlBeansUtil.validateDD(result);
                return (WebAppDocument) result;
            }

            //otherwise assume DTD
            XmlDocumentProperties xmlDocumentProperties = cursor.documentProperties();
            String publicId = xmlDocumentProperties.getDoctypePublicId();
            boolean is22 = "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN".equals(publicId);
            if ("-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN".equals(publicId) ||
                    is22) {
                XmlCursor moveable = xmlObject.newCursor();
                try {
View Full Code Here

    }


    public static boolean convertToSchema(XmlCursor cursor, String namespace, String schemaLocationURL, String version) {
        //remove dtd
        XmlDocumentProperties xmlDocumentProperties = cursor.documentProperties();
        xmlDocumentProperties.remove(XmlDocumentProperties.DOCTYPE_NAME);
        xmlDocumentProperties.remove(XmlDocumentProperties.DOCTYPE_PUBLIC_ID);
        xmlDocumentProperties.remove(XmlDocumentProperties.DOCTYPE_SYSTEM_ID);
        //convert namespace
        boolean isFirstStart = true;
        while (cursor.hasNextToken()) {
            if (cursor.isStart()) {
                if (namespace.equals(cursor.getName().getNamespaceURI())) {
View Full Code Here

            _outStreamImpl = new OutputStreamImpl();

            String encoding = null;

            XmlDocumentProperties props = Locale.getDocProps( c, false );

            if (props != null && props.getEncoding() != null)
                encoding = EncodingMap.getIANA2JavaMapping( props.getEncoding() );

            if (options.hasOption( XmlOptions.CHARACTER_ENCODING ))
                encoding = (String) options.get( XmlOptions.CHARACTER_ENCODING );

            if (encoding != null)
View Full Code Here

            return new PiccoloSaxLoader(new Piccolo());
        }

        void postLoad(Cur c)
        {
            XmlDocumentProperties props = getDocProps(c, true);

            props.setEncoding(_piccolo.getEncoding());
            props.setVersion(_piccolo.getVersion());

            super.postLoad(c);
        }
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.XmlDocumentProperties

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.