Rahul Akolkar wrote:
>On 4/9/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>>Author: oheger
>>Date: Sun Apr 9 10:30:37 2006
>>New Revision: 392787
>>
>>URL: http://svn.apache.org/viewcvs?rev=392787&view=rev
>>Log:
>>XMLConfiguration now keeps the public and system ID of the DOCTYPE
>>declaration; fix for issue 39227
>>
>>Modified:
>>
>> jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/XMLConfiguration.java
>>
>>
><snip/>
>
>
>> /**
>>+ * Creates and initializes the transformer used for save operations. This
>>+ * base implementation initializes all of the default settings like
>>+ * indention mode and the DOCTYPE. Derived classes may overload this
>>method
>>+ * if they have specific needs.
>>+ *
>>+ * @return the transformer to use for a save operation
>>+ * @throws TransformerException if an error occurs
>>+ * @since 1.3
>>+ */
>>+ protected Transformer createTransformer() throws TransformerException
>>+ {
>>+ Transformer transformer = TransformerFactory.newInstance()
>>+ .newTransformer();
>>+
>>
>>
><snap/>
>
>Maybe catch TransformerFactoryConfigurationError here? (if only to log
>and/or rethrow as some TransformerException, since its unlikely that
>client code will watch out for it)
>
>-Rahul
>
>
You mean to avoid that an application dies with an error? Good point.
But then I would rather catch it in the calling save() method. This is
probably safer if somebody overrides the createTransformer() method.
Thanks for the spot!
Oliver
>
>
>
>>+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
>>+ if (getEncoding() != null)
>>+ {
>>+ transformer.setOutputProperty(OutputKeys.ENCODING,
>>getEncoding());
>>+ }
>>+ if (getPublicID() != null)
>>+ {
>>+ transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC,
>>+ getPublicID());
>>+ }
>>+ if (getSystemID() != null)
>>+ {
>>+ transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM,
>>+ getSystemID());
>>+ }
>>+
>>+ return transformer;
>>+ }
>>
>>
><snip/>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]