Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlCursor.toStartDoc()


        String schemaLocationURL = "http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
        String version = "2.5";
        XmlCursor cursor = xmlObject.newCursor();
        try {
            cursor.toStartDoc();
            cursor.toFirstChild();
            if ("http://java.sun.com/xml/ns/j2ee".equals(cursor.getName().getNamespaceURI())) {
                SchemaConversionUtils.convertSchemaVersion(cursor, SchemaConversionUtils.JAVAEE_NAMESPACE, schemaLocationURL, version);
                XmlObject result = xmlObject.changeType(WebAppDocument.type);
                XmlBeansUtil.validateDD(result);
View Full Code Here


            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 {
                    moveable.toStartDoc();
                    moveable.toFirstChild();

                    SchemaConversionUtils.convertToSchema(cursor, SchemaConversionUtils.JAVAEE_NAMESPACE, schemaLocationURL, version);
                    cursor.toStartDoc();
                    cursor.toChild(SchemaConversionUtils.JAVAEE_NAMESPACE, "web-app");
View Full Code Here

            // we found web.xml, if it won't parse that's an error.
            XmlObject parsed = XmlBeansUtil.parse(specDD);
            //Dont save updated xml if it isn't javaee
            XmlCursor cursor = parsed.newCursor();
            try {
                cursor.toStartDoc();
                cursor.toFirstChild();
                isJavaee = "http://java.sun.com/xml/ns/javaee".equals(cursor.getName().getNamespaceURI());
            } finally {
                cursor.dispose();
            }
View Full Code Here

    * @return the document XmlBean that is associated with the specified XmlBean
    */
   public static XmlObject getDocument( XmlObject xBean )
   {
      XmlCursor xCursor = xBean.newCursor(  );
      xCursor.toStartDoc(  );
      XmlObject docXBean = xCursor.getObject(  );
      xCursor.dispose(  );
      return docXBean;
   }

View Full Code Here

            validateDD(xmlObject);
            return (WebAppDocument) xmlObject;
        }
        XmlCursor cursor = xmlObject.newCursor();
        try {
            cursor.toStartDoc();
            cursor.toFirstChild();
            if ("http://java.sun.com/xml/ns/j2ee".equals(cursor.getName().getNamespaceURI())) {
                XmlObject result = xmlObject.changeType(WebAppDocument.type);
                validateDD(result);
                return (WebAppDocument) result;
View Full Code Here

            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();
                    moveable.toFirstChild();
                    String schemaLocationURL = "http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
                    String version = "2.4";
                    convertToSchema(cursor, J2EE_NAMESPACE, schemaLocationURL, version);
                    cursor.toStartDoc();
View Full Code Here

            is = descriptor.openStream();
        try {
        XmlObject xmlObject = XmlBeansUtil.parse(is);
            XmlCursor c = xmlObject.newCursor();
            try {
                c.toStartDoc();
                c.toFirstChild();
                docBean = new DDBeanImpl(this, this, "/" + c.getName().getLocalPart(), c);
            } finally {
                c.dispose();
            }
View Full Code Here

    private XmlObject getRootXmlObject()
    {
        XmlCursor cur = newCursor();
        if (cur == null)
            return this;
        cur.toStartDoc();
        XmlObject result = cur.getObject();
        cur.dispose();
        return result;
    }
View Full Code Here

            for (int c = 0; c < schemas.size(); c++) {
                XmlObject s = schemas.get(c);

                Map<?, ?> map = new HashMap<String, String>();
                cursor = s.newCursor();
                cursor.toStartDoc();
                if (toNextContainer(cursor)) {
                    cursor.getAllNamespaces(map);
                } else {
                    log.warn("Can not get namespaces for " + s);
                }
View Full Code Here

            {
                cTmp.dispose();
                return false;
            }
           
            cTmp.toStartDoc();
            ((Cursor)cTmp).moveXmlContentsImpl( dst );
            cTmp.dispose();
            return true;
        }
           
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.