xmlrm

1.1.2 • Public • Published

xml-remover

Command line XML elements remover

Can be lauch on file/folder , if folder , will check which one is xml.

Install

npm i -g xml-remover

Usage

Help

xmlrm —help

Example

xmlrm -i /Path/To/File.xml -b span

Will remove all span from File.xml

xmlrm -i /Path/To/Folder/ -b span

Attention : to work with folder don't forget "/" after folder name !

Params

--input, -i , Input folder or XML file, Required (null by default)

--balise, -b, Remove all balises (ex: -b span) (null by default)

--attribut, -a , Remove all asked attributs (ex: -a type) (null by default)

--method, -m (See methods values below) (null by default)

       and -> Remove balises & attributs (Enable by default)
       bwa -> Remove balises with attribut name
       aib -> Remove attribut in balises 
       bwoa -> Remove balises withOut attribut name

Specific sub item

To point on a specific subitem just use syntax -b "body div element"

Complexe example

  • xmlrm -i /Path/To/folder/ -b title -a type -m bwa

    Will remove all <title> with a "type" attribute

  • xmlrm -i /Path/To/folder/ -b title -a type::value -m bwa

    Will remove all <title> with a "type" attribute that have a "value" value

  • xmlrm -i /Path/To/file.xml -b title -a type -m aib

    Will remove all "type" attribute in <title> balises

  • xmlrm -i /Path/To/file.xml -b "body title" -a type::x,,z -m bwoa

    Will remove all <title> in body with a "type" attribute that does not have a "x" or a "z" values for example <title type="y"> will be removed

Readme

Keywords

none

Package Sidebar

Install

npm i xmlrm

Weekly Downloads

3

Version

1.1.2

License

ISC

Last publish

Collaborators

  • matthd