Page 1 of 1

using oxygen to re-order XML attributes

Posted: Mon Apr 19, 2010 1:07 pm
by esaruoho
hi, i'd love to be able to use oxygen to re-order XML attributes, like this:

<item id="x" name="o" url="oo" desc="aa">
so that this "id, name, url, desc" for instance could become "id, name, desc, url".. on every row. how would i go about doing this, please?

also, can i get specific, defunct, attributes removed automatically?

Re: using oxygen to re-order XML attributes

Posted: Mon Apr 19, 2010 2:18 pm
by Radu
Hi,

In the Oxygen Preferences->Editor / Format / XML page there is a checkbox called Sort attributes which can be used to alphabetically sort attributes for a certain element.
If you want your own order and all items are siblings you can pass to the Grid page where you will edit the items in a table view and you will be able to move or delete columns.

You can also use regular expressions in the Oxygen Find/Replace dialog with the Regular expression checkbox checked and the Dot matches all unchecked to perform the sorting like:
Text to find:
id="(.*)" name="(.*)" url="(.*)" desc="(.*)"
Text to replace:
id="$1" name="$2" desc="$4" url="$3"

You can also use regular expressions like:
id="(.*)"
to match and replace with nothing the attributes which are not used anymore.

Regards,
Radu