jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian Reschke (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-892) XML export (stream) doesn't initialize TransformerHandler properly
Date Sun, 29 Apr 2007 14:19:15 GMT

    [ https://issues.apache.org/jira/browse/JCR-892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492576
] 

Julian Reschke commented on JCR-892:
------------------------------------

Fixed in several places with revision 533508. I didn't want to touch contrib/backup/src/main/java/org/apache/jackrabbit/backup/WorkspaceBackup.java;
any takers for that?

> XML export (stream) doesn't initialize TransformerHandler properly
> ------------------------------------------------------------------
>
>                 Key: JCR-892
>                 URL: https://issues.apache.org/jira/browse/JCR-892
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: core
>            Reporter: Julian Reschke
>         Assigned To: Julian Reschke
>            Priority: Minor
>
> For instance, in SessionImpl.java:
>     public void exportSystemView(String absPath, OutputStream out,
>                                  boolean skipBinary, boolean noRecurse)
>             throws IOException, PathNotFoundException, RepositoryException {
>         SAXTransformerFactory stf = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
>         try {
>             TransformerHandler th = stf.newTransformerHandler();
>             th.setResult(new StreamResult(out));
>             th.getTransformer().setParameter(OutputKeys.METHOD, "xml");
>             th.getTransformer().setParameter(OutputKeys.ENCODING, "UTF-8");
>             th.getTransformer().setParameter(OutputKeys.INDENT, "no");
>             exportSystemView(absPath, th, skipBinary, noRecurse);
>         } catch (TransformerException te) {
>             throw new RepositoryException(te);
>         } catch (SAXException se) {
>             throw new RepositoryException(se);
>         }
>     }
> (1) It should be "setOutputProperty()", not "setParameter()",
> (2) My tests show that setting the parameters only has an effect when done before calling
setResult()
> That being said, the effect is minor, as the default settings for the TransformerHandler
seem to be correct anway.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message