Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: configurable transformer factory #862

Merged
merged 5 commits into from
May 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
*/
public class XSLTResourceStream extends AbstractResourceStream
{
/**
*
*/
private static final long serialVersionUID = 1L;
private final transient ByteArrayOutputStream out;

Expand Down Expand Up @@ -77,7 +74,7 @@ public XSLTResourceStream(final IResourceStream xsltResource, final IResourceStr
javax.xml.transform.Result result = new javax.xml.transform.stream.StreamResult(out);

// create an instance of TransformerFactory
javax.xml.transform.TransformerFactory transFact = javax.xml.transform.TransformerFactory.newInstance();
javax.xml.transform.TransformerFactory transFact = getTransformerFactory();

javax.xml.transform.Transformer trans = transFact.newTransformer(xsltSource);
Map<Object, Object> parameters = getParameters();
Expand All @@ -102,6 +99,16 @@ public XSLTResourceStream(final IResourceStream xsltResource, final IResourceStr
}
}

/**
* Used to provide a configured {@link javax.xml.transform.TransformerFactory}.
*
* @return the transformer factory
*/
protected javax.xml.transform.TransformerFactory getTransformerFactory()
{
return javax.xml.transform.TransformerFactory.newInstance();
}

/**
* @see org.apache.wicket.util.resource.IResourceStream#close()
*/
Expand Down