1 /*
2 * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
3 * @LastModified: Oct 2017
4 */
5 /*
6 * Licensed to the Apache Software Foundation (ASF) under one or more
7 * contributor license agreements. See the NOTICE file distributed with
8 * this work for additional information regarding copyright ownership.
9 * The ASF licenses this file to You under the Apache License, Version 2.0
10 * (the "License"); you may not use this file except in compliance with
11 * the License. You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21
22 package com.sun.org.apache.xml.internal.serializer.dom3;
23
46 import org.w3c.dom.EntityReference;
47 import org.w3c.dom.NamedNodeMap;
48 import org.w3c.dom.Node;
49 import org.w3c.dom.NodeList;
50 import org.w3c.dom.ProcessingInstruction;
51 import org.w3c.dom.Text;
52 import org.w3c.dom.ls.LSSerializerFilter;
53 import org.w3c.dom.traversal.NodeFilter;
54 import org.xml.sax.Locator;
55 import org.xml.sax.SAXException;
56 import org.xml.sax.ext.LexicalHandler;
57 import org.xml.sax.helpers.LocatorImpl;
58
59 /**
60 * Built on org.apache.xml.serializer.TreeWalker and adds functionality to
61 * traverse and serialize a DOM Node (Level 2 or Level 3) as specified in
62 * the DOM Level 3 LS Recommedation by evaluating and applying DOMConfiguration
63 * parameters and filters if any during serialization.
64 *
65 * @xsl.usage internal
66 */
67 final class DOM3TreeWalker {
68
69 /**
70 * The SerializationHandler, it extends ContentHandler and when
71 * this class is instantiated via the constructor provided, a
72 * SerializationHandler object is passed to it.
73 */
74 private SerializationHandler fSerializer = null;
75
76 /** We do not need DOM2Helper since DOM Level 3 LS applies to DOM Level 2 or newer */
77
78 /** Locator object for this TreeWalker */
79 private LocatorImpl fLocator = new LocatorImpl();
80
81 /** ErrorHandler */
82 private DOMErrorHandler fErrorHandler = null;
83
84 /** LSSerializerFilter */
85 private LSSerializerFilter fFilter = null;
|
1 /*
2 * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
3 */
4 /*
5 * Licensed to the Apache Software Foundation (ASF) under one or more
6 * contributor license agreements. See the NOTICE file distributed with
7 * this work for additional information regarding copyright ownership.
8 * The ASF licenses this file to You under the Apache License, Version 2.0
9 * (the "License"); you may not use this file except in compliance with
10 * the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
21 package com.sun.org.apache.xml.internal.serializer.dom3;
22
45 import org.w3c.dom.EntityReference;
46 import org.w3c.dom.NamedNodeMap;
47 import org.w3c.dom.Node;
48 import org.w3c.dom.NodeList;
49 import org.w3c.dom.ProcessingInstruction;
50 import org.w3c.dom.Text;
51 import org.w3c.dom.ls.LSSerializerFilter;
52 import org.w3c.dom.traversal.NodeFilter;
53 import org.xml.sax.Locator;
54 import org.xml.sax.SAXException;
55 import org.xml.sax.ext.LexicalHandler;
56 import org.xml.sax.helpers.LocatorImpl;
57
58 /**
59 * Built on org.apache.xml.serializer.TreeWalker and adds functionality to
60 * traverse and serialize a DOM Node (Level 2 or Level 3) as specified in
61 * the DOM Level 3 LS Recommedation by evaluating and applying DOMConfiguration
62 * parameters and filters if any during serialization.
63 *
64 * @xsl.usage internal
65 * @LastModified: Oct 2017
66 */
67 final class DOM3TreeWalker {
68
69 /**
70 * The SerializationHandler, it extends ContentHandler and when
71 * this class is instantiated via the constructor provided, a
72 * SerializationHandler object is passed to it.
73 */
74 private SerializationHandler fSerializer = null;
75
76 /** We do not need DOM2Helper since DOM Level 3 LS applies to DOM Level 2 or newer */
77
78 /** Locator object for this TreeWalker */
79 private LocatorImpl fLocator = new LocatorImpl();
80
81 /** ErrorHandler */
82 private DOMErrorHandler fErrorHandler = null;
83
84 /** LSSerializerFilter */
85 private LSSerializerFilter fFilter = null;
|