1.4.1 • Published 4 years ago

diff-xml-layout v1.4.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

diff-xml-layout

Formats minified XML and shows a readable diff for

  • 1._.xml's jsonData
  • 12._.xml's jsonData
  • 64._.xml's Layout

Usage

In the Pending Changes, right click on an XML file and click "Open in External Compare Tool". Usage screenshot

Click to watch the video

Watch the usage video

Installation

  1. Install all dependencies
    1. Node.js
    2. Your choice of compare tool
      1. Visual Studio Code (Windows)
        • Only works for 2 way compare!
      2. Meld (Windows or Linux)
    3. npm install -g diff-xml-layout
    4. Windows users: if you don't want to install Node.js and npm, install the .exe
      1. https://github.ibm.com/fullchee-zhang/diff-xml-layout/releases
      2. Skip step 1.3
  2. Modify the Eclipse Preferences
    1. Open Eclipse
    2. Window > Preferences
    3. Search for "External Compare Tool"
  3. TODO: updated screenshot for windows and linuxLocation of Executable
    1. Windows: Run this in a terminal where diff-xml-layout
      1. eg: C:\Program Files\diff-xml-layout\bin\diff-xml-layout.cmd
    2. Linux: Run this in a terminal whereis diff-xml-layout
      1. eg: /usr/bin/diff-xml-layout
  4. Local Compare Arguments
    1. Using VSCode (default): ${file1Path} ${file2Path}
    2. Using Meld as a compare tool: ${file1Path} ${file2Path} meld

Setting up Eclipse Preferences

How this works

See src/index.ts

  1. This script takes in two files using RTC's external compare tool (see instructions)
  2. It checks if the files exist.
  3. Creates two new files with the contents of the jsonData or layout
    1. Reads the XML file
    2. Checks what type of file it is (64._.xml or 1._.xml)
    3. Converts the XML into JS (because that's how the xml parser library works)
    4. Get the contents of the layout or the jsonData
    5. Write it to a file
  4. Open meld or code to view the diff of the two files.

CLI Usage

$ npm install -g diff-xml-layout
$ diff-xml-layout TOOL FILE1 FILE2
running command...
$ diff-xml-layout (-v|--version|version)
diff-xml-layout/1.0.1
$ diff-xml-layout --help [COMMAND]
USAGE
  $ diff-xml-layout diff-xml-layout TOOL FILE1 FILE2

ARGUMENTS
  TOOL   (code|meld) Compare tool to be used
  FILE1  First file to compare
  FILE2  Second file to compare
  ANCESTOR Ancestor file that FILE1 and FILE2 started from

OPTIONS
  -h, --help     show CLI help
  -v, --version  show CLI version
1.4.1

4 years ago

1.4.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.0

4 years ago