Code example for Document

Methods: createProcessingInstruction

0
		} 
	} 
 
	@Override 
	public void processingInstruction(String target, String data) {
		ProcessingInstruction pi = doc
				.createProcessingInstruction(target, data);
		current.appendChild(pi);
	} 
 
	public static void generateDOM(String xml, Document doc) throws SAXException {
		SAXParserFactory fact = SAXParserFactory.newInstance();
		try { 
			SAXParser parser = fact.newSAXParser();
			SAX2DomHandler handler = new SAX2DomHandler(doc);
			 
			parser.parse(new InputSource(new StringReader(xml)), handler);
		} catch (ParserConfigurationException e) {
			logger .log(Level.SEVERE, "Error configuring parser", e);
		} catch (SAXException e) {
			logger.log(Level.SEVERE, "Error parsing configuration file", e);