Package org.w3c.dom

Examples of org.w3c.dom.Document.createElement()


      heightNode.appendChild(document.createTextNode(String.valueOf((int) dimension.getHeight())));
    } else {
      Point point = (Point) value;

      Element xNode = document.createElement("x");
      Element yNode = document.createElement("y");
      propertyNode.appendChild(xNode);
      propertyNode.appendChild(yNode);
      xNode.appendChild(document.createTextNode(String.valueOf(point.x)));
      yNode.appendChild(document.createTextNode(String.valueOf(point.y)));
    }
View Full Code Here


    public void testToConfigurationFromBasicElement()
        throws Exception
    {
        final Document document = createDocument();
        final String name = "meep";
        final Element element = document.createElement( name );
        final Configuration configuration = ConfigurationUtil.toConfiguration( element );

        assertEquals( "configuration.getName()", name, configuration.getName() );
        assertEquals( "configuration.getPath()",
                      ConfigurationUtil.ROOT_PATH,
View Full Code Here

        throws Exception
    {
        final Document document = createDocument();
        final String name = "meep";
        final String value = "text";
        final Element element = document.createElement( name );
        final Text text = document.createTextNode( value );
        element.appendChild( text );
        final Configuration configuration = ConfigurationUtil.toConfiguration( element );

        assertEquals( "configuration.getName()", name, configuration.getName() );
View Full Code Here

        throws Exception
    {
        final Document document = createDocument();
        final String name = "meep";
        final String value = "text";
        final Element element = document.createElement( name );
        final Text text = document.createTextNode( value );
        element.appendChild( text );
        final Text text2 = document.createTextNode( value );
        element.appendChild( text2 );
        final Configuration configuration = ConfigurationUtil.toConfiguration( element );
View Full Code Here

    public void testToConfigurationFromElementWithInternalComment()
        throws Exception
    {
        final Document document = createDocument();
        final String name = "meep";
        final Element element = document.createElement( name );
        final Comment comment = document.createComment( "comment" );
        element.appendChild( comment );
        final Configuration configuration = ConfigurationUtil.toConfiguration( element );

        assertEquals( "configuration.getName()", name, configuration.getName() );
View Full Code Here

    {
        final Document document = createDocument();
        final String name = "meep";
        final String key = "key";
        final String value = "value";
        final Element element = document.createElement( name );
        element.setAttribute( key, value );
        final Configuration configuration = ConfigurationUtil.toConfiguration( element );

        assertEquals( "configuration.getName()", name, configuration.getName() );
        assertEquals( "configuration.getPath()",
View Full Code Here

        throws Exception
    {
        final Document document = createDocument();
        final String name = "meep";
        final String childName = "lilmeep";
        final Element element = document.createElement( name );
        final Element childElement = document.createElement( childName );
        element.appendChild( childElement );

        final Configuration configuration = ConfigurationUtil.toConfiguration( element );
View Full Code Here

    {
        final Document document = createDocument();
        final String name = "meep";
        final String childName = "lilmeep";
        final Element element = document.createElement( name );
        final Element childElement = document.createElement( childName );
        element.appendChild( childElement );

        final Configuration configuration = ConfigurationUtil.toConfiguration( element );

        assertEquals( "configuration.getName()", name, configuration.getName() );
View Full Code Here

         int rows = 0;

         //Document doc = new org.apache.crimson.tree.XmlDocument();
         Document doc = Global.instance().getDocumentBuilderFactory().newDocumentBuilder().newDocument();
  
         Element root = doc.createElement(rootnode);
         Element results = doc.createElement("results");
         Element desc = doc.createElement("desc");
  
         root.appendChild(desc);
         root.appendChild(results);
View Full Code Here

         //Document doc = new org.apache.crimson.tree.XmlDocument();
         Document doc = Global.instance().getDocumentBuilderFactory().newDocumentBuilder().newDocument();
  
         Element root = doc.createElement(rootnode);
         Element results = doc.createElement("results");
         Element desc = doc.createElement("desc");
  
         root.appendChild(desc);
         root.appendChild(results);
  
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.