src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXBaseWriter.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. |
|
3 * @LastModified: Oct 2017 |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
5 * |
5 * This code is free software; you can redistribute it and/or modify it |
6 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
8 * published by the Free Software Foundation. Oracle designates this |
23 * questions. |
24 * questions. |
24 */ |
25 */ |
25 |
26 |
26 package com.sun.org.apache.xalan.internal.xsltc.trax; |
27 package com.sun.org.apache.xalan.internal.xsltc.trax; |
27 |
28 |
28 import java.util.Vector; |
29 import java.util.ArrayList; |
29 |
30 import java.util.List; |
30 import javax.xml.stream.Location; |
31 import javax.xml.stream.Location; |
31 import javax.xml.stream.XMLReporter; |
32 import javax.xml.stream.XMLReporter; |
32 import javax.xml.stream.XMLStreamException; |
33 import javax.xml.stream.XMLStreamException; |
33 |
|
34 import org.xml.sax.Attributes; |
34 import org.xml.sax.Attributes; |
35 import org.xml.sax.Locator; |
35 import org.xml.sax.Locator; |
36 import org.xml.sax.SAXException; |
36 import org.xml.sax.SAXException; |
37 import org.xml.sax.SAXParseException; |
37 import org.xml.sax.SAXParseException; |
38 import org.xml.sax.ext.LexicalHandler; |
38 import org.xml.sax.ext.LexicalHandler; |
46 |
46 |
47 protected boolean isCDATA; |
47 protected boolean isCDATA; |
48 |
48 |
49 protected StringBuffer CDATABuffer; |
49 protected StringBuffer CDATABuffer; |
50 |
50 |
51 protected Vector namespaces; |
51 protected List<String> namespaces; |
52 |
52 |
53 protected Locator docLocator; |
53 protected Locator docLocator; |
54 |
54 |
55 protected XMLReporter reporter; |
55 protected XMLReporter reporter; |
56 |
56 |
90 public void warning(SAXParseException e) throws SAXException { |
90 public void warning(SAXParseException e) throws SAXException { |
91 reportException("WARNING", e); |
91 reportException("WARNING", e); |
92 } |
92 } |
93 |
93 |
94 public void startDocument() throws SAXException { |
94 public void startDocument() throws SAXException { |
95 namespaces = new Vector(2); |
95 namespaces = new ArrayList<>(2); |
96 } |
96 } |
97 |
97 |
98 public void endDocument() throws SAXException { |
98 public void endDocument() throws SAXException { |
99 namespaces = null; |
99 namespaces = null; |
100 } |
100 } |
117 } else if (prefix.equals("xml")) { |
117 } else if (prefix.equals("xml")) { |
118 return; |
118 return; |
119 } |
119 } |
120 |
120 |
121 if (namespaces == null) { |
121 if (namespaces == null) { |
122 namespaces = new Vector(2); |
122 namespaces = new ArrayList<>(2); |
123 } |
123 } |
124 namespaces.addElement(prefix); |
124 namespaces.add(prefix); |
125 namespaces.addElement(uri); |
125 namespaces.add(uri); |
126 } |
126 } |
127 |
127 |
128 |
128 |
129 public void endPrefixMapping(String prefix) throws SAXException { |
129 public void endPrefixMapping(String prefix) throws SAXException { |
130 } |
130 } |