1 10 package org.jgap.xml; 11 12 import org.jgap.data.*; 13 import org.w3c.dom.*; 14 import javax.xml.parsers.*; 15 16 23 public class XMLDocumentBuilder 24 extends DocumentBuilderBase { 25 26 private final static String CVS_REVISION = "$Revision: 1.8 $"; 27 28 protected void setAttribute(final Object a_xmlElement, final String a_key, 29 final String a_value) { 30 ( (Element) a_xmlElement).setAttribute(a_key, a_value); 31 } 32 33 protected Object documentAppendChild(final Object a_xmlDocument, 34 final Object a_element) { 35 return ( (Document) a_xmlDocument).appendChild( (Element) a_element); 36 } 37 38 protected Object elementAppendChild(final Object a_xmlElement, 39 final Object a_element) { 40 return ( (Element) a_xmlElement).appendChild( (Element) a_element); 41 } 42 43 protected Object createElement(final Object a_doc, final Object a_xmlElement, 44 final String a_tagName) { 45 return ( (Document) a_doc).createElement(a_tagName); 46 } 47 48 59 public Object buildDocument(final IDataCreators a_document) 60 throws Exception { 61 DocumentBuilder m_documentCreator = DocumentBuilderFactory.newInstance(). 62 newDocumentBuilder(); 63 Document xmlDoc = m_documentCreator.newDocument(); 64 return super.buildDocument(a_document, xmlDoc); 65 } 66 } 67 | Popular Tags |