01: /*
02: * Copyright 1999-2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: * $Id: DOMSerializer.java,v 1.5 2005/03/16 20:54:11 minchau Exp $
18: */
19: package org.apache.xml.serializer;
20:
21: import java.io.IOException;
22:
23: import org.w3c.dom.Node;
24:
25: /**
26: * Interface for a DOM serializer implementation.
27: * <p>
28: * The DOMSerializer is a facet of a serializer and is obtained from the
29: * asDOMSerializer() method of the Serializer interface.
30: * A serializer may or may not support a DOM serializer, if it does not then the
31: * return value from asDOMSerializer() is null.
32: * <p>
33: * Example:
34: * <pre>
35: * Document doc;
36: * Serializer ser;
37: * OutputStream os;
38: *
39: * ser = ...;
40: * os = ...;
41: *
42: * ser.setOutputStream( os );
43: * DOMSerialzier dser = ser.asDOMSerializer();
44: * dser.serialize(doc);
45: * </pre>
46: *
47: * @see Serializer
48: *
49: * @xsl.usage general
50: *
51: */
52: public interface DOMSerializer {
53: /**
54: * Serializes the DOM node. Throws an exception only if an I/O
55: * exception occured while serializing.
56: *
57: * This interface is a public API.
58: *
59: * @param node the DOM node to serialize
60: * @throws IOException if an I/O exception occured while serializing
61: */
62: public void serialize(Node node) throws IOException;
63: }
|