< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/DOMBuilder.java

Print this page


   1 /*
   2  * Copyright (c) 2006, 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.utils;
  23 
  24 import com.sun.org.apache.xml.internal.res.XMLErrorResources;
  25 import com.sun.org.apache.xml.internal.res.XMLMessages;
  26 import java.util.List;
  27 import java.util.Stack;
  28 import org.w3c.dom.CDATASection;
  29 import org.w3c.dom.Document;
  30 import org.w3c.dom.DocumentFragment;
  31 import org.w3c.dom.Element;
  32 import org.w3c.dom.Node;
  33 import org.w3c.dom.Text;
  34 import org.xml.sax.Attributes;
  35 import org.xml.sax.ContentHandler;
  36 import org.xml.sax.Locator;
  37 import org.xml.sax.ext.LexicalHandler;
  38 /**
  39  * This class takes SAX events (in addition to some extra events
  40  * that SAX doesn't handle yet) and adds the result to a document
  41  * or document fragment.
  42  * @xsl.usage general

  43  */
  44 public class DOMBuilder
  45         implements ContentHandler, LexicalHandler
  46 {
  47 
  48   /** Root document          */
  49   public Document m_doc;
  50 
  51   /** Current node           */
  52   protected Node m_currentNode = null;
  53 
  54   /** The root node          */
  55   protected Node m_root = null;
  56 
  57   /** The next sibling node  */
  58   protected Node m_nextSibling = null;
  59 
  60   /** First node of document fragment or null if not a DocumentFragment     */
  61   public DocumentFragment m_docFrag = null;
  62 


   1 /*
   2  * Copyright (c) 2006, 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.utils;
  22 
  23 import com.sun.org.apache.xml.internal.res.XMLErrorResources;
  24 import com.sun.org.apache.xml.internal.res.XMLMessages;
  25 import java.util.List;
  26 import java.util.Stack;
  27 import org.w3c.dom.CDATASection;
  28 import org.w3c.dom.Document;
  29 import org.w3c.dom.DocumentFragment;
  30 import org.w3c.dom.Element;
  31 import org.w3c.dom.Node;
  32 import org.w3c.dom.Text;
  33 import org.xml.sax.Attributes;
  34 import org.xml.sax.ContentHandler;
  35 import org.xml.sax.Locator;
  36 import org.xml.sax.ext.LexicalHandler;
  37 /**
  38  * This class takes SAX events (in addition to some extra events
  39  * that SAX doesn't handle yet) and adds the result to a document
  40  * or document fragment.
  41  * @xsl.usage general
  42  * @LastModified: Oct 2017
  43  */
  44 public class DOMBuilder
  45         implements ContentHandler, LexicalHandler
  46 {
  47 
  48   /** Root document          */
  49   public Document m_doc;
  50 
  51   /** Current node           */
  52   protected Node m_currentNode = null;
  53 
  54   /** The root node          */
  55   protected Node m_root = null;
  56 
  57   /** The next sibling node  */
  58   protected Node m_nextSibling = null;
  59 
  60   /** First node of document fragment or null if not a DocumentFragment     */
  61   public DocumentFragment m_docFrag = null;
  62 


< prev index next >