public NodeList getChildNodes() { return delegate.getChildNodes(); }
private boolean isDocumentFragmentEqual(DocumentFragment control, DocumentFragment test) { return isNodeListEqual(control.getChildNodes(), test.getChildNodes()); }
private boolean isDocumentFragmentEqual(DocumentFragment control, DocumentFragment test) { return isNodeListEqual(control.getChildNodes(), test.getChildNodes()); }
private boolean isDocumentFragmentEqual(DocumentFragment control, DocumentFragment test) { return isNodeListEqual(control.getChildNodes(), test.getChildNodes()); }
private boolean isDocumentFragmentEqual(DocumentFragment control, DocumentFragment test) { return isNodeListEqual(control.getChildNodes(), test.getChildNodes()); }
private static void insertNodeOrDocFragment(final Node parent, final Node newNode, final Node refNode) { if (newNode instanceof DocumentFragment) { final DocumentFragment fragment = (DocumentFragment) newNode; final NodeList childNodes = fragment.getChildNodes(); while (childNodes.getLength() > 0) { final Node item = childNodes.item(0); parent.insertBefore(item, refNode); } } else { parent.insertBefore(newNode, refNode); } }
private void copyFragment(DocumentFragment source, Node dest) { Document destDoc = dest.getOwnerDocument(); NodeList nodes = source.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { Node clone = destDoc.importNode(nodes.item(i), true); dest.appendChild(clone); } }
private void copyFragment(DocumentFragment source, Node dest) { Document destDoc = dest.getOwnerDocument(); NodeList nodes = source.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { Node clone = destDoc.importNode(nodes.item(i), true); dest.appendChild(clone); } }
private void copyFragment(DocumentFragment source, Node dest) { Document destDoc = dest.getOwnerDocument(); NodeList nodes = source.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { Node clone = destDoc.importNode(nodes.item(i), true); dest.appendChild(clone); } }
private static void insertNodeOrDocFragment(final Node parent, final Node newNode, final Node refNode) { if (newNode instanceof DocumentFragment) { final DocumentFragment fragment = (DocumentFragment) newNode; final NodeList childNodes = fragment.getChildNodes(); while (childNodes.getLength() > 0) { final Node item = childNodes.item(0); parent.insertBefore(item, refNode); } } else { parent.insertBefore(newNode, refNode); } }
/** Processes a document fragment. * This method processes the child nodes of the fragment. * @param f the document fragment * @return the recurser * @throws Exception something wrong */ protected DocumentRecurser<T> fragment(DocumentFragment f)throws Exception { return nodes(f.getChildNodes()); }
@Override public NodeList getResourcesXmlFragment(HttpServletRequest request, String skinXml) { final DocumentFragment headFragment = getResourcesXml(request, skinXml); return headFragment.getChildNodes(); }
@Override public NodeList getChildNodes() { return new NodeListImpl(soapDocument, documentFragment.getChildNodes()); }
private DocumentFragment appendPushContent(final DocumentFragment pushcontent, final DocumentFragment target) { DocumentFragment df = target; if (df == null) { df = pushDocument.createDocumentFragment(); } final NodeList children = pushcontent.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { df.appendChild(pushDocument.importNode(children.item(i), true)); } return df; }
protected void runTest() throws Throwable { Document document = dbf.newDocumentBuilder().newDocument(); DocumentFragment fragment = document.createDocumentFragment(); fragment.appendChild(document.createElementNS(null, "test")); DocumentFragment clone = (DocumentFragment)fragment.cloneNode(false); assertSame(document, clone.getOwnerDocument()); assertNull(clone.getFirstChild()); assertNull(clone.getLastChild()); assertEquals(0, clone.getChildNodes().getLength()); } }
@Test public void testHtmlTag() throws Exception { Document doc = documentProvider.createDocument(null, null, null); // Create a mock tag; the name doesn't truly matter Element tag = doc.createElement("test"); tag.setAttribute("code", "${code}"); processor.expressionResults = ImmutableMap.of( "${code}", "Hello <b>World</b>!"); DocumentFragment fragment = doc.createDocumentFragment(); handler.process(fragment, tag, processor); assertEquals(3, fragment.getChildNodes().getLength()); assertEquals("b", fragment.getChildNodes().item(1).getNodeName()); } }
@Test public void testHtmlTag() throws Exception { Document doc = documentProvider.createDocument(null, null, null); // Create a mock tag; the name doesn't truly matter Element tag = doc.createElement("test"); tag.setAttribute("code", "${code}"); processor.expressionResults = ImmutableMap.of( "${code}", "Hello <b>World</b>!"); DocumentFragment fragment = doc.createDocumentFragment(); handler.process(fragment, tag, processor); assertEquals(3, fragment.getChildNodes().getLength()); assertEquals("b", fragment.getChildNodes().item(1).getNodeName()); } }
@Test public void testHtmlTag() throws Exception { Document doc = documentProvider.createDocument(null, null, null); // Create a mock tag; the name doesn't truly matter Element tag = doc.createElement("test"); tag.setAttribute("code", "${code}"); processor.expressionResults = ImmutableMap.of( "${code}", "Hello <b>World</b>!"); DocumentFragment fragment = doc.createDocumentFragment(); handler.process(fragment, tag, processor); assertEquals(3, fragment.getChildNodes().getLength()); assertEquals("b", fragment.getChildNodes().item(1).getNodeName()); } }
@Test public void testMacroLoad() throws Exception { JrdsDocument d = Tools.parseString(goodMacroXml); MacroBuilder b = new MacroBuilder(); Macro m = b.makeMacro(d); int macroProbesNumber = m.getDf().getChildNodes().getLength(); Assert.assertEquals("macrodef", m.getName()); Assert.assertEquals("Macro$macrodef", m.toString()); Assert.assertEquals(1, macroProbesNumber); Assert.assertEquals(2, m.getDf().getChildNodes().item(0).getChildNodes().getLength()); }
@Test public void testMacroLoad() throws Exception { JrdsDocument d = Tools.parseString(goodMacroXml); MacroBuilder b = new MacroBuilder(); Macro m = b.makeMacro(d); int macroProbesNumber = m.getDf().getChildNodes().getLength(); Assert.assertEquals("macrodef", m.getName()); Assert.assertEquals("Macro$macrodef", m.toString()); Assert.assertEquals(1, macroProbesNumber); Assert.assertEquals(2, m.getDf().getChildNodes().item(0).getChildNodes().getLength()); }