W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2003

Clarification needed regarding default value of newLine in DOMSerializer of DOM L3 LS spec

From: Ramesh Babu Mandava <Ramesh.Mandava@Sun.COM>
Date: Thu, 06 Nov 2003 14:06:30 -0800
To: www-dom@w3.org, plh@w3.org
Cc: Ramesh.Mandava@Sun.COM
Message-id: <a9cebe67.be67a9ce@ha21sca-mail1.sfbay.sun.com>

 Java binding of DOM L3 LS at


contain unclear javadoc for getNewLine and setNewLine methods of DOMSerializer class. 

 From the javadoc it is not clear that what should getNewLine return in case setNewLine is not called before ( default value ). Whether "null" should be returned or the "platform default end-of-line sequence"? 
 The javadoc for setNewLine is exactly same as getNewLine?
 There is need for changing the javadoc for getNewLine and setNewLine and make it different to define specific purpose of each method.
 Whether the intention is that when "null" value is
passed to setNewLine, then the end-of-line sequence   
 need to be defaulted to platform specific one? And
 getNewLine should never return "null"

 Here is snippet of javadoc for getNewLine/setNewLine.

     *  The end-of-line sequence of characters to be used in the XML being
     * written out. Any string is supported, but these are the recommended
     * end-of-line sequences (using other character sequences than these
     * recommended ones can result in a document that is either not
     * serializable or not well-formed):
     * <dl>
     * <dt><code>null</code></dt>
     * <dd> Use a default
     * end-of-line sequence. DOM implementations should choose the default
     * to match the usual convention for text files in the environment being
     * used. Implementations must choose a default sequence that matches one
     * of those allowed by section 2.11, "End-of-Line Handling" in [<a href='http://www.w3.org/TR/2000/REC-xml-200010
06'>XML 1.0</a>], if the
     * serialized content is XML 1.0 or section 2.11, "End-of-Line Handling"
     * in [<a href='http://www.w3.org/TR/2002/CR-xml11-20021015/'>XML 1.1</a>], if the
     * serialized content is XML 1.1. </dd>
     * <dt>CR</dt>
     * <dd>The carriage-return character (#xD).</dd>
     * <dt>
     * CR-LF</dt>
     * <dd> The carriage-return and line-feed characters (#xD #xA). </dd>
     * <dt>LF</dt>
     * <dd> The
     * line-feed character (#xA). </dd>
     * </dl>
     * <br>The default value for this attribute is <code>null</code>.
    public String getNewLine();


Received on Thursday, 6 November 2003 17:09:58 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:11 UTC