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 148511

Summary: Formatting an XML document leads to validation failures
Product: xml Reporter: Rohan Ranade <rohanranade>
Component: CodeAssignee: Samaresh Panda <samaresh>
Status: VERIFIED FIXED    
Severity: blocker CC: michaelnazarov, tonybeckham
Priority: P1    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: prior to formatting the document
validation after formatting the document
Schema
Included schema

Description Rohan Ranade 2008-09-26 19:14:18 UTC
Users of our product create and edit many huge XML documents in NetBeans using our set of NetBeans plugins. These
documents are then checked into our product for processing. (https://wikis.sun.com/display/SPS/SPS+Modeler). When these
documents are formatted in NetBeans 6.1 and then XML validation is run on them, the validation fails (since formatting
places the end tag on a new line). Consequently these documents are not accepted by our product for checking in. 

The attached screen shots show the scenarios.
Request to fix this in 6.1 patch4 as this is a show stopper for users of our product. Manually reformatting is not an
option since the documents are generally very huge.
Comment 1 Rohan Ranade 2008-09-26 19:17:01 UTC
Created attachment 70692 [details]
prior to formatting the document
Comment 2 Rohan Ranade 2008-09-26 19:18:54 UTC
Created attachment 70693 [details]
validation after formatting the document
Comment 3 Samaresh Panda 2008-09-26 20:02:30 UTC
The formatted doc is technically same as prior. There is simply white spaces between <var> and </var>, unless your
schema feels otherwise. Seems like the schema needs a fix. Can you pl. attach the schema?
Comment 4 Rohan Ranade 2008-09-26 20:08:50 UTC
Created attachment 70697 [details]
Schema
Comment 5 Rohan Ranade 2008-09-26 20:09:39 UTC
Created attachment 70698 [details]
Included schema
Comment 6 Rohan Ranade 2008-09-26 20:12:16 UTC
A couple of points worth noting:
1. I have tried out the same thing in the latest 6.5 nightly, and there end tags stay on the same line even after reformat. 
2. This happens even for Spring configuration files. (use the <import> tag)
Comment 7 Samaresh Panda 2008-09-26 21:27:39 UTC
Seems like a valid bug. Since the fix is already available in 6.5, I'm marking this as fixed.

Tony, Misha, please verify the same and add the status whiteboard for patch4 (I guess "61fixes4-candidate").

Now for patching (whoever does that) I suggest you copy all the content of XMLLexerFormatter.java (in xml.text module)
into the branch.
Comment 8 tonybeckham 2008-10-10 22:26:29 UTC
Verified that there is no problem like this in 6.5 builds

Product Version: NetBeans IDE Dev (Build 200810080201)
Java: 1.6.0_07; Java HotSpot(TM) 64-Bit Server VM 1.6.0_07-b06-57
System: Mac OS X version 10.5.5 running on x86_64; MacRoman; en_US (nb)
Comment 9 Rohan Ranade 2008-10-16 19:35:32 UTC
Looks like the patch4 for 6.1 is out and this issue hasn't made it inspite of a specific indication from Samaresh here
that it should be added to the patch. I would like to know why. NetBeans 6.5 FCS is still some time away and my
customers can't use 6.1 with this issue present.
Comment 10 Samaresh Panda 2008-10-16 19:59:50 UTC
This is bad news, but since this was a really important issue for you, IMHO, you could have done a better job in
following it up. Talk to sustaining and see what the next course of action is.
Comment 11 Rohan Ranade 2008-10-16 20:31:55 UTC
Thanks Samaresh for your suggestion. I will take this up with sustaining. 

Although I don't understand what more is needed after reporting the issue and getting the word from the module owner
himself that this should be added to the patch (see desc8). If it was decided later for a reason that this one wont make
it to the patch, why isn't the reason mentioned here? Someone else needs to do better follow up.