Closed GoogleCodeExporter closed 9 years ago
This makes sense. It seems that putting the closing angular bracket on a
separate line is even better for merging though? I.e.
<foo
attr1='value1'
attr2='value2'
>
This makes adding/removing attributes merge friendly.
Original comment by arseny.k...@gmail.com
on 6 Oct 2014 at 1:29
Yes, agree.
For me it is more usual to keep indentation for closing bracket.
<foo
attr1='value1'
attr2='value2'
>
<subobject />
</foo>
or
<foo
attr1='value1'
attr2='value2'
/>
(notepads like Sublime Text supports indentation in that style out of the box)
I think it is not very important, the decision is yours.
Original comment by AKhar...@gmail.com
on 6 Oct 2014 at 6:01
Hi!
Last day I think twice about xml formatting and it seems that formatting like
<some
int="5"
bool="false"
string="value" />
<some
int="5"
bool="false"
string="value">
<subobject />
</some>
is more than appropriate.
Pros:
- less lines of xml and more readable
- Visual Studio IDE has formatting options for xml with this style for closing
bracket
- implementation is simple (like in original post's patch)
So, I think it make sense to support two additional formats:
- format_each_attribute_on_new_line
- format_closing_bracket_on_new_line
format_closing_bracket_on_new_line is applied only when format_indent and
format_each_attribute_on_new_line is enabled.
For convinience:
format_indent_attribute = format_indent | format_each_attribute_on_new_line
format_indent_full = format_indent | format_each_attribute_on_new_line |
format_closing_bracket_on_new_line
can be added to pugixml.hpp
I implemented this behavior, see implementation patch in attachments.
I tested formatting with format_indent_full flag a little bit.
My opinion that format_indent_attribute is looking better :)
Best regards, Aleksei.
Original comment by AKhar...@gmail.com
on 7 Oct 2014 at 10:17
Attachments:
Moving the issue to GitHub: https://github.com/zeux/pugixml/issues/14
Original comment by arseny.k...@gmail.com
on 26 Oct 2014 at 8:56
Original issue reported on code.google.com by
AKhar...@gmail.com
on 5 Oct 2014 at 7:01Attachments: