-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lukas Jungmann <[email protected]>
- Loading branch information
Showing
1 changed file
with
13 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ | |
import com.sun.xml.messaging.saaj.util.XMLDeclarationParser; | ||
import com.sun.xml.messaging.saaj.util.FastInfosetReflection; | ||
import java.net.URI; | ||
import java.util.concurrent.atomic.AtomicBoolean; | ||
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
import javax.xml.transform.Transformer; | ||
|
@@ -49,10 +50,10 @@ | |
* @author [email protected] | ||
* | ||
*/ | ||
public class EfficientStreamingTransformer | ||
extends javax.xml.transform.Transformer { | ||
public class EfficientStreamingTransformer extends Transformer { | ||
|
||
private static final Logger LOGGER = Logger.getLogger(LogDomainConstants.SOAP_DOMAIN, "com.sun.xml.messaging.saaj.soap.LocalStrings"); | ||
private static final AtomicBoolean LOG = new AtomicBoolean(true); | ||
|
||
//static final String version; | ||
//static final String vendor; | ||
|
@@ -75,22 +76,29 @@ public class EfficientStreamingTransformer | |
private Object m_fiDOMDocumentSerializer = null; | ||
|
||
private EfficientStreamingTransformer() { | ||
boolean log = LOG.compareAndSet(true, false); | ||
TransformerFactory tf = TransformerFactory.newInstance(); | ||
try { | ||
tf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); | ||
} catch (TransformerConfigurationException e) { | ||
LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support secure xml processing!", new Object[] { tf.getClass().getName() } ); | ||
if (log) { | ||
LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support secure xml processing!", new Object[]{tf.getClass().getName()}); | ||
} | ||
} | ||
//ie xalan, as of 2.7.2, does not support these | ||
try { | ||
tf.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); | ||
} catch (IllegalArgumentException e) { | ||
LOGGER.log(Level.FINE, "Factory [{0}] doesn't support accessExternalDTD property", new Object[] { tf.getClass().getName() } ); | ||
if (log) { | ||
LOGGER.log(Level.FINE, "Factory [{0}] doesn't support accessExternalDTD property", new Object[]{tf.getClass().getName()}); | ||
} | ||
} | ||
try { | ||
tf.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); | ||
} catch (IllegalArgumentException e) { | ||
LOGGER.log(Level.FINE, "Factory [{0}] doesn't support accessExternalStylesheet property", new Object[] { tf.getClass().getName() } ); | ||
if (log) { | ||
LOGGER.log(Level.FINE, "Factory [{0}] doesn't support accessExternalStylesheet property", new Object[]{tf.getClass().getName()}); | ||
} | ||
} | ||
transformerFactory = tf; | ||
} | ||
|