Package nu.xom

Examples of nu.xom.Element.removeChild()


    for (int xP = 0; xP < elDocParts.size(); ++xP)
    {  Element elDocPart = elDocParts.get(xP);
      Elements elPartMeasures = elDocPart.getChildElements("measure");
      for (int xM = 0; xM < elPartMeasures.size(); ++xM)
        if (elPartMeasures.get(xM).getChildCount() < 1)
          elDocPart.removeChild(xM);
    }
    //  create the Document
    Document xomDoc = new Document(root);
    DocType docType = new DocType("score-partwise",
            "-//Recordare//DTD MusicXML 1.1 Partwise//EN",
View Full Code Here


        Element element = new Element("test");
        element.appendChild(c1);
        assertEquals(element, c1.getParent());
        assertEquals(c1, element.getChild(0));

        element.removeChild(c1);
        assertEquals(0, element.getChildCount());

    }

   
View Full Code Here

    
        Element root = new Element("pre:root", "http://www.example.org/");
        Nodes result = root.query("namespace::pre");
        Namespace namespace = (Namespace) result.get(0);
        try {
            root.removeChild(namespace);
            fail("Namespaces are not children");
        }
        catch (NoSuchChildException success) {
            assertNotNull(success.getMessage());
        }
View Full Code Here

        Element element = new Element("test");
        element.appendChild(c1);
        assertEquals(element, c1.getParent());
        assertEquals(element.getChild(0), c1);

        element.removeChild(c1);
        assertTrue(element.getChildCount() == 0);

    }

   
View Full Code Here

        Element element = new Element("test");
        element.appendChild(pi);
        assertEquals(element, pi.getParent());
        assertEquals(pi, element.getChild(0));

        element.removeChild(pi);
        assertEquals(0, element.getChildCount());

    }

   
View Full Code Here

            }
            try {
                write(node.query(".//. | .//@* | .//namespace::*"));
            }
            finally {
                if (pseudoRoot != null) pseudoRoot.removeChild(0);
            }
        }
        else {
            serializer.nodes = null;
            serializer.write(node);
View Full Code Here

                    }
                }
                write(nodes);
            }
            finally {
                if (pseudoRoot != null) pseudoRoot.removeChild(0);
            }
        }
        else {
            serializer.nodes = null;
            serializer.write(node);
View Full Code Here

        Element element = new Element("test");
        element.appendChild(c1);
        assertEquals(element, c1.getParent());
        assertEquals(c1, element.getChild(0));

        element.removeChild(c1);
        assertEquals(0, element.getChildCount());

    }

   
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.