Kodi Community Forum

Full Version: Skin XML Converter + Formatter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13
small update, the tool now also removes the BOM of the xmls when converting. Encoding is fixed to UTF8, no chance anymore to use another encoding.
https://github.com/phil65/xmlconvertgui/...20beta.exe
Tool is now final.
Added option to indent with tab + some more fixes
https://github.com/phil65/xmlconvertgui/...20v1.0.exe

This looks like exactly what I need to clean up Neon more - sadly I can't get it to work.

After I download the exe, start it and select my skin folder it immediately crashes with "The path is not of a legal form" (http://pastebin.com/bjQCLnL1)
I figured out that I can press continue on the exception and the program will still work partially.
It will then select the folder (shown in output) and will do the textures, but not anything else.
For instance while checking fonts I get "can not find C:\font.xml" in the output. Obviously the Font.xml is located at c:\neon\720p\Font.xml
I get a different error when choosing the Export location folder : http://pastebin.com/kvQmVTGF

I also tried the beta-0.9, with the same problem.
I have to conclude my system is to blame, because appareantly other people managed to run the 0.9 beta.

Would you have any idea where the issue lies ? I would love to use this.
I figured it out ! The program ONLY scans for the res tag in the addon.xml, if that tag is not available it crashes hard.

I changed
Code:
<extension
  point="xbmc.gui.skin" defaultresolution="720p"
  defaultresolutionwide="720p"
  defaultthemename="textures.xbt"
  effectslowdown="1"
  debugging="false"
  />
to
Code:
<extension
  point="xbmc.gui.skin" defaultresolution="720p"
  defaultresolutionwide="720p"
  defaultthemename="textures.xbt"
  effectslowdown="1"
  debugging="false">
    <res width="1080" height="720" aspect="16:9" default="true" folder="720p" />
  </extension>

And now it is usable.

yes, correct, that tag is needed.
will adjust it to catch that exception and give out a log message then.
small new feature: detection of invalid values
atm I´m checkin this:
Code:
CheckNodeValue("align", {"left", "center", "right", "justify"}, SafeFilepaths(j))
                CheckNodeValue("aspectratio", {"keep", "scale", "stretch", "center"}, SafeFilepaths(j))
                CheckNodeValue("aligny", {"top", "center", "bottom"}, SafeFilepaths(j))
                CheckNodeValue("orientation", {"horizontal", "vertical"}, SafeFilepaths(j))
                CheckNodeValue("subtype", {"page", "int", "float", "text"}, SafeFilepaths(j))
                CheckNodeValue("action", {"volume", "seek"}, SafeFilepaths(j))
                CheckNodeValue("scroll", {"false", "true", "yes", "no"}, SafeFilepaths(j))
                CheckNodeValue("randomize", {"false", "true", "yes", "no"}, SafeFilepaths(j))
                CheckNodeValue("scrollout", {"false", "true", "yes", "no"}, SafeFilepaths(j))
                CheckNodeValue("pulseonselect", {"false", "true", "yes", "no"}, SafeFilepaths(j))
                CheckNodeValue("reverse", {"false", "true", "yes", "no"}, SafeFilepaths(j))
                CheckNodeValue("usecontrolcoords", {"false", "true", "yes", "no"}, SafeFilepaths(j))
(the array in the middle is a whitelist)
While running your tool I got

script-Rom_Collection_Browser-gameinfo.xml: Invalid Value for pulseonselect:

in the code it said

<pulseonselect></pulseonselect>

Is this not a valid use of overruling the value (which is true by default) ?
It is used in many examples in the XBMC skinning manual.

As another point: the missing bracket identification is great, but it doesn't tell you the filename or linenumber where you can find the issue. The same goes for most other checks. I think this would a valuable addition to the tool.
why should someone use <pulseonselect></pulseonselect>?
identifying the line numbers is not that easy because i do not parse the xml "as a textfile". will see if i can come up with something.
Also added a check for undefined/unused vars + workin on the same for labels.
I have changed all calls to <pulseonselect>false</pulseonselect> which seems much more readable in the code and does the same thing.
However, the XBMC Skinning Manual uses the above example very often, it might need to be adjusted as well ? (search for pulseonselect at http://wiki.xbmc.org/index.php?title=XBM...ing_Manual)

Something else I noticed:
When cleaning up whitespace with line endings linux style, your tool does not add a newline character at the end of each last line of the file.
This could potentially cause issues when including XML files (depends on how XBMC handles this).
Github sees this as a change as well and adds "\ No newline at end of file" to the end to clarify that the newline is missing.
yep best thing would be to adjust the wiki. (it´s not really "wrong", but it´s superfluous and unneeded clutter)
is the newline at end of file needed? why could it cause issues?
i let XMLWriter Class do the work, that´s the way they implemented that.
I am not sure if it is needed in XBMC, but it is worth investigating.
I suddenly noticed github had a warning at the end of each file after running the cleanup, thats why i was investigating and this is what I found out:

In several compilers, when including a file, that file is included as-is. This means that missing EOL are not added.
In some languages this can cause problems because the last word of a file could be glued to the first word of the next include.
This is the reason why github warns for missing line endings at the end of a file.

More information: http://stackoverflow.com/questions/72969...-a-newline and http://stackoverflow.com/questions/58133...nd-of-file

Code examples with XMLWriter suggest you might need to add the last endofline manually but no idea how that is in VB
http://stackoverflow.com/questions/40941...in-c-sharp
I added a WriteEndDocument(). could you test?
https://github.com/phil65/xmlconvertgui/...20v1.1.exe
I tested it, but it still gives the same issue when uploading to github. (https://github.com/kibje/skin.neon/commi...887#diff-0)

I pushed that commit to github and immediately rewrote history, that is why it is detached now.
I have custom buttons in Confluence main menu (fixed list id 9000) with

<item id="91">
<item id="92">
<item id="93">

and it seems to be reporting these as undefined ids, i cannot find those ids anywhere else. For some reason 90, 94 and 95 are fine, those are custom buttons as well.
yep already saw that. I´m not takin item id´s into account atm. will fix that when i find some time.
will also have to look a bit deeper into EOF NewLine.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13