< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.java

Print this page


   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.xalan.internal.xsltc.dom;
  23 


  52 import org.w3c.dom.NodeList;
  53 import org.xml.sax.Attributes;
  54 import org.xml.sax.SAXException;
  55 
  56 
  57 /**
  58  * SAXImpl is the core model for SAX input source. SAXImpl objects are
  59  * usually created from an XSLTCDTMManager.
  60  *
  61  * <p>DOMSource inputs are handled using DOM2SAX + SAXImpl. SAXImpl has a
  62  * few specific fields (e.g. _node2Ids, _document) to keep DOM-related
  63  * information. They are used when the processing behavior between DOM and
  64  * SAX has to be different. Examples of these include id function and
  65  * unparsed entity.
  66  *
  67  * <p>SAXImpl extends SAX2DTM2 instead of SAX2DTM for better performance.
  68  * @author Jacek Ambroziak
  69  * @author Santiago Pericas-Geertsen
  70  * @author Morten Jorgensen
  71  * @author Douglas Sellers <douglasjsellers@hotmail.com>

  72  */
  73 public final class SAXImpl extends SAX2DTM2
  74                            implements DOMEnhancedForDTM, DOMBuilder
  75 {
  76 
  77     /* ------------------------------------------------------------------- */
  78     /* DOMBuilder fields BEGIN                                             */
  79     /* ------------------------------------------------------------------- */
  80 
  81     // Namespace prefix-to-uri mapping stuff
  82     private int       _uriCount     = 0;
  83     // private int       _prefixCount  = 0;
  84 
  85     // Stack used to keep track of what whitespace text nodes are protected
  86     // by xml:space="preserve" attributes and which nodes that are not.
  87     private int[]   _xmlSpaceStack;
  88     private int     _idx = 1;
  89     private boolean _preserve = false;
  90 
  91     // private static final String XML_STRING = "xml:";


   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.xalan.internal.xsltc.dom;
  22 


  51 import org.w3c.dom.NodeList;
  52 import org.xml.sax.Attributes;
  53 import org.xml.sax.SAXException;
  54 
  55 
  56 /**
  57  * SAXImpl is the core model for SAX input source. SAXImpl objects are
  58  * usually created from an XSLTCDTMManager.
  59  *
  60  * <p>DOMSource inputs are handled using DOM2SAX + SAXImpl. SAXImpl has a
  61  * few specific fields (e.g. _node2Ids, _document) to keep DOM-related
  62  * information. They are used when the processing behavior between DOM and
  63  * SAX has to be different. Examples of these include id function and
  64  * unparsed entity.
  65  *
  66  * <p>SAXImpl extends SAX2DTM2 instead of SAX2DTM for better performance.
  67  * @author Jacek Ambroziak
  68  * @author Santiago Pericas-Geertsen
  69  * @author Morten Jorgensen
  70  * @author Douglas Sellers <douglasjsellers@hotmail.com>
  71  * @LastModified: Oct 2017
  72  */
  73 public final class SAXImpl extends SAX2DTM2
  74                            implements DOMEnhancedForDTM, DOMBuilder
  75 {
  76 
  77     /* ------------------------------------------------------------------- */
  78     /* DOMBuilder fields BEGIN                                             */
  79     /* ------------------------------------------------------------------- */
  80 
  81     // Namespace prefix-to-uri mapping stuff
  82     private int       _uriCount     = 0;
  83     // private int       _prefixCount  = 0;
  84 
  85     // Stack used to keep track of what whitespace text nodes are protected
  86     // by xml:space="preserve" attributes and which nodes that are not.
  87     private int[]   _xmlSpaceStack;
  88     private int     _idx = 1;
  89     private boolean _preserve = false;
  90 
  91     // private static final String XML_STRING = "xml:";


< prev index next >