6
|
1 |
/*
|
|
2 |
* Portions Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
|
|
3 |
*/
|
|
4 |
|
|
5 |
/*
|
|
6 |
* Copyright 2005 The Apache Software Foundation.
|
|
7 |
*
|
|
8 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9 |
* you may not use this file except in compliance with the License.
|
|
10 |
* 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.xml.internal.stream.dtd;
|
|
22 |
import com.sun.xml.internal.stream.dtd.nonvalidating.DTDGrammar;
|
|
23 |
import com.sun.xml.internal.stream.dtd.nonvalidating.XMLAttributeDecl;
|
|
24 |
import com.sun.xml.internal.stream.dtd.nonvalidating.XMLElementDecl;
|
|
25 |
import com.sun.xml.internal.stream.dtd.nonvalidating.XMLSimpleType;
|
|
26 |
import com.sun.org.apache.xerces.internal.impl.Constants;
|
|
27 |
import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
|
|
28 |
import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
|
|
29 |
import com.sun.org.apache.xerces.internal.util.SymbolTable;
|
|
30 |
import com.sun.org.apache.xerces.internal.util.XMLChar;
|
|
31 |
import com.sun.org.apache.xerces.internal.util.XMLSymbols;
|
|
32 |
import com.sun.org.apache.xerces.internal.xni.Augmentations;
|
|
33 |
import com.sun.org.apache.xerces.internal.xni.QName;
|
|
34 |
import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
|
|
35 |
import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
|
|
36 |
import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
|
|
37 |
import com.sun.org.apache.xerces.internal.xni.XMLLocator;
|
|
38 |
import com.sun.org.apache.xerces.internal.xni.XMLString;
|
|
39 |
import com.sun.org.apache.xerces.internal.xni.XNIException;
|
|
40 |
import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
|
|
41 |
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
|
|
42 |
import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
|
|
43 |
import javax.xml.XMLConstants;
|
|
44 |
|
|
45 |
/*
|
|
46 |
* @author Eric Ye, IBM
|
|
47 |
* @author Andy Clark, IBM
|
|
48 |
* @author Jeffrey Rodriguez IBM
|
|
49 |
* @author Neil Graham, IBM
|
|
50 |
* @author Sunitha Reddy, Sun Microsystems
|
|
51 |
*/
|
|
52 |
|
|
53 |
public class DTDGrammarUtil {
|
|
54 |
|
|
55 |
|
|
56 |
/** Property identifier: symbol table. */
|
|
57 |
protected static final String SYMBOL_TABLE =
|
|
58 |
Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
|
|
59 |
|
|
60 |
protected static final String NAMESPACES =
|
|
61 |
Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
|
|
62 |
|
|
63 |
|
|
64 |
/** Compile to true to debug attributes. */
|
|
65 |
private static final boolean DEBUG_ATTRIBUTES = false;
|
|
66 |
|
|
67 |
/** Compile to true to debug element children. */
|
|
68 |
private static final boolean DEBUG_ELEMENT_CHILDREN = false;
|
|
69 |
|
|
70 |
protected DTDGrammar fDTDGrammar = null;
|
|
71 |
/** Namespaces. */
|
|
72 |
protected boolean fNamespaces;
|
|
73 |
|
|
74 |
/** Symbol table. */
|
|
75 |
protected SymbolTable fSymbolTable = null;
|
|
76 |
|
|
77 |
/** Current element index. */
|
|
78 |
private int fCurrentElementIndex = -1;
|
|
79 |
|
|
80 |
/** Current content spec type. */
|
|
81 |
private int fCurrentContentSpecType = -1;
|
|
82 |
|
|
83 |
/** Content spec type stack. */
|
|
84 |
private boolean[] fElementContentState = new boolean[8];
|
|
85 |
|
|
86 |
/** Element depth. */
|
|
87 |
private int fElementDepth = -1;
|
|
88 |
|
|
89 |
/** True if inside of element content. */
|
|
90 |
private boolean fInElementContent = false;
|
|
91 |
|
|
92 |
/** Temporary atribute declaration. */
|
|
93 |
private XMLAttributeDecl fTempAttDecl = new XMLAttributeDecl();
|
|
94 |
|
|
95 |
/** Temporary qualified name. */
|
|
96 |
private QName fTempQName = new QName();
|
|
97 |
|
|
98 |
/** Temporary string buffers. */
|
|
99 |
private StringBuffer fBuffer = new StringBuffer();
|
|
100 |
|
|
101 |
private NamespaceContext fNamespaceContext = null;
|
|
102 |
|
|
103 |
/** Default constructor. */
|
|
104 |
public DTDGrammarUtil(SymbolTable symbolTable) {
|
|
105 |
fSymbolTable = symbolTable;
|
|
106 |
}
|
|
107 |
|
|
108 |
public DTDGrammarUtil(DTDGrammar grammar, SymbolTable symbolTable) {
|
|
109 |
fDTDGrammar = grammar;
|
|
110 |
fSymbolTable = symbolTable;
|
|
111 |
}
|
|
112 |
|
|
113 |
public DTDGrammarUtil(DTDGrammar grammar, SymbolTable symbolTable,
|
|
114 |
NamespaceContext namespaceContext) {
|
|
115 |
fDTDGrammar = grammar;
|
|
116 |
fSymbolTable = symbolTable;
|
|
117 |
fNamespaceContext = namespaceContext;
|
|
118 |
}
|
|
119 |
|
|
120 |
/*
|
|
121 |
* Resets the component. The component can query the component manager
|
|
122 |
* about any features and properties that affect the operation of the
|
|
123 |
* component.
|
|
124 |
*
|
|
125 |
* @param componentManager The component manager.
|
|
126 |
*
|
|
127 |
* @throws SAXException Thrown by component on finitialization error.
|
|
128 |
* For example, if a feature or property is
|
|
129 |
* required for the operation of the component, the
|
|
130 |
* component manager may throw a
|
|
131 |
* SAXNotRecognizedException or a
|
|
132 |
* SAXNotSupportedException.
|
|
133 |
*/
|
|
134 |
public void reset(XMLComponentManager componentManager)
|
|
135 |
throws XMLConfigurationException {
|
|
136 |
|
|
137 |
fDTDGrammar = null;
|
|
138 |
fInElementContent = false;
|
|
139 |
fCurrentElementIndex = -1;
|
|
140 |
fCurrentContentSpecType = -1;
|
|
141 |
try {
|
|
142 |
fNamespaces = componentManager.getFeature(NAMESPACES);
|
|
143 |
} catch (XMLConfigurationException e) {
|
|
144 |
fNamespaces = true;
|
|
145 |
}
|
|
146 |
fSymbolTable = (SymbolTable) componentManager.getProperty(
|
|
147 |
Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY);
|
|
148 |
fElementDepth = -1;
|
|
149 |
}
|
|
150 |
|
|
151 |
|
|
152 |
/**
|
|
153 |
* The start of an element.
|
|
154 |
*
|
|
155 |
* @param element The name of the element.
|
|
156 |
* @param attributes The element attributes.
|
|
157 |
* @param augs Additional information that may include infoset augmentations
|
|
158 |
*
|
|
159 |
* @throws XNIException Thrown by handler to signal an error.
|
|
160 |
*/
|
|
161 |
public void startElement(QName element, XMLAttributes attributes) throws XNIException {
|
|
162 |
handleStartElement(element, attributes);
|
|
163 |
}
|
|
164 |
|
|
165 |
/**
|
|
166 |
* The end of an element.
|
|
167 |
*
|
|
168 |
* @param element The name of the element.
|
|
169 |
* @param augs Additional information that may include infoset augmentations
|
|
170 |
*
|
|
171 |
* @throws XNIException Thrown by handler to signal an error.
|
|
172 |
*/
|
|
173 |
public void endElement(QName element) throws XNIException {
|
|
174 |
handleEndElement(element);
|
|
175 |
}
|
|
176 |
|
|
177 |
/**
|
|
178 |
* The start of a CDATA section.
|
|
179 |
* @param augs Additional information that may include infoset augmentations
|
|
180 |
*
|
|
181 |
* @throws XNIException Thrown by handler to signal an error.
|
|
182 |
*/
|
|
183 |
public void startCDATA(Augmentations augs) throws XNIException {
|
|
184 |
}
|
|
185 |
|
|
186 |
/**
|
|
187 |
* The end of a CDATA section.
|
|
188 |
* @param augs Additional information that may include infoset augmentations
|
|
189 |
*
|
|
190 |
* @throws XNIException Thrown by handler to signal an error.
|
|
191 |
*/
|
|
192 |
public void endCDATA(Augmentations augs) throws XNIException {
|
|
193 |
}
|
|
194 |
|
|
195 |
|
|
196 |
|
|
197 |
/** Add default attributes and validate. */
|
|
198 |
public void addDTDDefaultAttrs(QName elementName, XMLAttributes attributes)
|
|
199 |
throws XNIException {
|
|
200 |
|
|
201 |
int elementIndex;
|
|
202 |
elementIndex = fDTDGrammar.getElementDeclIndex(elementName);
|
|
203 |
// is there anything to do?
|
|
204 |
if (elementIndex == -1 || fDTDGrammar == null) {
|
|
205 |
return;
|
|
206 |
}
|
|
207 |
|
|
208 |
//
|
|
209 |
// Check after all specified attrs are scanned
|
|
210 |
// (1) report error for REQUIRED attrs that are missing (V_TAGc)
|
|
211 |
// (2) add default attrs (FIXED and NOT_FIXED)
|
|
212 |
//
|
|
213 |
int attlistIndex = fDTDGrammar.getFirstAttributeDeclIndex(elementIndex);
|
|
214 |
|
|
215 |
while (attlistIndex != -1) {
|
|
216 |
|
|
217 |
fDTDGrammar.getAttributeDecl(attlistIndex, fTempAttDecl);
|
|
218 |
|
|
219 |
if (DEBUG_ATTRIBUTES) {
|
|
220 |
if (fTempAttDecl != null) {
|
|
221 |
XMLElementDecl elementDecl = new XMLElementDecl();
|
|
222 |
fDTDGrammar.getElementDecl(elementIndex, elementDecl);
|
|
223 |
System.out.println("element: " + (elementDecl.name.localpart));
|
|
224 |
System.out.println("attlistIndex " + attlistIndex + "\n" +
|
|
225 |
"attName : '" + (fTempAttDecl.name.localpart) + "'\n"
|
|
226 |
+ "attType : " + fTempAttDecl.simpleType.type + "\n"
|
|
227 |
+ "attDefaultType : " + fTempAttDecl.simpleType.defaultType + "\n"
|
|
228 |
+ "attDefaultValue : '" + fTempAttDecl.simpleType.defaultValue + "'\n"
|
|
229 |
+ attributes.getLength() + "\n"
|
|
230 |
);
|
|
231 |
}
|
|
232 |
}
|
|
233 |
String attPrefix = fTempAttDecl.name.prefix;
|
|
234 |
String attLocalpart = fTempAttDecl.name.localpart;
|
|
235 |
String attRawName = fTempAttDecl.name.rawname;
|
|
236 |
String attType = getAttributeTypeName(fTempAttDecl);
|
|
237 |
int attDefaultType = fTempAttDecl.simpleType.defaultType;
|
|
238 |
String attValue = null;
|
|
239 |
|
|
240 |
if (fTempAttDecl.simpleType.defaultValue != null) {
|
|
241 |
attValue = fTempAttDecl.simpleType.defaultValue;
|
|
242 |
}
|
|
243 |
boolean specified = false;
|
|
244 |
boolean required = attDefaultType == XMLSimpleType.DEFAULT_TYPE_REQUIRED;
|
|
245 |
boolean cdata = attType == XMLSymbols.fCDATASymbol;
|
|
246 |
|
|
247 |
if (!cdata || required || attValue != null) {
|
|
248 |
|
|
249 |
//check whether attribute is a namespace declaration
|
|
250 |
if (fNamespaceContext != null && attRawName.startsWith(XMLConstants.XMLNS_ATTRIBUTE)) {
|
|
251 |
String prefix = "";
|
|
252 |
int pos = attRawName.indexOf(':');
|
|
253 |
if (pos != -1) {
|
|
254 |
prefix = attRawName.substring(0, pos);
|
|
255 |
} else {
|
|
256 |
prefix = attRawName;
|
|
257 |
}
|
|
258 |
prefix = fSymbolTable.addSymbol(prefix);
|
|
259 |
if (!((com.sun.org.apache.xerces.internal.util.
|
|
260 |
NamespaceSupport) fNamespaceContext).
|
|
261 |
containsPrefixInCurrentContext(prefix)) {
|
|
262 |
fNamespaceContext.declarePrefix(prefix, attValue);
|
|
263 |
}
|
|
264 |
specified = true;
|
|
265 |
} else {
|
|
266 |
|
|
267 |
int attrCount = attributes.getLength();
|
|
268 |
for (int i = 0; i < attrCount; i++) {
|
|
269 |
if (attributes.getQName(i) == attRawName) {
|
|
270 |
specified = true;
|
|
271 |
break;
|
|
272 |
}
|
|
273 |
}
|
|
274 |
|
|
275 |
}
|
|
276 |
|
|
277 |
}
|
|
278 |
|
|
279 |
if (!specified) {
|
|
280 |
if (attValue != null) {
|
|
281 |
if (fNamespaces) {
|
|
282 |
int index = attRawName.indexOf(':');
|
|
283 |
if (index != -1) {
|
|
284 |
attPrefix = attRawName.substring(0, index);
|
|
285 |
attPrefix = fSymbolTable.addSymbol(attPrefix);
|
|
286 |
attLocalpart = attRawName.substring(index + 1);
|
|
287 |
attLocalpart = fSymbolTable.addSymbol(attLocalpart);
|
|
288 |
}
|
|
289 |
}
|
|
290 |
fTempQName.setValues(attPrefix, attLocalpart, attRawName,
|
|
291 |
fTempAttDecl.name.uri);
|
|
292 |
int newAttr = attributes.addAttribute(fTempQName, attType,
|
|
293 |
attValue);
|
|
294 |
}
|
|
295 |
}
|
|
296 |
attlistIndex = fDTDGrammar.getNextAttributeDeclIndex(attlistIndex);
|
|
297 |
}
|
|
298 |
|
|
299 |
// now iterate through the expanded attributes for
|
|
300 |
// 1. if every attribute seen is declared in the DTD
|
|
301 |
// 2. check if the VC: default_fixed holds
|
|
302 |
// 3. validate every attribute.
|
|
303 |
int attrCount = attributes.getLength();
|
|
304 |
for (int i = 0; i < attrCount; i++) {
|
|
305 |
String attrRawName = attributes.getQName(i);
|
|
306 |
boolean declared = false;
|
|
307 |
int position =
|
|
308 |
fDTDGrammar.getFirstAttributeDeclIndex(elementIndex);
|
|
309 |
while (position != -1) {
|
|
310 |
fDTDGrammar.getAttributeDecl(position, fTempAttDecl);
|
|
311 |
if (fTempAttDecl.name.rawname == attrRawName) {
|
|
312 |
// found the match att decl,
|
|
313 |
declared = true;
|
|
314 |
break;
|
|
315 |
}
|
|
316 |
position = fDTDGrammar.getNextAttributeDeclIndex(position);
|
|
317 |
}
|
|
318 |
if (!declared) {
|
|
319 |
continue;
|
|
320 |
}
|
|
321 |
|
|
322 |
String type = getAttributeTypeName(fTempAttDecl);
|
|
323 |
attributes.setType(i, type);
|
|
324 |
|
|
325 |
boolean changedByNormalization = false;
|
|
326 |
if (attributes.isSpecified(i) && type != XMLSymbols.fCDATASymbol) {
|
|
327 |
changedByNormalization = normalizeAttrValue(attributes, i);
|
|
328 |
}
|
|
329 |
} // for all attributes
|
|
330 |
|
|
331 |
} // addDTDDefaultAttrsAndValidate(int,XMLAttrList)
|
|
332 |
|
|
333 |
|
|
334 |
/**
|
|
335 |
* Normalize the attribute value of a non CDATA attributes collapsing
|
|
336 |
* sequences of space characters (x20)
|
|
337 |
*
|
|
338 |
* @param attributes The list of attributes
|
|
339 |
* @param index The index of the attribute to normalize
|
|
340 |
*/
|
|
341 |
private boolean normalizeAttrValue(XMLAttributes attributes, int index) {
|
|
342 |
// vars
|
|
343 |
boolean leadingSpace = true;
|
|
344 |
boolean spaceStart = false;
|
|
345 |
boolean readingNonSpace = false;
|
|
346 |
int count = 0;
|
|
347 |
int eaten = 0;
|
|
348 |
String attrValue = attributes.getValue(index);
|
|
349 |
char[] attValue = new char[attrValue.length()];
|
|
350 |
|
|
351 |
fBuffer.setLength(0);
|
|
352 |
attrValue.getChars(0, attrValue.length(), attValue, 0);
|
|
353 |
for (int i = 0; i < attValue.length; i++) {
|
|
354 |
|
|
355 |
if (attValue[i] == ' ') {
|
|
356 |
|
|
357 |
// now the tricky part
|
|
358 |
if (readingNonSpace) {
|
|
359 |
spaceStart = true;
|
|
360 |
readingNonSpace = false;
|
|
361 |
}
|
|
362 |
|
|
363 |
if (spaceStart && !leadingSpace) {
|
|
364 |
spaceStart = false;
|
|
365 |
fBuffer.append(attValue[i]);
|
|
366 |
count++;
|
|
367 |
} else {
|
|
368 |
if (leadingSpace || !spaceStart) {
|
|
369 |
eaten++;
|
|
370 |
}
|
|
371 |
}
|
|
372 |
|
|
373 |
} else {
|
|
374 |
readingNonSpace = true;
|
|
375 |
spaceStart = false;
|
|
376 |
leadingSpace = false;
|
|
377 |
fBuffer.append(attValue[i]);
|
|
378 |
count++;
|
|
379 |
}
|
|
380 |
}
|
|
381 |
|
|
382 |
// check if the last appended character is a space.
|
|
383 |
if (count > 0 && fBuffer.charAt(count - 1) == ' ') {
|
|
384 |
fBuffer.setLength(count - 1);
|
|
385 |
|
|
386 |
}
|
|
387 |
String newValue = fBuffer.toString();
|
|
388 |
attributes.setValue(index, newValue);
|
|
389 |
return !attrValue.equals(newValue);
|
|
390 |
}
|
|
391 |
|
|
392 |
|
|
393 |
|
|
394 |
/** convert attribute type from ints to strings */
|
|
395 |
private String getAttributeTypeName(XMLAttributeDecl attrDecl) {
|
|
396 |
|
|
397 |
switch (attrDecl.simpleType.type) {
|
|
398 |
case XMLSimpleType.TYPE_ENTITY: {
|
|
399 |
return attrDecl.simpleType.list ? XMLSymbols.fENTITIESSymbol :
|
|
400 |
XMLSymbols.fENTITYSymbol;
|
|
401 |
}
|
|
402 |
case XMLSimpleType.TYPE_ENUMERATION: {
|
|
403 |
StringBuffer buffer = new StringBuffer();
|
|
404 |
buffer.append('(');
|
|
405 |
for (int i = 0; i < attrDecl.simpleType.enumeration.length; i++) {
|
|
406 |
if (i > 0) {
|
|
407 |
buffer.append("|");
|
|
408 |
}
|
|
409 |
buffer.append(attrDecl.simpleType.enumeration[i]);
|
|
410 |
}
|
|
411 |
buffer.append(')');
|
|
412 |
return fSymbolTable.addSymbol(buffer.toString());
|
|
413 |
}
|
|
414 |
case XMLSimpleType.TYPE_ID: {
|
|
415 |
return XMLSymbols.fIDSymbol;
|
|
416 |
}
|
|
417 |
case XMLSimpleType.TYPE_IDREF: {
|
|
418 |
return attrDecl.simpleType.list ? XMLSymbols.fIDREFSSymbol :
|
|
419 |
XMLSymbols.fIDREFSymbol;
|
|
420 |
}
|
|
421 |
case XMLSimpleType.TYPE_NMTOKEN: {
|
|
422 |
return attrDecl.simpleType.list ? XMLSymbols.fNMTOKENSSymbol :
|
|
423 |
XMLSymbols.fNMTOKENSymbol;
|
|
424 |
}
|
|
425 |
case XMLSimpleType.TYPE_NOTATION: {
|
|
426 |
return XMLSymbols.fNOTATIONSymbol;
|
|
427 |
}
|
|
428 |
}
|
|
429 |
return XMLSymbols.fCDATASymbol;
|
|
430 |
|
|
431 |
}
|
|
432 |
|
|
433 |
|
|
434 |
/** ensure element stack capacity */
|
|
435 |
private void ensureStackCapacity(int newElementDepth) {
|
|
436 |
if (newElementDepth == fElementContentState.length) {
|
|
437 |
boolean[] newStack = new boolean[newElementDepth * 2];
|
|
438 |
System.arraycopy(this.fElementContentState, 0, newStack, 0,
|
|
439 |
newElementDepth);
|
|
440 |
fElementContentState = newStack;
|
|
441 |
}
|
|
442 |
}
|
|
443 |
|
|
444 |
|
|
445 |
|
|
446 |
/** Handle element
|
|
447 |
* @return true if validator is removed from the pipeline
|
|
448 |
*/
|
|
449 |
protected void handleStartElement(QName element, XMLAttributes attributes) throws XNIException {
|
|
450 |
|
|
451 |
if (fDTDGrammar == null) {
|
|
452 |
fCurrentElementIndex = -1;
|
|
453 |
fCurrentContentSpecType = -1;
|
|
454 |
fInElementContent = false;
|
|
455 |
return;
|
|
456 |
} else {
|
|
457 |
fCurrentElementIndex = fDTDGrammar.getElementDeclIndex(element);
|
|
458 |
fCurrentContentSpecType = fDTDGrammar.getContentSpecType(
|
|
459 |
fCurrentElementIndex);
|
|
460 |
//handleDTDDefaultAttrs(element,attributes);
|
|
461 |
addDTDDefaultAttrs(element, attributes);
|
|
462 |
}
|
|
463 |
|
|
464 |
fInElementContent = fCurrentContentSpecType == XMLElementDecl.TYPE_CHILDREN;
|
|
465 |
fElementDepth++;
|
|
466 |
ensureStackCapacity(fElementDepth);
|
|
467 |
fElementContentState[fElementDepth] = fInElementContent;
|
|
468 |
}
|
|
469 |
|
|
470 |
|
|
471 |
/** Handle end element. */
|
|
472 |
protected void handleEndElement(QName element) throws XNIException {
|
|
473 |
if (fDTDGrammar == null) return;
|
|
474 |
fElementDepth--;
|
|
475 |
if (fElementDepth < -1) {
|
|
476 |
throw new RuntimeException("FWK008 Element stack underflow");
|
|
477 |
}
|
|
478 |
if (fElementDepth < 0) {
|
|
479 |
fCurrentElementIndex = -1;
|
|
480 |
fCurrentContentSpecType = -1;
|
|
481 |
fInElementContent = false;
|
|
482 |
return;
|
|
483 |
}
|
|
484 |
fInElementContent = fElementContentState[fElementDepth];
|
|
485 |
}
|
|
486 |
|
|
487 |
public boolean isInElementContent() {
|
|
488 |
return fInElementContent;
|
|
489 |
}
|
|
490 |
|
|
491 |
public boolean isIgnorableWhiteSpace(XMLString text) {
|
|
492 |
if (isInElementContent()) {
|
|
493 |
for (int i = text.offset; i < text.offset + text.length; i++) {
|
|
494 |
if (!XMLChar.isSpace(text.ch[i])) {
|
|
495 |
return false;
|
|
496 |
}
|
|
497 |
}
|
|
498 |
return true;
|
|
499 |
}
|
|
500 |
return false;
|
|
501 |
}
|
|
502 |
}
|