Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlObject.newCursor()


                    throw new DeploymentException(e);
                }
            }

            if (unknownXmlObject != null) {
                XmlCursor xmlCursor = unknownXmlObject.newCursor();
                //
                QName qname = xmlCursor.getName();
                if (qname == null) {
                    xmlCursor.toFirstChild();
                    qname = xmlCursor.getName();
View Full Code Here


        Double doubleVal = new Double(9876.54321);
        Boolean booleanVal = Boolean.FALSE;

        WebApp webApp = load(TEST, WebApp.class);
        XmlObject plan = XmlObject.Factory.parse(TEST_PLAN);
        XmlCursor cursor = plan.newCursor();
        try {
            cursor.toFirstChild();
            plan = cursor.getObject();
        } finally {
            cursor.dispose();
View Full Code Here

                                            "            </tss>";


    private XmlObject getXmlObject(String xmlString) throws XmlException {
        XmlObject xmlObject = XmlObject.Factory.parse(xmlString);
        XmlCursor xmlCursor = xmlObject.newCursor();
        try {
            xmlCursor.toFirstChild();
            return xmlCursor.getObject();
        } finally {
            xmlCursor.dispose();
View Full Code Here

*/
public class TSSConfigEditorTest extends TestCase {

    private XmlObject getXmlObject(String xmlString) throws XmlException {
        XmlObject xmlObject = XmlObject.Factory.parse(xmlString);
        XmlCursor xmlCursor = xmlObject.newCursor();
        try {
            xmlCursor.toFirstChild();
            return xmlCursor.getObject();
        } finally {
            xmlCursor.dispose();
View Full Code Here

        XmlObject webPlan = new GenericToSpecificPlanConverter(GerJettyDocument.type.getDocumentElementName().getNamespaceURI(),
                JettyWebAppDocument.type.getDocumentElementName().getNamespaceURI(), "jetty").convertToSpecificPlan(rawPlan);
        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

         * <persistence xmlns="http://java.sun.com/xml/ns/persistence"> ... </persistence>
         *
         * before unmarshalling it
         */
        XmlObject newXmlObject=XmlObject.Factory.newInstance();
        XmlCursor newXmlCursor=newXmlObject.newCursor();
        newXmlCursor.toNextToken();
        newXmlCursor.beginElement(PERSISTENCE_QNAME);
       
        XmlCursor oldXmlCursor=xmlObject.newCursor();
        oldXmlCursor.copyXmlContents(newXmlCursor);
View Full Code Here

        } else if (plan instanceof XmlObject) {
            xmlObject = (XmlObject) plan;
        } else {
            return defaultNamespace;
        }
        XmlCursor cursor = xmlObject.newCursor();
        try {
            while (cursor.hasNextToken()){
                if (cursor.isStart()) {
                    return cursor.getName().getNamespaceURI();
                }
View Full Code Here

                    throw new DeploymentException("Cannot handle web plan with namespace "+namespace+" -- expecting "+GENERIC_NAMESPACE+" or "+this.namespace);
                }

                XmlObject webPlan = rawCursor.getObject().copy();

                XmlCursor cursor = webPlan.newCursor();
                XmlCursor end = cursor.newCursor();
                try {
                    cursor.push();
                    if (cursor.toChild(GENERIC_CONFIG_QNAME) || cursor.toChild(OLD_GENERIC_CONFIG_QNAME)) {
                        XmlCursor source = cursor.newCursor();
View Full Code Here

        }
    }

    private XmlObject parse(String xmlString) throws XmlException {
        XmlObject xmlObject = XmlObject.Factory.parse(xmlString);
        XmlCursor xmlCursor = xmlObject.newCursor();
        try {
            xmlCursor.toFirstChild();
            return xmlCursor.getObject();
        } finally {
            xmlCursor.dispose();
View Full Code Here

    public void testOrderDescriptionGroup() throws Exception {
        URL srcXml = classLoader.getResource("j2ee_1_3dtd/DescriptionGroupTestSource.xml");
        URL expectedOutputXml = classLoader.getResource("j2ee_1_3dtd/DescriptionGroupTestExpected.xml");
        XmlObject srcObject = XmlObject.Factory.parse(srcXml);
        XmlCursor srcCursor = srcObject.newCursor();
        XmlCursor moveable = srcObject.newCursor();
        try {
            srcCursor.toFirstChild();
            srcCursor.toFirstChild();
            assertTrue(srcCursor.getName().toString(), "filter".equals(srcCursor.getName().getLocalPart()));
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.