1 /* 2 * Copyright 2005 The Apache Software Foundation. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.apache.xerces.jaxp.validation; 18 19 import javax.xml.transform.dom.DOMResult; 20 21 import org.apache.xerces.xni.XMLDocumentHandler; 22 import org.apache.xerces.xni.XNIException; 23 24 import org.w3c.dom.CDATASection; 25 import org.w3c.dom.Comment; 26 import org.w3c.dom.DocumentType; 27 import org.w3c.dom.ProcessingInstruction; 28 import org.w3c.dom.Text; 29 30 /** 31 * <p>An extension to XMLDocumentHandler for building DOM structures.</p> 32 * 33 * @author Michael Glavassevich, IBM 34 * @version $Id: DOMDocumentHandler.java,v 1.1 2005/05/22 20:08:07 mrglavas Exp $ 35 */ 36 interface DOMDocumentHandler extends XMLDocumentHandler { 37 38 /** 39 * <p>Sets the <code>DOMResult</code> object which 40 * receives the constructed DOM nodes.</p> 41 * 42 * @param result the object which receives the constructed DOM nodes 43 */ 44 public void setDOMResult(DOMResult result); 45 46 /** 47 * A document type declaration. 48 * 49 * @param node a DocumentType node 50 * 51 * @exception XNIException Thrown by handler to signal an error. 52 */ 53 public void doctypeDecl(DocumentType node) throws XNIException; 54 55 public void characters(Text node) throws XNIException; 56 57 public void cdata(CDATASection node) throws XNIException; 58 59 /** 60 * A comment. 61 * 62 * @param node a Comment node 63 * 64 * @exception XNIException Thrown by application to signal an error. 65 */ 66 public void comment(Comment node) throws XNIException; 67 68 /** 69 * A processing instruction. Processing instructions consist of a 70 * target name and, optionally, text data. The data is only meaningful 71 * to the application. 72 * <p> 73 * Typically, a processing instruction's data will contain a series 74 * of pseudo-attributes. These pseudo-attributes follow the form of 75 * element attributes but are <strong>not</strong> parsed or presented 76 * to the application as anything other than text. The application is 77 * responsible for parsing the data. 78 * 79 * @param node a ProcessingInstruction node 80 * 81 * @exception XNIException Thrown by handler to signal an error. 82 */ 83 public void processingInstruction(ProcessingInstruction node) throws XNIException; 84 85 public void setIgnoringCharacters(boolean ignore); 86 } 87