I guess default values would be
boolean _indenting= false;
int _indent= 0;
The only thing is that there might be existing applications where somebody
may have used setIndent(2) whout calling setIndenting(true).
Vlad
Gunnlaugur Thor Briem <[EMAIL PROTECTED]> on 07/24/2001 11:23:01 AM
Please respond to xerces-j-dev <[EMAIL PROTECTED]>
To: xerces-j-dev <[EMAIL PROTECTED]>
cc:
Subject: RE: Format control in XMLSerializer
Hi,
The "Indenting" property refers to the indent="true"
or indent="false" attribute in xsl:output, as covered
by Sec. 16.1 of the XSLT specification:
http://www.w3.org/TR/xslt#section-XML-Output-Method
whereas the "Indent" (size) property is an option
specific to the Xerces implementation. So I guess
it's just up to the Xerces team to decide what is
to be done in this case -- it's not a conformance
issue, since the indent size is not covered by any
specification that I know of.
My suggestion: when indent size is 3, Xerces outputs
a linefeed and 3 spaces. When it's 2, Xerces outputs
a linefeed and 2 spaces. When it's 0, then, the
consistent thing to do is to emit a linefeed and
zero spaces. Does that make sense?
In that spirit I suggest that the OutputFormat should
store a boolean for Indenting, separate from the int
for the indent size, and the method getIndenting()
should just return the boolean. The whitespace to add
is then simply a linefeed followed by _indent spaces.
That way, Vlad, your format would be obtained by
setIndenting(true) and setIndent(0).
Any cents in addition to these two? :)
- Gulli
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 24. juli 2001 14:55
To: xerces-j-dev
Subject: RE: Format control in XMLSerializer
Is the following valid for setting XML output format:
format.setIndenting(true);
format.setIndent(0);
I can see where and why it could have been used by me and other developers,
but I don't know if this is correct from the DOM/XML standard point of
view.
Right now if I set indent the way described above the output produced is:
<root><element1>test1</element1><element2>test2</element2></root>
If we slightly change org.apache.xml.serialize.OutputFormat.getIndenting()
method from
return ( _indent = 0 );
to
return ( _indent >= 0 );
XML output will be:
<root>
<element1>test1</element1>
<element2>test2</element2>
</root>
Which one is correct?
---------------------------------------------------------------------
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]