roana0229 / android-xml-sorter

Android Studio & IntelliJ Plugin for sort xml by name="xxx".
Apache License 2.0
103 stars 12 forks source link

Sorter replaces the reference to values from DOCTYPE resources #23

Open umarhussain15 opened 6 years ago

umarhussain15 commented 6 years ago

I'm setting some values using this mechanism to allow concatenation inside my xml.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<!DOCTYPE resources [
    <!ENTITY email_link_host "abc.com">
    ]>
<resources>
    <string name="email_url">https://&email_link_host;/someurl</string>
   <string name="other_url">https://&email_link_host;/otherurl</string>
</resources>

But after formatting the using the sorter it removes DOCTYPE and inject the variables into the resource string. After sort the output is:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<resources>
    <string name="email_url">https://abc.com/someurl</string>
   <string name="other_url">https://abc.com/otherurl</string>
</resources>

Please look into this issue.

roana0229 commented 6 years ago

👀 Thanks. I didn't know that can write <!DOCTYPE ... > in xml. I don't have time to develop this plugin. Can you make and send PR?