1 /* |
1 /* |
2 * reserved comment block |
2 * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT REMOVE OR ALTER! |
3 * @LastModified: Oct 2017 |
4 */ |
4 */ |
5 /* |
5 /* |
6 * Licensed to the Apache Software Foundation (ASF) under one or more |
6 * Licensed to the Apache Software Foundation (ASF) under one or more |
7 * contributor license agreements. See the NOTICE file distributed with |
7 * contributor license agreements. See the NOTICE file distributed with |
8 * this work for additional information regarding copyright ownership. |
8 * this work for additional information regarding copyright ownership. |
19 * limitations under the License. |
19 * limitations under the License. |
20 */ |
20 */ |
21 |
21 |
22 package com.sun.org.apache.xml.internal.utils; |
22 package com.sun.org.apache.xml.internal.utils; |
23 |
23 |
24 import java.util.Stack; |
|
25 |
|
26 import com.sun.org.apache.xml.internal.res.XMLErrorResources; |
24 import com.sun.org.apache.xml.internal.res.XMLErrorResources; |
27 import com.sun.org.apache.xml.internal.res.XMLMessages; |
25 import com.sun.org.apache.xml.internal.res.XMLMessages; |
28 |
26 import java.util.List; |
|
27 import java.util.Stack; |
|
28 import org.w3c.dom.CDATASection; |
29 import org.w3c.dom.Document; |
29 import org.w3c.dom.Document; |
30 import org.w3c.dom.DocumentFragment; |
30 import org.w3c.dom.DocumentFragment; |
31 import org.w3c.dom.Element; |
31 import org.w3c.dom.Element; |
32 import org.w3c.dom.Node; |
32 import org.w3c.dom.Node; |
33 import org.w3c.dom.Text; |
33 import org.w3c.dom.Text; |
34 import org.w3c.dom.CDATASection; |
|
35 |
|
36 import org.xml.sax.Attributes; |
34 import org.xml.sax.Attributes; |
37 import org.xml.sax.ContentHandler; |
35 import org.xml.sax.ContentHandler; |
38 import org.xml.sax.Locator; |
36 import org.xml.sax.Locator; |
39 import org.xml.sax.ext.LexicalHandler; |
37 import org.xml.sax.ext.LexicalHandler; |
40 /** |
38 /** |
60 protected Node m_nextSibling = null; |
58 protected Node m_nextSibling = null; |
61 |
59 |
62 /** First node of document fragment or null if not a DocumentFragment */ |
60 /** First node of document fragment or null if not a DocumentFragment */ |
63 public DocumentFragment m_docFrag = null; |
61 public DocumentFragment m_docFrag = null; |
64 |
62 |
65 /** Vector of element nodes */ |
63 /** Stack of element nodes */ |
66 protected Stack m_elemStack = new Stack(); |
64 protected Stack<Node> m_elemStack = new Stack<>(); |
67 |
65 |
68 /** |
66 /** |
69 * DOMBuilder instance constructor... it will add the DOM nodes |
67 * DOMBuilder instance constructor... it will add the DOM nodes |
70 * to the document fragment. |
68 * to the document fragment. |
71 * |
69 * |
400 */ |
398 */ |
401 public void endElement(String ns, String localName, String name) |
399 public void endElement(String ns, String localName, String name) |
402 throws org.xml.sax.SAXException |
400 throws org.xml.sax.SAXException |
403 { |
401 { |
404 m_elemStack.pop(); |
402 m_elemStack.pop(); |
405 m_currentNode = m_elemStack.isEmpty() ? null : (Node)m_elemStack.peek(); |
403 m_currentNode = m_elemStack.isEmpty() ? null : m_elemStack.peek(); |
406 } |
404 } |
407 |
405 |
408 /** |
406 /** |
409 * Set an ID string to node association in the ID table. |
407 * Set an ID string to node association in the ID table. |
410 * |
408 * |