Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 package org.apache.xmlrpc.parser;
00020
00021 import javax.xml.parsers.DocumentBuilderFactory;
00022 import javax.xml.parsers.ParserConfigurationException;
00023
00024 import org.apache.ws.commons.serialize.DOMBuilder;
00025 import org.apache.xmlrpc.serializer.NodeSerializer;
00026 import org.xml.sax.ContentHandler;
00027 import org.xml.sax.SAXException;
00028
00029
00032 public class NodeParser extends ExtParser {
00033 private static final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
00034 private final DOMBuilder builder = new DOMBuilder();
00035
00036 protected String getTagName() {
00037 return NodeSerializer.DOM_TAG;
00038 }
00039
00040 protected ContentHandler getExtHandler() throws SAXException {
00041 try {
00042 builder.setTarget(dbf.newDocumentBuilder().newDocument());
00043 } catch (ParserConfigurationException e) {
00044 throw new SAXException(e);
00045 }
00046 return builder;
00047 }
00048
00049 public Object getResult() {
00050 return builder.getTarget();
00051 }
00052 }