XmlTools: Difference between revisions

307 bytes added ,  28 May 2013
m
touch-up
m (adding to Tutorials cat. to help organize modding info)
m (touch-up)
Line 2: Line 2:
XmlTools is a command-line modding tool that operates on XML files, especially those exported by [[OniSplit#XML|OniSplit]]. It was developed in C# and works in both Mac OS X (Latest Mono required) and Windows (.NET 3.5 required).
XmlTools is a command-line modding tool that operates on XML files, especially those exported by [[OniSplit#XML|OniSplit]]. It was developed in C# and works in both Mac OS X (Latest Mono required) and Windows (.NET 3.5 required).


The initial version was written to help with the development of the Old China level mod. It was then developed further for the purposes of the [[AE]] so that resources could be patched smartly. To learn about the overall process, read [[Making a patch mod]] and [[Anniversary Edition/Framework#XML patching]].
The initial version was written to help with the development of the Old China level mod. It was then developed further for the purposes of the [[AE]] so that resources could be patched smartly. To learn about the overall process, read [[Making a patch mod]] and [[Anniversary Edition/Framework#XML patching|AE Framework - XML patching]].


XmlTools can be used as a standalone tool or as a base for another tool. It can be issued commands directly on the command-line interface (CLI) or passed a text file on the CLI with a list of commands to perform.
XmlTools can be used as a standalone tool or as a base for another tool. It can be issued commands directly on the command-line interface (CLI) or passed a text file on the CLI with a list of commands to perform.
Line 41: Line 41:
|- valign="top"
|- valign="top"
|<span style="background:rgb(255,156,156); border-radius:0.33em;">'''Operation-specific argument(s)'''</span>||This is where you supply the arguments that this specific command needs. As seen below, addvalue requires the value to add to a space-separated list, so we provide that here. Note the use of quotes as specified in the command's documentation below.
|<span style="background:rgb(255,156,156); border-radius:0.33em;">'''Operation-specific argument(s)'''</span>||This is where you supply the arguments that this specific command needs. As seen below, addvalue requires the value to add to a space-separated list, so we provide that here. Note the use of quotes as specified in the command's documentation below.
|-
|- valign="top"
|<span style="background:rgb(156,255,156); border-radius:0.33em;">'''Global argument(s)'''</span>||Make sure you specify the full path to the file if the file is not in the current directory. No quotes are used for these commands unless you need to pass a file name path with spaces in it.
|<span style="background:rgb(156,255,156); border-radius:0.33em;">'''Global argument(s)'''</span>||Make sure you specify the full path to the file if the file is not in the current directory. No quotes are used for these commands unless you need to pass a file name path with spaces in it.
|}
|}
Line 54: Line 54:
|-
|-
|'''(Optional)'''||<tt>-debug</tt>||Not used yet. It will be probably used to output some debugging information in the future.
|'''(Optional)'''||<tt>-debug</tt>||Not used yet. It will be probably used to output some debugging information in the future.
|-
|- valign="top"
|'''(Optional)'''||<tt>-filename:<XML file></tt>||Specifies file to modify (allows wildcards '*','?') (backup made by default) (when not used, XmlTools will apply the operation over all the XML files in the same directory as xmlTools.exe).
|'''(Optional)'''||<tt>-filename:<XML file></tt>||Specifies file to modify (allows wildcards '*','?') (backup made by default) (when not used, XmlTools will apply the operation over all the XML files in the same directory as xmlTools.exe).
|-  
|-  
Line 104: Line 104:


<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 the specified files using the [File<quoted file name>] argument,
: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.
:or to named files with <tt>-forceinfiles</tt> argument (allows wildcards '*','?'); see below for patch commands.


==Patch file operations==
==Patch file operations==
Line 114: Line 113:
Arguments in square brackets are optional.
Arguments in square brackets are optional.


<tt>@ADDTO Element <quoted tag name> [ParentElement <quoted tag name>] [File<quoted file 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.
:Adds the raw XML that follows to the named array tag.
  @ADDTO Element "Particles"
  @ADDTO Element "Particles"
Line 166: Line 165:
  <nowiki></code></nowiki>
  <nowiki></code></nowiki>
   
   
Note that if you don't use the optional <tt>File <quoted file name></tt> argument, the operation will be applied over all the XML files in the same directory as xmlTools.exe. The <tt>File</tt> argument allows wildcards ('*', '?').
Note that if you don't use the optional <tt>File <quoted file name></tt> argument, the operation will be applied over all the XML files in the same directory as xmlTools.exe -- unless you used the <tt>-filename</tt> argument along with the <tt>patchfile</tt> command as described in that command's documentation above. Note that the <tt>File</tt> argument allows wildcards ('*', '?').


[[Category:Bi-platform modding tools]][[Category:Completed modding tools]][[Category:Modding tutorials]]
[[Category:Bi-platform modding tools]][[Category:Completed modding tools]][[Category:Modding tutorials]]