Examples of XML


Examples of org.apache.ecs.xml.XML

        }
    }
   
    private XML getChannelElement()
    {
        XML channel = new XML( "channel" );

        channel.addAttribute("rdf:about", m_feedURL );
       
        channel.addElement( new XML("link").addElement( m_feedURL ) );
       
        if( m_channelTitle != null )
            channel.addElement( new XML("title").addElement( format(m_channelTitle)) );
       
        if( m_channelDescription != null )
            channel.addElement( new XML("description").addElement( format(m_channelDescription)) );
       
        if( m_channelLanguage != null )
            channel.addElement( new XML("dc:language").addElement(m_channelLanguage) );

        channel.setPrettyPrint( true );
       
        channel.addElement( getRDFItems() );
       
        return channel;
    }
View Full Code Here

Examples of org.apache.ecs.xml.XML

     {@inheritDoc}
     */
    @Override
    public String getString()
    {
        XML root = new XML("rdf:RDF");
       
        root.addAttribute( "xmlns:rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#" );
        root.addAttribute( "xmlns", "http://purl.org/rss/1.0/" );
        root.addAttribute( "xmlns:dc", "http://purl.org/dc/elements/1.1/" );
        root.addAttribute( "xmlns:wiki", "http://purl.org/rss/1.0/modules/wiki/" );
       
        root.addElement( getChannelElement() );
       
        addItemList( root );
       
        root.setPrettyPrint( true );
               
        return root.toString();
    }
View Full Code Here

Examples of org.mojavemvc.views.XML

    @Action("xml")
    public XML sendXML() {

        String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Test><hello/></Test>";

        return new XML(xml);
    }
View Full Code Here

Examples of org.mojavemvc.views.XML

*/
public class TestXML {

    @Test
    public void returnsCorrectContentType() {
        XML xml = new XML("");
        assertEquals("application/xml", xml.getContentType());
    }
View Full Code Here

Examples of org.mojavemvc.views.XML

        assertEquals("application/xml", xml.getContentType());
    }
   
    @Test
    public void toStringAfterObjectConstructorReturnsXML() {
        XML xml = new XML(new SimplePojo("test"));
        assertEquals("<SimplePojo><val>test</val></SimplePojo>", xml.toString());
    }
View Full Code Here

Examples of org.mojavemvc.views.XML

    private static class TestValidActionController1 {

        @Action("someAction")
        public XML someAction() {

            return new XML("<test/>");
        }
View Full Code Here

Examples of org.mojavemvc.views.XML

    private static class TestValidActionController2 {

        @DefaultAction
        public XML defaultAction() {

            return new XML("<test/>");
        }
View Full Code Here

Examples of org.mojavemvc.views.XML

       
        XMLEntityMarshaller m = new XMLEntityMarshaller();
        SimplePojo entity = new SimplePojo("test");
        View v = m.marshall(entity);
        assertTrue(v instanceof XML);
        assertEquals(new XML(entity).toString(), ((XML)v).toString());
    }
View Full Code Here

Examples of org.mojavemvc.views.XML

        SimplePojo entity = new SimplePojo("test");
        MarshallablePojo<SimplePojo> marshallable =
                new MarshallablePojo<SimplePojo>(entity);
        View v = m.marshall(marshallable);
        assertTrue(v instanceof XML);
        assertEquals(new XML(entity).toString(), ((XML)v).toString());
    }
View Full Code Here

Examples of org.mojavemvc.views.XML

        XMLEntityMarshaller m = new XMLEntityMarshaller();
        SimplePojo entity = new SimplePojo("test");
        AnnotatedPojo marshallable = new AnnotatedPojo(entity);
        View v = m.marshall(marshallable);
        assertTrue(v instanceof XML);
        assertEquals(new XML(entity).toString(), ((XML)v).toString());
    }
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.