History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEABKL-811
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Olesya Smirnova
Reporter: Maxim Shafirov
Votes: 0
Watchers: 0
Available Workflow Actions

Mark as Stalled
Operations

If you were logged in you would be able to see more operations.
IDEA: Backlog

Add separate formatting properties for XML documents

Created: 07 Feb 05 19:26   Updated: 10 Nov 06 10:07
Component/s: Code Formatting and Code Style
Affects Version/s: None
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
http://www.intellij.net/tracker/idea/viewSCR?publicId=12597
I like to have my XML and Java code to have different indentation levels. For Java I like to have four (4) spaces at each indentation level. It works because Java usually doesn't go beyond a certain number of indentations. XML, on the other hand, can nest much more deeply than Java. Because of that I like to have two (2) spaces at each indentation. It keeps the XML readable, and minimizes the chance of wrapping.

For XML formatting, things I would like to see are these:

Indentation Style: Tabs or Spaces
Indentation Depth: number of spaces
Align Attributes When Wrapped: check box
Indent Free Text: check box
Collapse Elements: check box

The three check boxes would treat XML code like this:

Align Attributes When Wrapped: No

[pre]
<big-long-element with="lot's of attributes" and="another"
foo="bar"/>
[/pre]

Align Attributes When Wrapped: Yes

[pre]
<big-long-element with="lot's of attributes" and="another"
foo="bar"/>
[/pre]

Indent Free Text: No

[pre]
<element>
<child>
This is my free text that is a child of the child element.
</child>
<child>
<![CDATA[
This is CDATA encapsulated text.
Spacing is important, so it should never be
reformatted.
]]>
</child>
</element>
[/pre]

Indent Free Text: Yes

[pre]
<element>
<child>
This is my free text that is a child of the child
element.
</child>
<child>
<![CDATA[
This is CDATA encapsulated text.
Spacing is important, so it should never be
reformatted.
]]>
</child>
</element>
[/pre]

Collapse Elements: No

[pre]
<ol>
<li>
This is some long text that will wrap lines. It will
never be collapsed.
</li>
<li>
Collapsable short text
</li>
</ol>
[/pre]

Collapse Elements: Yes

[pre]
<ol>
<li>
This is some long text that will wrap lines. It will
never be collapsed.
</li>
<li>Collapsable short text</li>
</ol>
[/pre]

I am shure there are other options for XML formatting, but that is my short list.



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.