neilg 2003/02/10 07:14:52
Modified: java/src/org/apache/xerces/impl XMLScanner.java
Log:
if the file containing the replacement text for an external parameter entity
contained a text decl, the parser would go into an infinite loop; fixed.
Revision Changes Path
1.25 +14 -1 xml-xerces/java/src/org/apache/xerces/impl/XMLScanner.java
Index: XMLScanner.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLScanner.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- XMLScanner.java 9 Dec 2002 18:51:29 -0000 1.24
+++ XMLScanner.java 10 Feb 2003 15:14:51 -0000 1.25
@@ -374,6 +374,16 @@
boolean dataFoundForTarget = false;
boolean sawSpace = fEntityScanner.skipSpaces();
+ // since pseudoattributes are *not* attributes,
+ // their quotes don't need to be preserved in external parameter entities.
+ // the XMLEntityScanner#scanLiteral method will continue to
+ // emit -1 in such cases when it finds a quote; this is
+ // fine for other methods that parse scanned entities,
+ // but not for the scanning of pseudoattributes. So,
+ // temporarily, we must mark the current entity as not being "literal"
+ XMLEntityManager.ScannedEntity currEnt = fEntityManager.getCurrentEntity();
+ boolean currLiteral = currEnt.literal;
+ currEnt.literal = false;
while (fEntityScanner.peekChar() != '?') {
dataFoundForTarget = true;
String name = scanPseudoAttribute(scanningTextDecl, fString);
@@ -468,6 +478,9 @@
}
sawSpace = fEntityScanner.skipSpaces();
}
+ // restore original literal value
+ if(currLiteral)
+ currEnt.literal = true;
// REVISIT: should we remove this error reporting?
if (scanningTextDecl && state != STATE_DONE) {
reportFatalError("MorePseudoAttributes", null);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]