1 |
--- src/com/microstar/xml/XmlParser.java |
2 |
+++ src/com/microstar/xml/XmlParser.java |
3 |
@@ -1350,7 +1350,7 @@ |
4 |
{ |
5 |
String name; |
6 |
int type; |
7 |
- String enum = null; |
8 |
+ String enum2 = null; |
9 |
|
10 |
// Read the attribute name. |
11 |
name = readNmtoken(true); |
12 |
@@ -1362,12 +1362,12 @@ |
13 |
// Get the string of enumerated values |
14 |
// if necessary. |
15 |
if (type == ATTRIBUTE_ENUMERATED || type == ATTRIBUTE_NOTATION) { |
16 |
- enum = dataBufferToString(); |
17 |
+ enum2 = dataBufferToString(); |
18 |
} |
19 |
|
20 |
// Read the default value. |
21 |
requireWhitespace(); |
22 |
- parseDefault(elementName, name, type, enum); |
23 |
+ parseDefault(elementName, name, type, enum2); |
24 |
} |
25 |
|
26 |
|
27 |
@@ -1380,7 +1380,7 @@ |
28 |
* [57] EnumeratedType ::= NotationType | Enumeration |
29 |
* *TODO: validate the type!! |
30 |
*/ |
31 |
- int readAttType () |
32 |
+ protected int readAttType () |
33 |
throws java.lang.Exception |
34 |
{ |
35 |
String typeString; |
36 |
@@ -1411,7 +1411,7 @@ |
37 |
* [61] Etoks ::= %Nmtoken (S? '|' S? %Nmtoken)* |
38 |
* *NOTE: the '(' has already been read. |
39 |
*/ |
40 |
- void parseEnumeration () |
41 |
+ protected void parseEnumeration () |
42 |
throws java.lang.Exception |
43 |
{ |
44 |
char c; |
45 |
@@ -1441,7 +1441,7 @@ |
46 |
* [59] Ntoks ::= %Name (S? '|' S? %Name) |
47 |
* *NOTE: the 'NOTATION' has already been read |
48 |
*/ |
49 |
- void parseNotationType () |
50 |
+ protected void parseNotationType () |
51 |
throws java.lang.Exception |
52 |
{ |
53 |
requireWhitespace(); |
54 |
@@ -1455,7 +1455,7 @@ |
55 |
* Parse the default value for an attribute. |
56 |
* [62] Default ::= '#REQUIRED' | '#IMPLIED' | ((%'#FIXED' S)? %AttValue |
57 |
*/ |
58 |
- void parseDefault (String elementName, String name, int type, String enum) |
59 |
+ protected void parseDefault (String elementName, String name, int type, String enum2) |
60 |
throws java.lang.Exception |
61 |
{ |
62 |
int valueType = ATTRIBUTE_DEFAULT_SPECIFIED; |
63 |
@@ -1481,7 +1481,7 @@ |
64 |
value = readLiteral(LIT_CHAR_REF); |
65 |
context = CONTEXT_DTD; |
66 |
} |
67 |
- setAttribute(elementName, name, type, enum, value, valueType); |
68 |
+ setAttribute(elementName, name, type, enum2, value, valueType); |
69 |
} |
70 |
|
71 |
|
72 |
@@ -1497,7 +1497,7 @@ |
73 |
* *NOTE: the '<![' has already been read. |
74 |
* *TODO: verify that I am handling ignoreSectContents right. |
75 |
*/ |
76 |
- void parseConditionalSect () |
77 |
+ protected void parseConditionalSect () |
78 |
throws java.lang.Exception |
79 |
{ |
80 |
skipWhitespace(); |
81 |
@@ -1539,7 +1539,7 @@ |
82 |
* [67] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';' |
83 |
* *NOTE: the '&#' has already been read. |
84 |
*/ |
85 |
- void parseCharRef () |
86 |
+ protected void parseCharRef () |
87 |
throws java.lang.Exception |
88 |
{ |
89 |
int value = 0; |
90 |
@@ -1630,7 +1630,7 @@ |
91 |
* *NOTE: the '&' has already been read. |
92 |
* @param externalAllowed External entities are allowed here. |
93 |
*/ |
94 |
- void parseEntityRef (boolean externalAllowed) |
95 |
+ protected void parseEntityRef (boolean externalAllowed) |
96 |
throws java.lang.Exception |
97 |
{ |
98 |
String name; |
99 |
@@ -1669,7 +1669,7 @@ |
100 |
* [70] PEReference ::= '%' Name ';' |
101 |
* *NOTE: the '%' has already been read. |
102 |
*/ |
103 |
- void parsePEReference (boolean isEntityValue) |
104 |
+ protected void parsePEReference (boolean isEntityValue) |
105 |
throws java.lang.Exception |
106 |
{ |
107 |
String name; |
108 |
@@ -1713,7 +1713,7 @@ |
109 |
* [75] NDataDecl ::= S %'NDATA' S %Name |
110 |
* *NOTE: the '<!ENTITY' has already been read. |
111 |
*/ |
112 |
- void parseEntityDecl () |
113 |
+ protected void parseEntityDecl () |
114 |
throws java.lang.Exception |
115 |
{ |
116 |
char c; |
117 |
@@ -1773,7 +1773,7 @@ |
118 |
* [81] NotationDecl ::= '<!NOTATION' S %Name S %ExternalID S? '>' |
119 |
* *NOTE: the '<!NOTATION' has already been read. |
120 |
*/ |
121 |
- void parseNotationDecl () |
122 |
+ protected void parseNotationDecl () |
123 |
throws java.lang.Exception |
124 |
{ |
125 |
String nname, ids[]; |
126 |
@@ -1806,7 +1806,7 @@ |
127 |
* <p>The trick here is that the data stays in the dataBuffer without |
128 |
* necessarily being converted to a string right away. |
129 |
*/ |
130 |
- void parsePCData () |
131 |
+ protected void parsePCData () |
132 |
throws java.lang.Exception |
133 |
{ |
134 |
char c; |
135 |
@@ -1871,7 +1871,7 @@ |
136 |
* Require whitespace characters. |
137 |
* [1] S ::= (#x20 | #x9 | #xd | #xa)+ |
138 |
*/ |
139 |
- void requireWhitespace () |
140 |
+ protected void requireWhitespace () |
141 |
throws java.lang.Exception |
142 |
{ |
143 |
char c = readCh(); |
144 |
@@ -1886,7 +1886,7 @@ |
145 |
/** |
146 |
* Parse whitespace characters, and leave them in the data buffer. |
147 |
*/ |
148 |
- void parseWhitespace () |
149 |
+ protected void parseWhitespace () |
150 |
throws java.lang.Exception |
151 |
{ |
152 |
char c = readCh(); |
153 |
@@ -1902,7 +1902,7 @@ |
154 |
* Skip whitespace characters. |
155 |
* [1] S ::= (#x20 | #x9 | #xd | #xa)+ |
156 |
*/ |
157 |
- void skipWhitespace () |
158 |
+ protected void skipWhitespace () |
159 |
throws java.lang.Exception |
160 |
{ |
161 |
// Start with a little cheat. Most of |
162 |
@@ -1956,7 +1956,7 @@ |
163 |
* [7] Nmtoken ::= (NameChar)+ |
164 |
* *NOTE: [6] is implemented implicitly where required. |
165 |
*/ |
166 |
- String readNmtoken (boolean isName) |
167 |
+ protected String readNmtoken (boolean isName) |
168 |
throws java.lang.Exception |
169 |
{ |
170 |
char c; |
171 |
@@ -2049,7 +2049,7 @@ |
172 |
* [9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' |
173 |
* | "'" ([^%&'] | PEReference | Reference)* "'" |
174 |
*/ |
175 |
- String readLiteral (int flags) |
176 |
+ protected String readLiteral (int flags) |
177 |
throws java.lang.Exception |
178 |
{ |
179 |
char delim, c; |
180 |
@@ -2119,7 +2119,7 @@ |
181 |
* @param inNotation Are we in a notation? |
182 |
* @return A two-member String array containing the identifiers. |
183 |
*/ |
184 |
- String[] readExternalIds (boolean inNotation) |
185 |
+ protected String[] readExternalIds (boolean inNotation) |
186 |
throws java.lang.Exception |
187 |
{ |
188 |
char c; |
189 |
@@ -2154,7 +2154,7 @@ |
190 |
* @param c The character to test. |
191 |
* @return true if the character is whitespace. |
192 |
*/ |
193 |
- final boolean isWhitespace (char c) |
194 |
+ protected final boolean isWhitespace (char c) |
195 |
{ |
196 |
switch ((int)c) { |
197 |
case 0x20: |
198 |
@@ -2177,7 +2177,7 @@ |
199 |
/** |
200 |
* Add a character to the data buffer. |
201 |
*/ |
202 |
- void dataBufferAppend (char c) |
203 |
+ protected void dataBufferAppend (char c) |
204 |
{ |
205 |
// Expand buffer if necessary. |
206 |
dataBuffer = |
207 |
@@ -2189,7 +2189,7 @@ |
208 |
/** |
209 |
* Add a string to the data buffer. |
210 |
*/ |
211 |
- void dataBufferAppend (String s) |
212 |
+ protected void dataBufferAppend (String s) |
213 |
{ |
214 |
dataBufferAppend(s.toCharArray(), 0, s.length()); |
215 |
} |
216 |
@@ -2198,7 +2198,7 @@ |
217 |
/** |
218 |
* Append (part of) a character array to the data buffer. |
219 |
*/ |
220 |
- void dataBufferAppend (char ch[], int start, int length) |
221 |
+ protected void dataBufferAppend (char ch[], int start, int length) |
222 |
{ |
223 |
dataBuffer = |
224 |
(char[])extendArray(dataBuffer, dataBuffer.length, |
225 |
@@ -2213,7 +2213,7 @@ |
226 |
/** |
227 |
* Normalise whitespace in the data buffer. |
228 |
*/ |
229 |
- void dataBufferNormalize () |
230 |
+ protected void dataBufferNormalize () |
231 |
{ |
232 |
int i = 0; |
233 |
int j = 0; |
234 |
@@ -2256,7 +2256,7 @@ |
235 |
* @param internFlag true if the contents should be interned. |
236 |
* @see #intern(char[],int,int) |
237 |
*/ |
238 |
- String dataBufferToString () |
239 |
+ protected String dataBufferToString () |
240 |
{ |
241 |
String s = new String(dataBuffer, 0, dataBufferPos); |
242 |
dataBufferPos = 0; |
243 |
@@ -2268,7 +2268,7 @@ |
244 |
* Flush the contents of the data buffer to the handler, if |
245 |
* appropriate, and reset the buffer for new input. |
246 |
*/ |
247 |
- void dataBufferFlush () |
248 |
+ protected void dataBufferFlush () |
249 |
throws java.lang.Exception |
250 |
{ |
251 |
if (dataBufferPos > 0) { |
252 |
@@ -2297,7 +2297,7 @@ |
253 |
/** |
254 |
* Require a string to appear, or throw an exception. |
255 |
*/ |
256 |
- void require (String delim) |
257 |
+ protected void require (String delim) |
258 |
throws java.lang.Exception |
259 |
{ |
260 |
char ch[] = delim.toCharArray(); |
261 |
@@ -2310,7 +2310,7 @@ |
262 |
/** |
263 |
* Require a character to appear, or throw an exception. |
264 |
*/ |
265 |
- void require (char delim) |
266 |
+ protected void require (char delim) |
267 |
throws java.lang.Exception |
268 |
{ |
269 |
char c = readCh(); |
270 |
@@ -2422,7 +2422,7 @@ |
271 |
* Ensure the capacity of an array, allocating a new one if |
272 |
* necessary. |
273 |
*/ |
274 |
- Object extendArray (Object array, int currentSize, int requiredSize) |
275 |
+ protected Object extendArray (Object array, int currentSize, int requiredSize) |
276 |
{ |
277 |
if (requiredSize < currentSize) { |
278 |
return array; |