Appcelerator Blog

The Leading Resource for All Things Mobile

Quick Tip: XML2TSS

0 Flares 0 Flares ×

XML2TSS is a command-line tool written by Titanium Titan David Bankier (@davidbankier) that analyzes your XML files, identifies IDs and Classes and automatically generates a template TSS file with said content. This small app is so useful that was recently merged into Alloy and will be available as one of Alloy’s official features. But you don’t have to wait to start taking advantage of it. You can start now and here’s how.

The tool is a Node.js script available via NPM. To install it, go to your terminal/command window and type:

sudo npm install -g xml2tss

This will install xml2tss globally in your computer. There are different ways of using it as explained in the GitHub Repo, but here’s the basic usage.

You can get the output echoed to the console:

xml2tss myviewfile.xml

You can also get the output to a file:

xml2tss myviewfile.xml > mystylefile.tss

On OSX you can output to the clipboard:

xml2tss myviewfile.xml | pbcopy

In any of these cases, the output is a properly formatted TSS file:

"#progressIndicator" : {

"#slider" : {

"#statusIndicator" : {

".container" : {


Next time you’re building a screen using Alloy, go ahead and type the View in XML with all its classes and Ids and give XML2TSS a try. You’ll see how useful it is.

Have your written a cool tool or utility? I’d love to check it out. Feel free to send it over to

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×


  1. josh


  2. Very nice tool, Thank You Daviv

  3. Mario

    It will save a some time. Nice!

  4. James

    This looks cool but I get an error when trying to run it: Cannot call method ‘toString’ of undefined. Anyone else getting this?

  5. Ranjith Kumar Nagella

    I hope I see more features in this tool. Cool..!

Comments are closed.

Sign up for updates!

Become a mobile leader. Take the first step to scale mobile innovation throughout your enterprise.
Get in touch
computer and tablet showing Appcelerator software
Start free, grow from there.
0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×