This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 179335 - Netbeans doesn't format XML file
Summary: Netbeans doesn't format XML file
Status: RESOLVED DUPLICATE of bug 269073
Alias: None
Product: xml
Classification: Unclassified
Component: Text-Edit (show other bugs)
Version: 8.2
Hardware: PC Windows 8.1 x64
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-08 17:46 UTC by carmunoz
Modified: 2017-03-14 09:51 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
example POM.xml not formatted (6.25 KB, text/xml)
2017-02-05 13:44 UTC, tomaszk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description carmunoz 2010-01-08 17:46:50 UTC
When the user right-click in the editor window, and choose "Format" in the context menu, or using alt-shift-f, the XML content is not properly formated with new-line characters and tabs.

In netbeans 6.7.1, this works.

I'm using Sun JDK 6 update 14
Comment 1 fizista 2010-02-05 03:46:05 UTC
I confirm! It does not work.

Product Version: NetBeans IDE 6.8 (Build 200912041610)
Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01
System: Linux version 2.6.31.6-server-1mnb running on i386; UTF-8; pl_PL (nb)
Comment 2 Svata Dedic 2011-11-15 17:14:33 UTC
What do you mean by 'not properly formatted' ? The indentation for elements and/or attributes is wrong ? Or do you expect the IDE to break long (?) lines or place each Element on its own line ... ?

Thanks for clarification.
Comment 3 fizista 2011-11-15 17:33:05 UTC
<?xml version="1.0" encoding="UTF-8"?><root><a></a><b></b></root>

Format:

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <a></a>
    <b></b>
</root>

If I remember correctly, the result was this:

<?xml version="1.0" encoding="UTF-8"?>
<root>
<a></a>
<b></b>
</root>

or:

<?xml version="1.0" encoding="UTF-8"?><root><a></a><b></b></root>

In versions 7.01,6.9.1 the error no longer occurs.
Comment 4 tomaszk 2017-02-05 13:44:45 UTC
Created attachment 163572 [details]
example POM.xml not formatted
Comment 5 tomaszk 2017-02-05 13:46:56 UTC
The "Format" context item does not format the file at all.
Comment 6 Svata Dedic 2017-03-14 09:51:23 UTC
Example from comment #5 is a duplicate of #269073; however the cause is different from bugs described in previous comments.

Please open new bugs for new situations or different sample data. It is easier to duplicate them than to determine that a reopened report does not relate to the original :) Thanks.

*** This bug has been marked as a duplicate of bug 269073 ***