1 22 23 package org.xquark.util; 24 25 import org.w3c.dom.Document ; 26 import org.w3c.dom.Element ; 27 28 44 public class DOMBuilder extends NSPrefixDecorator 45 { 46 private static final String RCSRevision = "$Revision: 1.2 $"; 47 private static final String RCSName = "$Name: $"; 48 49 private BasicDOMBuilder builder; 50 51 public DOMBuilder(Document doc) 52 { 53 builder = new BasicDOMBuilder(doc); 54 plugBuilder(); 55 } 56 57 public DOMBuilder(Element node) 58 { 59 builder = new BasicDOMBuilder(node); 60 plugBuilder(); 61 } 62 63 private void plugBuilder() 64 { 65 setContentHandler(builder); 66 setLexicalHandler(builder); 67 setEnabled(true); 68 } 69 70 public void setDocument(Document doc) 71 { 72 builder.setDocument(doc); 73 } 74 75 public void setElement(Element root) 76 { 77 builder.setElement(root); 78 } 79 } 80 | Popular Tags |