Examples of toFirstChild()


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

    protected static FacesConfigDocument convertToFacesConfigSchema(XmlObject xmlObject) throws XmlException {
        log.debug("convertToFacesConfigSchema( " + xmlObject.toString() + " ): Entry");
        XmlCursor cursor = xmlObject.newCursor();
        try {
            cursor.toStartDoc();
            cursor.toFirstChild();
            if (SchemaConversionUtils.JAVAEE_NAMESPACE.equals(cursor.getName().getNamespaceURI())) {
                //do nothing
            } else if (SchemaConversionUtils.J2EE_NAMESPACE.equals(cursor.getName().getNamespaceURI())) {
                SchemaConversionUtils.convertSchemaVersion(cursor, SchemaConversionUtils.JAVAEE_NAMESPACE, SCHEMA_LOCATION_URL, VERSION);
            } else {
View Full Code Here

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

        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);
                return (WebAppDocument) result;
View Full Code Here

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

            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");
                    cursor.toFirstChild();
View Full Code Here

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

            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();
            }
            WebAppDocument webAppDoc = convertToServletSchema(parsed);
View Full Code Here

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

        URL ConvertedPlan = classLoader.getResource("plans/plan4-converted.xml");
        assertTrue(ConvertedPlan != null);
        XmlObject converted = XmlBeansUtil.parse(ConvertedPlan, getClass().getClassLoader());
        XmlCursor c = converted.newCursor();
        SchemaConversionUtils.findNestedElement(c, JettyWebAppDocument.type.getDocumentElementName());
        c.toFirstChild();
        ArrayList problems = new ArrayList();
        compareXmlObjects(webPlan, c.getObject(), problems);
        assertEquals("problems: " + problems, 0, problems.size());
    }
View Full Code Here

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

        try {
            XmlObject xobj = XmlObject.Factory.parse(in);
          
            cursor = xobj.newCursor();
            cursor.toStartDoc();
            cursor.toFirstChild();
            //the checking is needed as we also send JAX-RPC based webservices.xml here
            if ("http://java.sun.com/xml/ns/javaee".equals(cursor.getName().getNamespaceURI())) {
                WebservicesDocument wd = (WebservicesDocument)xobj.changeType(WebservicesDocument.type);
                WebservicesType wst = wd.getWebservices();
View Full Code Here

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

        if (baseType != null)
            baseModel = baseType.getAttributeModel();

        XmlCursor cur = parseTree.newCursor();

        for (boolean more = cur.toFirstChild(); more; more = cur.toNextSibling())
        {
            switch (translateAttributeCode(cur.getName()))
            {
                case ATTRIBUTE_CODE:
                {
View Full Code Here

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

                    return null;
                }

                // no go to the child.
                XmlCursor cur = group.getParseObject().newCursor();
                for (boolean more = cur.toFirstChild(); more; more = cur.toNextSibling())
                {
                    particleCode = translateParticleCode(cur.getName());
                    if (particleCode != 0)
                    {
                        parseTree = parseGroup = (Group)cur.getObject();
View Full Code Here

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

        if (hasChildren)
        {
            XmlCursor cur = parseTree.newCursor();
            List accumulate = new ArrayList();
            for (boolean more = cur.toFirstChild(); more; more = cur.toNextSibling())
            {
                int code = translateParticleCode(cur.getName());
                if (code == 0)
                    continue;
                addMinusPointlessParticles(accumulate,
View Full Code Here

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

            }
        };
        XmlCursor c = org.apache.xmlbeans.XmlObject.Factory.parse(xml).newCursor();
        c.toFirstContentToken(); // on <root>
        c.toFirstContentToken(); // on <a>
        c.toFirstChild();        // on <b>
        c.toFirstChild();        // on <c>
        c.push(); System.out.println(generateXPath(c, null, ns)); c.pop();
        c.toNextSibling();
        c.toNextSibling();       // on the last <c>
        c.push(); System.out.println(generateXPath(c, null, ns)); c.pop();
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.