int loc = text.indexOf(" "); if (loc >= 0) { document.addProcessingInstruction(text.substring(0, loc), text.substring(loc + 1)); document.addProcessingInstruction(text, "");
public void processingInstruction(String target, String data) throws SAXException { if (mergeAdjacentText && textInTextBuffer) { completeCurrentTextNode(); } if (currentElement != null) { currentElement.addProcessingInstruction(target, data); } else { getDocument().addProcessingInstruction(target, data); } }
} else { Document currentDoc = (Document) current; currentDoc.addProcessingInstruction(node.getNodeName(), node.getNodeValue());
String target = text.substring(0, loc); String txt = text.substring(loc + 1); document.addProcessingInstruction(target, txt); } else { document.addProcessingInstruction(text, "");
public Document addProcessingInstruction(String target, String text) { return getWrapped().addProcessingInstruction(target, text); }
public Document addProcessingInstruction(String target, Map<String, String> data) { return getWrapped().addProcessingInstruction(target, data); }
public void processingInstruction(String target, String data) throws SAXException { if (mergeAdjacentText && textInTextBuffer) { completeCurrentTextNode(); } if (currentElement != null) { currentElement.addProcessingInstruction(target, data); } else { getDocument().addProcessingInstruction(target, data); } }
public void processingInstruction(String target, String data) throws SAXException { if (mergeAdjacentText && textInTextBuffer) { completeCurrentTextNode(); } if (currentElement != null) { currentElement.addProcessingInstruction(target, data); } else { getDocument().addProcessingInstruction(target, data); } }
public void processingInstruction(String target, String data) throws SAXException { if (mergeAdjacentText && textInTextBuffer) { completeCurrentTextNode(); } if (currentElement != null) { currentElement.addProcessingInstruction(target, data); } else { getDocument().addProcessingInstruction(target, data); } }
public void processingInstruction(String target, String data) throws SAXException { if (mergeAdjacentText && textInTextBuffer) { completeCurrentTextNode(); } if (currentElement != null) { currentElement.addProcessingInstruction(target, data); } else { getDocument().addProcessingInstruction(target, data); } }
public void processingInstruction(String target, String data) throws SAXException { if (mergeAdjacentText && textInTextBuffer) { completeCurrentTextNode(); } if (currentElement != null) { currentElement.addProcessingInstruction(target, data); } else { getDocument().addProcessingInstruction(target, data); } }
public void processingInstruction(String target, String data) throws SAXException { if (mergeAdjacentText && textInTextBuffer) { completeCurrentTextNode(); } if (currentElement != null) { currentElement.addProcessingInstruction(target, data); } else { getDocument().addProcessingInstruction(target, data); } }
public void processingInstruction(String target, String data) throws SAXException { if (mergeAdjacentText && textInTextBuffer) { completeCurrentTextNode(); } if (currentElement != null) { currentElement.addProcessingInstruction(target, data); } else { getDocument().addProcessingInstruction(target, data); } }
public void processingInstruction(String target, String data) throws SAXException { if (mergeAdjacentText && textInTextBuffer) { completeCurrentTextNode(); } if (currentElement != null) { currentElement.addProcessingInstruction(target, data); } else { getDocument().addProcessingInstruction(target, data); } }
} else { Document currentDoc = (Document) current; currentDoc.addProcessingInstruction(node.getNodeName(), node.getNodeValue());
} else { Document currentDoc = (Document) current; currentDoc.addProcessingInstruction(node.getNodeName(), node.getNodeValue());
} else { Document currentDoc = (Document) current; currentDoc.addProcessingInstruction(node.getNodeName(), node.getNodeValue());
} else { Document currentDoc = (Document) current; currentDoc.addProcessingInstruction(node.getNodeName(), node.getNodeValue());
} else { Document currentDoc = (Document) current; currentDoc.addProcessingInstruction(node.getNodeName(), node.getNodeValue());
public void testOrderOfPI() throws Exception { Document document = factory.createDocument(); document.addProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"...\""); document.addElement("root"); List<Node> list = document.content(); assertNotNull(list); assertEquals(2, list.size()); Node pi = list.get(0); Node root = list.get(1); assertTrue("First element is not a PI", pi instanceof ProcessingInstruction); assertTrue("Second element is an element", root instanceof Element); String xml = "<?xml version=\"1.0\" ?>\n" + "<?xml-stylesheet type=\"text/xsl\" href=\"foo\" ?>\n" + "<root/>"; document = DocumentHelper.parseText(xml); list = document.content(); assertNotNull(list); assertEquals(2, list.size()); pi = list.get(0); root = list.get(1); assertTrue("First element is not a PI", pi instanceof ProcessingInstruction); assertTrue("Second element is an element", root instanceof Element); }