Community
Participate
Working Groups
Version: 3.3.1.1 Build id: M20071023-1652 WTP 2.0.1 The XML specificate allows for the attribute xml:space to be specified on an element. This signifies whether spacing is significant or not. http://www.simonstl.com/xmlprim/xmlupdate/atts.html "Section 2.10 of the XML Recommendation defines a new attribute that allows elements to declare to an application whether their white space is 'significant'. This will probably receive extensive use in combination with XSL or perhaps the CSS white-space property to display documents correctly. Validating processors already must pass all non-markup characters to the application, and inform them of the element in which they appeared. This attribute acts as a flag, telling the application whether or not it should pay attention to the white space characters." If the XML formatter currently doesn't check for this, it should as it allows a simple standard way for a user to control whether a particular element should be reformatted or not.
This should already be working. It was fixed in bug 111674. please feel free to reopen if you find a specific scenario where this is not working. *** This bug has been marked as a duplicate of bug 111674 ***
Re-Openning as it isn't behaving exactly as expected. Sample to be attached to be used for testing.
Created attachment 86439 [details] Sample with Preserve space that doesn't format as expected The second programminglisting element after the first programmlisting element is not formatting as expected. The sibling elements do not not contain an xml:space preserve element. xml:space is supposed to affect the parent element and any child elements. It doesn't affect siblings or ancestor elements.
changed to normal priority since this feature was already implemented in prior bug, just needs some tweaking for this use case.
Reassigning to Nick
Created attachment 87566 [details] Patch for Bug 214516 This patch addresses Bug 214516 by formatting elements with the xml:space="preserve" attribute.
Created attachment 87699 [details] org.eclipse.wst.xml.core.tests.patch Hi Nick, I tested your patch, and I think there's still a lingering issue with child tags not respecting the parent's xml:space attribute. The unit tests didn't have the correct results, so I think if you ran them, everything would've looked okay when it really wasn't. I've attached a patch so that the unit tests had a more correct result.
Created attachment 87800 [details] Patch to DefaultXMLPartitionFormatter and expected test result Should resolve the problems related to children disregarding inherited space preservation. Also updated the expected results of the xml-space-preserve-dtd-newfmt.xml. This patch also contains a modification related to Bug 195264. It should have no impact on this bug.
Created attachment 87803 [details] Patch for Bug 214516 as patch and not zip Accidentally attached the patch in a zip file. This is the correct patch.
Created attachment 88227 [details] xml-space-preserve-standalone-newfmt.xml.patch I made some changes to xml.core.tests for bug 198297 that overlapped with the changes for this bug. So here's an updated patch on just one file. So to fix this bug, you just need to apply this patch as well as Nick's.
Released Nick's fix for this week's WTP 3.0 M5 ibuild.
verified in wtp 3.0 m5 20080211073521
mass change to add 'contributed' keyword based on bugzilla query, please correct if that's not accurate (by marking patches as obsolete and removing the 'contributed' keyword.