182 * non-normalized value. |
182 * non-normalized value. |
183 * @param atName The name of the attribute being parsed (for error msgs). |
183 * @param atName The name of the attribute being parsed (for error msgs). |
184 * @param checkEntities true if undeclared entities should be reported as VC violation, |
184 * @param checkEntities true if undeclared entities should be reported as VC violation, |
185 * false if undeclared entities should be reported as WFC violation. |
185 * false if undeclared entities should be reported as WFC violation. |
186 * @param eleName The name of element to which this attribute belongs. |
186 * @param eleName The name of element to which this attribute belongs. |
|
187 * @param isNSURI The flag indicating whether the content is a namespace URI |
187 * |
188 * |
188 * @return true if the non-normalized and normalized value are the same |
189 * @return true if the non-normalized and normalized value are the same |
189 * |
190 * |
190 * <strong>Note:</strong> This method uses fStringBuffer2, anything in it |
191 * <strong>Note:</strong> This method uses fStringBuffer2, anything in it |
191 * at the time of calling is lost. |
192 * at the time of calling is lost. |
192 **/ |
193 **/ |
193 protected boolean scanAttributeValue(XMLString value, |
194 protected boolean scanAttributeValue(XMLString value, |
194 XMLString nonNormalizedValue, |
195 XMLString nonNormalizedValue, |
195 String atName, |
196 String atName, |
196 boolean checkEntities,String eleName) |
197 boolean checkEntities,String eleName, boolean isNSURI) |
197 throws IOException, XNIException |
198 throws IOException, XNIException |
198 { |
199 { |
199 // quote |
200 // quote |
200 int quote = fEntityScanner.peekChar(); |
201 int quote = fEntityScanner.peekChar(); |
201 if (quote != '\'' && quote != '"') { |
202 if (quote != '\'' && quote != '"') { |
203 } |
204 } |
204 |
205 |
205 fEntityScanner.scanChar(); |
206 fEntityScanner.scanChar(); |
206 int entityDepth = fEntityDepth; |
207 int entityDepth = fEntityDepth; |
207 |
208 |
208 int c = fEntityScanner.scanLiteral(quote, value); |
209 int c = fEntityScanner.scanLiteral(quote, value, isNSURI); |
209 if (DEBUG_ATTR_NORMALIZATION) { |
210 if (DEBUG_ATTR_NORMALIZATION) { |
210 System.out.println("** scanLiteral -> \"" |
211 System.out.println("** scanLiteral -> \"" |
211 + value.toString() + "\""); |
212 + value.toString() + "\""); |
212 } |
213 } |
213 |
214 |
385 fEntityScanner.scanChar(); |
386 fEntityScanner.scanChar(); |
386 if (entityDepth == fEntityDepth) { |
387 if (entityDepth == fEntityDepth) { |
387 fStringBuffer2.append((char)c); |
388 fStringBuffer2.append((char)c); |
388 } |
389 } |
389 } |
390 } |
390 c = fEntityScanner.scanLiteral(quote, value); |
391 c = fEntityScanner.scanLiteral(quote, value, isNSURI); |
391 if (entityDepth == fEntityDepth) { |
392 if (entityDepth == fEntityDepth) { |
392 fStringBuffer2.append(value); |
393 fStringBuffer2.append(value); |
393 } |
394 } |
394 normalizeWhitespace(value); |
395 normalizeWhitespace(value); |
395 } while (c != quote || entityDepth != fEntityDepth); |
396 } while (c != quote || entityDepth != fEntityDepth); |