Package org.apache.xmlbeans

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


    private void dotestParser ( String xml, String xmlResult )
        throws Exception
    {
        XmlObject x = XmlObject.Factory.parse( xml );
        String result = x.xmlText();
        Assert.assertTrue( xmlResult.equals( result ) );
    }
   
    private void dotestParserErrors ( String xml )
    {
View Full Code Here


        XmlObject x1 = sh.getObject();

        XmlObject x2 = XmlObject.Factory.parse( xml );

        Assert.assertTrue( x1.xmlText().equals( x2.xmlText() ) );
    }

    public void testAdditionalNamespaces()
        throws Exception
    {
View Full Code Here

        XmlObject x = XmlObject.Factory.parse(xml, options);

        // 'a' prefix namespace is not remapped
        String expect = "<a xmlns:c=\"cNS\" xmlns:b=\"bNS\" xmlns:a=\"aNS\"><a:b/></a>";
        Assert.assertEquals( expect, x.xmlText() );

        xml = "<a xmlns='aNS'><b/></a>";

        map = new SequencedHashMap();
        map.put("b", "bNS");
View Full Code Here

        x = XmlObject.Factory.parse(xml, options);

        // default namespace is not remapped
        expect = "<a xmlns:c=\"cNS\" xmlns:b=\"bNS\" xmlns=\"aNS\"><b/></a>";
        Assert.assertEquals( expect, x.xmlText() );

    }

    public void testCR135193()
        throws Exception
View Full Code Here

        XMLInputStream xis1 = xis.getSubStream();
        XmlObject x1 = XmlObject.Factory.parse(xis1);

        // CR135193: namespaces including default are set on the 'b' child
        String expect = "<b xmlns=\"aNS\" xmlns:b=\"bNS\"><c/></b>";
        Assert.assertEquals( expect, x1.xmlText() );
    }

}
View Full Code Here

    {
        StringBuffer buf = new StringBuffer();
        for ( int i = 0; i < m_propElems.size(); i++ )
        {
            XmlObject propXBean = (XmlObject) m_propElems.get( i );
            buf.append( propXBean.xmlText( new XmlOptions().setSaveOuter().setSavePrettyPrint() ) );
        }
        return buf.toString();
    }

    /**
 
View Full Code Here

            for ( int i = 0; i < childElements.length; i++ )
            {
                XmlObject requestXBean = childElements[i];

                //todo probably need to change method signatures to take types instead of documents to avoid this,
                requestXBean = XmlObject.Factory.parse( requestXBean.xmlText( new XmlOptions().setSaveOuter() ) );
                if ( requestXBean != null )
                {
                    Class serviceClass = getServiceClassName( resourceContext );
                    WsrfService service = createService( serviceClass, resourceContext );
                    Method serviceMethod = getServiceMethod( service, requestXBean );
View Full Code Here

            XmlOptions opt = new XmlOptions().setSaveOuter().
                setSaveAggressiveNamespaces();
            for (int i = 0; i < documentationItems.length; i++)
            {
                XmlObject doc = documentationItems[i];
                writeString(doc.xmlText(opt));
            }

            // Write application info items
            XmlObject[] appInfoItems = a.getApplicationInformation();
            writeInt(appInfoItems.length);
View Full Code Here

            XmlObject[] appInfoItems = a.getApplicationInformation();
            writeInt(appInfoItems.length);
            for (int i = 0; i < appInfoItems.length; i++)
            {
                XmlObject doc = appInfoItems[i];
                writeString(doc.xmlText(opt));
            }
        }

        SchemaAnnotation readAnnotation(SchemaContainer c)
        {
View Full Code Here

                cursor.toNextToken();
            }
        } finally {
            cursor.dispose();
        }
        throw new DeploymentException("Cannot find namespace in xmlObject: " + xmlObject.xmlText());
    }

    private ModuleBuilder getBuilderFromNamespace(String namespace) {
        ModuleBuilder builder = (ModuleBuilder) namespaceToBuilderMap.get(namespace);
        if (builder == null) {
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.