You are viewing a plain text version of this content. The canonical link for it is here.
Posted to crimson-cvs@xml.apache.org by ed...@apache.org on 2001/07/12 20:18:46 UTC
cvs commit: xml-crimson/src/org/apache/crimson/parser Parser2.java
edwingo 01/07/12 11:18:45
Modified: src/org/apache/crimson/parser Parser2.java
Log:
Applied patch for "4479163 Parser should not expand parameter entities in
attribute value literals" submitted by Anli Shundi.
Revision Changes Path
1.12 +10 -8 xml-crimson/src/org/apache/crimson/parser/Parser2.java
Index: Parser2.java
===================================================================
RCS file: /home/cvs/xml-crimson/src/org/apache/crimson/parser/Parser2.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Parser2.java 2001/06/15 01:57:54 1.11
+++ Parser2.java 2001/07/12 18:18:40 1.12
@@ -1,5 +1,5 @@
/*
- * $Id: Parser2.java,v 1.11 2001/06/15 01:57:54 edwingo Exp $
+ * $Id: Parser2.java,v 1.12 2001/07/12 18:18:40 edwingo Exp $
*
* The Apache Software License, Version 1.1
*
@@ -119,7 +119,7 @@
* @author David Brownell
* @author Rajiv Mordani
* @author Edwin Goei
- * @version $Revision: 1.11 $
+ * @version $Revision: 1.12 $
*/
public class Parser2
{
@@ -679,6 +679,13 @@
// [10] AttValue ::=
// '"' ([^"&] | Reference )* '"'
// | "'" ([^'&] | Reference )* "'"
+
+ // Only expand PEs in getc() when processing entity value literals
+ // and do not expand when processing AttValue. Save state of
+ // doLexicalPE and restore it before returning.
+ boolean savedLexicalPE = doLexicalPE;
+ doLexicalPE = isEntityValue;
+
char quote = getc ();
char c;
InputEntity source = in;
@@ -776,6 +783,7 @@
}
isInAttribute = false;
+ doLexicalPE = savedLexicalPE;
}
// does a SINGLE expansion of the entity (often reparsed later)
@@ -1157,12 +1165,6 @@
// params are no good to anyone starting now -- bye!
params.clear ();
-
- // Done processing DTD so we will never be expanding any more PE
- // refs. This fixes bug where doc containing internal subset
- // containing a EntityDecl causes incorrect attribute processing
- // outside the DTD.
- doLexicalPE = false;
lexicalHandler.endDTD();
---------------------------------------------------------------------
To unsubscribe, e-mail: crimson-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: crimson-cvs-help@xml.apache.org