Jump to content

XmlTools: Difference between revisions

581 bytes added ,  3 February 2014
(→‎Global command-line arguments: no more global arguments anymore)
Line 56: Line 56:
|}
|}


==Command-line operations==
==Command-line options==
Arguments in square brackets are optional.
You can use any of the following operations bellow with XmlTools. If you don't provide all the required arguments to an option XmlTools will notice you.


<tt>updatechainvalues -newvalue:<quoted string> [-valpositions:<quoted string>] [-valrelation:<quoted string>]</tt>
===Operations===
:Update a value chain, starting at the -newvalue;
<tt>-a, --add-values</tt>
:<tt>-valpositions</tt> (optional) is zero-indexed and can be a single value or a space-separated list, e.g. <tt>-valpositions=0 1 4</tt>;
:Add new values to a set of XML elements;
:<tt>-valrelation</tt> (optional) means ???.


<tt>invert</tt>
<tt>--remove-values</tt>
:Inverts a value chain
:Removes values from a set of XML elements;


<tt>addvalue -value:<quoted string></tt>
<tt>--replace-value</tt>
:Adds value or space-separated list of values into an element.
:Replaces 1 value in a set of XML elements;


<tt>removevalue -value:<quoted string></tt>
<tt>--replace-all-values</tt>
:Removes value or space-separated list of values from an element.
:Replaces all values in a set of XML elements;


<tt>replacevalue -oldvalue:<string> -newvalue:<string></tt>
<tt>-u, --update-elements</tt>
:Replaces specified old value, if found, with new value.
:Updates all values in a set of XML elements;


<tt>replaceall -value:<string> [-valpositions:<quoted string>]</tt>
<tt>-i, --invert-elements</tt>
:Replaces value in element with new value, no matter its previous value.
:Inverts a set of XML elements.


<tt>showerrtypes</tt>
===Operations inputs===
:Show error numbers and their internal names.
<tt>-c, --current-val <current-val></tt>
:Current value(s) [use space as separator];


<tt>patchfile [-forceinfiles:<file names>]</tt>
<tt>-n, --new-val <new-val></tt>
:Changes <tt>-filename</tt> argument to refer to a patch file and applies this patch to the files specified. You specify the files to patch by using the patch file's <tt>[File <quoted file name>]</tt> argument (see below), or else by naming the files on the CLI with the <tt>-forceinfiles</tt> argument (allows wildcards '*', '?'). See below for patching commands.
:New value(s) [use space as separator];
 
<tt>-d, --diff-old-new-val <diff-old-new-val></tt>
:Difference between old and new value;
 
<tt>--positions <positions></tt>
:Positions [use space as separator] [0-index based];
 
<tt>-f, --files <files></tt>
:XML files to process [wildcards supported];
 
<tt>-p, --patch-files <patch-files></tt>
:Patch files to process [wildcards supported];
 
<tt>--force-target-files <force-target-files></tt>
:Force the patch-files operation in the specified XML files. [wildcards supported];
 
<tt>-e, --element-name <element-name></tt>
:Name of the XML element(s) where processing will occur;
 
<tt>--parent-element-name <parent-element-name></tt>
:Name of the XML parent element of <element-name> [used as filter];
 
<tt>--attribute-name <attribute-name></tt>
:Attribute name of <element-name> [used as filter];
 
<tt>--attribute-value <attribute-value></tt>
:Attribute value of <attribute-name>  [used as filter];
 
<tt>-x, --xpath-expression <xpath-expression></tt>
:[http://www.w3.org/TR/xpath/ XPath 1.0] expression to select elements where processing will occur;
 
<tt>--no-backups</tt>
:No backups [faster processing];
 
<tt>--no-verbose</tt>
:Reduce the number of text messages output [faster processing].


==Patch file operations==
==Patch file operations==
489

edits