zongaro 2003/08/26 14:33:17
Modified: java/src/org/apache/xalan/processor
TransformerFactoryImpl.java
Log:
Removed static method which was reading XSLTInfo.properties file and setting
a system property for each property in the file. That code was not appropriate
in a secure environment, and wasn't actually needed. Three of the properties
were being set in support of the XSLT system-property function, but the
implementation of that function didn't actually access the values from the
system properties; the fourth was org.xml.sax.driver, which should be provided
by the user's application or by the parser in a
META-INF/services/org.xml.sax.driver file.
Reviewed with Christine Li ([EMAIL PROTECTED]).
Revision Changes Path
1.54 +12 -55
xml-xalan/java/src/org/apache/xalan/processor/TransformerFactoryImpl.java
Index: TransformerFactoryImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/TransformerFactoryImpl.java,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- TransformerFactoryImpl.java 14 Aug 2003 16:27:43 -0000 1.53
+++ TransformerFactoryImpl.java 26 Aug 2003 21:33:17 -0000 1.54
@@ -85,6 +85,7 @@
import org.apache.xalan.transformer.TransformerIdentityImpl;
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xalan.transformer.XalanProperties;
+
import org.apache.xml.dtm.ref.sax2dtm.SAX2DTM;
import org.apache.xml.utils.DefaultErrorHandler;
import org.apache.xml.utils.SystemIDResolver;
@@ -107,7 +108,8 @@
/**
* The path/filename of the property file: XSLTInfo.properties
- * Maintenance note: see also
org.apache.xpath.functions.FuncSystemProperty.XSLT_PROPERTIES
+ * Maintenance note: see also
+ * <code>org.apache.xpath.functions.FuncSystemProperty.XSLT_PROPERTIES</code>
*/
public static final String XSLT_PROPERTIES =
"org/apache/xalan/res/XSLTInfo.properties";
@@ -121,63 +123,16 @@
}
/** Static string to be used for incremental feature */
- public static final String FEATURE_INCREMENTAL =
"http://xml.apache.org/xalan/features/incremental";
+ public static final String FEATURE_INCREMENTAL =
+ "http://xml.apache.org/xalan/features/incremental";
/** Static string to be used for optimize feature */
- public static final String FEATURE_OPTIMIZE =
"http://xml.apache.org/xalan/features/optimize";
+ public static final String FEATURE_OPTIMIZE =
+ "http://xml.apache.org/xalan/features/optimize";
/** Static string to be used for source_location feature */
- public static final String FEATURE_SOURCE_LOCATION =
XalanProperties.SOURCE_LOCATION;
-
- /**
- * Retrieve a propery bundle from XSLT_PROPERTIES and load it
- * into the System properties.
- * Maintenance Note: Consider this to be removed. Setting system properties
- * from a library might have undesirable side effects and should be avoided.
- */
- static
- {
- try
- {
- InputStream is = null;
-
- try
- {
- Properties props = new Properties();
-
- is = TransformerFactoryImpl.class.getResourceAsStream("/" +
XSLT_PROPERTIES);
-
- // get a buffered version
- BufferedInputStream bis = new BufferedInputStream(is);
-
- props.load(bis); // and load up the property bag from this
- bis.close(); // close out after reading
-
- // OK, now we only want to set system properties that
- // are not already set.
- Properties systemProps = System.getProperties();
- Enumeration propEnum = props.propertyNames();
-
- while (propEnum.hasMoreElements())
- {
- String prop = (String) propEnum.nextElement();
-
- if (!systemProps.containsKey(prop))
- systemProps.put(prop, props.getProperty(prop));
- }
-
- System.setProperties(systemProps);
-
- }
- catch (Exception ex){}
- }
- catch (SecurityException se)
- {
-
- // In this case the caller is required to have
- // the needed attributes already defined.
- }
- }
+ public static final String FEATURE_SOURCE_LOCATION =
+ XalanProperties.SOURCE_LOCATION;
public javax.xml.transform.Templates processFromNode(Node node)
throws TransformerConfigurationException
@@ -186,7 +141,9 @@
try
{
TemplatesHandler builder = newTemplatesHandler();
- TreeWalker walker = new TreeWalker(builder, new
org.apache.xml.utils.DOM2Helper(), builder.getSystemId());
+ TreeWalker walker = new TreeWalker(builder,
+ new org.apache.xml.utils.DOM2Helper(),
+ builder.getSystemId());
walker.traverse(node);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]