morgand 01/08/23 13:13:45
Modified: latka/src/java/org/apache/commons/latka/xml
XMLPreprocessor.java
Log:
remove XML comments during preprocessing, so that their variables are not
required at runtime
Revision Changes Path
1.7 +5 -0
jakarta-commons/latka/src/java/org/apache/commons/latka/xml/XMLPreprocessor.java
Index: XMLPreprocessor.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/xml/XMLPreprocessor.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XMLPreprocessor.java 2001/08/23 16:55:55 1.6
+++ XMLPreprocessor.java 2001/08/23 20:13:45 1.7
@@ -106,7 +106,12 @@
Properties props = LatkaProperties.getProperties();
try {
+
+ //remove anything commented out
+ RE removeComments = new RE("<!--.*?-->",RE.MATCH_SINGLELINE);
+ string = removeComments.subst(string,"");
+ // now, replace the remaining variables
RE r = new RE("\\$\\{(.*?)\\}"); // Compile expression
//scan the input string match by match, writing to the buffer