XML strings sort alphabetically



Greeting. Been searching tool that can sort xml strings in strings.xml correctly but seems can't find good one. Strings example:



<resources>
<string name="act_exit">Exit</string>
<string name="act_exit_info">"Are you sure you want to exit?
Click OK to continue"</string>
<string name="act_continue">Continue</string>
<string name="act_stop">Stop</string>
<string name="act_start formatted="false">Start</string>
<string name="act_stop">Stop</string>
<string name="male">&lt;font color=#f57130>Male&lt;/font></string>
<string name="female">&lt;font color=#f57130>Female&lt;/font></string>
</resources>


Basically, I need good and fast way to sort string names for such xml file. I've tried Android Tools and plugins for it, but most of them just bugs the file, it sorts all strings and adds text that start with new line in the end. "Click OK to continue" this part of text appears just in the end of file.


The only working tool I've found is http://ift.tt/1w9oqE4 which works with Saxon jar. It does job flawlessly except when you have strings options like "formatted="false" and "<font color=#f57130>TEXT</font>". Those options are needed for project so can't remove them.


XML Sorter log on file containing such options:



Sorting the XML file . . . Error on line 7 of sort.xslt: XTTE1020: A sequence of more than one item is not allowed as the @select attri bute of xsl:sort in built-in template rule Transformation failed: Run-time errors were reported


Oops! An error occurred, errorlevel=2. Contact the author for help.



No comments:

Post a Comment