< prev index next >

test/javax/xml/jaxp/functional/org/w3c/dom/ptests/TextTest.java

Print this page




  57 
  58         NodeList nodeList = document.getElementsByTagName("p");
  59         Node node = nodeList.item(0);
  60         Text textNode = document.createTextNode("This is a text node");
  61         node.appendChild(textNode);
  62         int rawChildNum = node.getChildNodes().getLength();
  63 
  64         textNode.splitText(0);
  65         int increased = node.getChildNodes().getLength() - rawChildNum;
  66         assertEquals(increased, 1);
  67 
  68     }
  69 
  70     @Override
  71     protected CharacterData createCharacterData(String text) throws IOException, SAXException, ParserConfigurationException {
  72         Document document = createNewDocument();
  73         return document.createTextNode(text);
  74     }
  75 
  76 }
  77 


  57 
  58         NodeList nodeList = document.getElementsByTagName("p");
  59         Node node = nodeList.item(0);
  60         Text textNode = document.createTextNode("This is a text node");
  61         node.appendChild(textNode);
  62         int rawChildNum = node.getChildNodes().getLength();
  63 
  64         textNode.splitText(0);
  65         int increased = node.getChildNodes().getLength() - rawChildNum;
  66         assertEquals(increased, 1);
  67 
  68     }
  69 
  70     @Override
  71     protected CharacterData createCharacterData(String text) throws IOException, SAXException, ParserConfigurationException {
  72         Document document = createNewDocument();
  73         return document.createTextNode(text);
  74     }
  75 
  76 }

< prev index next >