<x-factor />

X-Factor is an XML refactoring tool. It allows commonly made changes to xml files to be automated making it easier to change xml schema to reflect changing circumstances.

Currently X-Factor allows three refactorings:

Removal of an attribute from a element

(xfactor --attrdelete --elementlist doc --attribute attribute)

<doc>
  <element attribute="value" />
</doc>
becomes
<doc>
  <element />
</doc>

Transforming of an attribute into an element

(xfactor --attr2element --elementlist doc --attribute attribute)

<doc>
  <element attribute="value" />
</doc>
becomes
<doc>
  <element>
    <attribute>value</attribute>
  </element>
</doc>

Renaming of an element

(xfactor --renameelement --elementlist doc --target another-doc)

<doc>
  <element attribute="value" />
</doc>
becomes
<another-doc>
  <element attribute="value" />
</another-doc>

Usage

usage: xfactor
 -attr2element      change an attribute to an element
 -attrdelete        delete an attribute
 -attribute         attribute to be altered
 -deleteelement     delete an element and it's children
 -dropelement       drop an element leaving it's children
 -element2attr      convert an element to an attribute
 -elementlist       list of xpath for elements to be altered
 -empty             remove empty element
 -renameattribute   rename attribute
 -renameelement     rename an element
 -target            target element to be altered
 -verbose           verbose
    
Download Source