Jump to content

XmlTools: Difference between revisions

997 bytes added ,  14 April 2013
some fixes
m (→‎Overview: XmlTools works on all XML, duh)
(some fixes)
Line 29: Line 29:
:::On the Mac, be sure to use / rather than \ in paths. The following instructions are for Windows by default.
:::On the Mac, be sure to use / rather than \ in paths. The following instructions are for Windows by default.


===Universal arguments===
===Global arguments===
You must use these arguments with each command listed in the next section:
You may use these arguments with each command listed in the next section:
{|
{|
|<tt>-filename:<XML file></tt>||Specifies file to modify (backup made by default)
|<tt>-filename:<XML file></tt>||Specifies file to modify (allows wildcards '*','?') (backup made by default) (when not used will apply the operation over all the xml files in the same directory of xmlTools.exe)||'''Optional'''
|-
|-
|<tt>-element:<XML tag></tt>||Specifies XML tag to look for in the file
|<tt>-element:<XML tag></tt>||Specifies XML tag to look for in the file||'''Required'''
|-
|-
|<tt>-parelement:<XML tag></tt>||'''Optional'''; specifies XML tag that contains -element tag to avoid potential confusion, e.g. "Heights" is an array in a TRAM XML that contains "Height" tags
|<tt>-parelement:<XML tag></tt>||Specifies XML tag that contains -element tag to avoid override elements that have the same name but have different parent elements ||'''Optional'''
|}
e.g.:
 
<pre>
<xml>
    <Volume>
          <Min>1</Min>
          <Max>1</Max>
    </Volume>
    <Pitch>
          <Min>1</Min>
          <Max>1</Max>
    </Pitch>
<xml>
</pre>
 
In the above code you can differentiate the "Min" elements by it's parent element. So you can use -element:Min -parelement:Pitch to refer to "Min" of "Pitch" element.
 
{|
|-
|-
|<tt>-nobackups</tt>||XmlTools will not create a backup file (speeds up operations)
|<tt>-nobackups</tt>||XmlTools will not create a backup file (speeds up operations)||'''Optional'''
|-
|-
|<tt>-debug</tt>||???
|<tt>-debug</tt>||Not used yet. It will be probably used to output some debugging information in the future.||'''Optional'''
|}
|}


===Command-line operations===
===Command-line operations===
<tt>updatechainvalues -newvalue:<quoted string> [-valpositions:<quoted string>] [-valrelation:<quoted string>]</tt>
<tt>updatechainvalues -newvalue:<quoted string> [-valpositions:<quoted string>] [-valrelation:<quoted string>]</tt>
:Supply new value for an element;
:Update a XML chain, starting at the -newvalue;
:<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>;
:<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>;
:<tt>-valrelation</tt> (optional) means ???
:<tt>-valrelation</tt> (optional) means ???


<tt>invert</tt>
<tt>invert</tt>
:Inverts (how???) values of an element
:Inverts a XML chain


<tt>addvalue -value:<quoted string></tt>
<tt>addvalue -value:<quoted string></tt>
Line 63: Line 82:
<tt>replaceall -value:<string> [-valpositions:<quoted string>]</tt>
<tt>replaceall -value:<string> [-valpositions:<quoted string>]</tt>
:Replaces value in element with new value, no matter its previous value
:Replaces value in element with new value, no matter its previous value
<tt>showerrtypes</tt>
:Show errors numbers and they internal name


<tt>patchfile [-forceinfiles:<file names>]</tt>
<tt>patchfile [-forceinfiles:<file names>]</tt>
:Changes <tt>-filename</tt> argument to refer to a patch file and applies this patch to either all XML files in current folder,
:Changes <tt>-filename</tt> argument to refer to a patch file and applies this patch to the specified files using the [File<quoted file name>] argument,
:or to named files with <tt>-forceinfiles</tt> argument (allows wildcard '*'); see below for patch commands
:or to named files with <tt>-forceinfiles</tt> argument (allows wildcards '*','?'); see below for patch commands


===Patch file operations===
===Patch file operations===
To create a list of commands within one file that you can pass to XmlTools to execute all at once, create a plain-text file that uses the following commands and pass it to XmlTools using the <tt>patchfile</tt> command documented above. See [[Making a patch mod|HERE]] for instructions on making a patch mod for the AE.
To create a list of commands within one file that you can pass to XmlTools to execute all at once, create a plain-text file that uses the following commands and pass it to XmlTools using the <tt>patchfile</tt> command documented above. See [[Making a patch mod|HERE]] for instructions on making a patch mod for the AE.


<tt>@ADDTO Element <quoted tag name> [ParentElement <quoted tag name>]</tt>
<tt>@ADDTO Element <quoted tag name> [ParentElement <quoted tag name>] [File<quoted file name>]</tt>
:Adds the raw XML that follows to the named array tag, e.g.:
:Adds the raw XML that follows to the named array tag, e.g.:
  @ADDTO Element "Particles"
  @ADDTO Element "Particles"
Line 83: Line 105:
  </xml>
  </xml>


<tt>@REMOVE Element <quoted tag name> ParentElement <quoted tag name></tt>
<tt>@REMOVE Element <quoted tag name> [ParentElement <quoted tag name>] [File<quoted file name>]</tt>
:Removes named element from the array tag named by ParentElement
:Removes named element from the array tag named by ParentElement


Line 89: Line 111:
:Runs any of the commands available under "Command-line operations" above. Use standard command-line syntax described in that section, including <tt>-filename</tt>, e.g.:
:Runs any of the commands available under "Command-line operations" above. Use standard command-line syntax described in that section, including <tt>-filename</tt>, e.g.:
  @COMMAND invert -element:Height -parelement:Heights -filename:test.xml
  @COMMAND invert -element:Height -parelement:Heights -filename:test.xml
Note that if you don't specify the optional [File<quoted file name>] argument the operation will applied over all the XML files in the same directory of xmlTools.exe.
Also this [File<quoted file name>] allows wildcards ('*','?').


[[Category:Bi-platform modding tools]][[Category:Completed modding tools]]
[[Category:Bi-platform modding tools]][[Category:Completed modding tools]]
489

edits