Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sapphire-dev] XmlElement move() vs swap() question

Hey Sapphire team,

I've noticed a slight change on how the whitespace around child elements is maintained with current version of Sapphire versus previous versions of StandardXmlListBindingImpl.  Take the following snippet:

<display>
<category name="category.sample">
<portlet id="test1" />
<portlet id="test2" />
</category>
</display>

And in my sapphire editor, I have a list property that is listing the <portlet /> elements and lets users move them up or down:

Inline image 1

In previous version of StandardXmlListBindingImpl.move() this is how the source would look like after pressing down arrow:

<display>
<category name="category.sample">
<portlet id="test2" />
<portlet id="test1" />
</category>
</display>

Now in the latest version of the binding impl, the move() has been reimplimented a bit and now it yields the following results:

<display>
<category name="category.sample">
<portlet id="test2" /><portlet id="test1" />
</category>
</display>

I took a look at the implementation and I noticed that XmlElement has a move() and a swap() after reading the comments on swap() I just changed line 247 to call swap() on XmlElement instead of move().  Doing this and now I see the source whitespace is preserved like it was in the previous version.

I didn't want to open a ticket until I asked a question here to see what else may be going on here with these methods.

I appreciate any efforts on this.

Thanks.

--
Greg Amerson
Liferay, Inc.
www.liferay.com
---
17 May 2012 | Liferay Budapest Symposium | liferay.com/budapest2012
23 May 2012 | Liferay France Symposium | liferay.com/france2012


Back to the top