A C++ tool to verify, format, minify, compress, and visualize XML data.
Important
You need a C++ compiler and Graphviz for visualization.
sudo apt update
sudo apt install build-essential g++
sudo apt install graphviz
### Verify installation:
g++ --version
dot -VImportant
You need a C++ compiler (like MinGW) and Graphviz.
winget install graphviz- We need to find the folder containing dot.exe. It is usually in one of these two places:
- Standard:
C:\Program Files\Graphviz\bin - User specific:
C:\Users\[YOUR_USERNAME]\AppData\Local\Programs\Graphviz\bin
- Standard:
- Action: Open your File Explorer and check
C:\Program Files\Graphviz. Do you see abinfolder inside? If yes, copy that address (e.g.,C:\Program Files\Graphviz\bin).
- Now we manually add that address to your system settings.
- Press the Windows Key and type "env".
- Select "Edit the system environment variables".
- In the window that pops up, click the Environment Variables button (bottom right).
- In the bottom list (System variables), find the variable named Path and select it.
- Click Edit.
- Click New (on the right side).
- Paste the path you found in Step 2 (e.g., C:\Program Files\Graphviz\bin).
- Click OK on all three open windows to save.
Close your current PowerShell window (this is mandatory) and open a new one.
Run:
dot -V
make clean all OS=windows
# each command has a unique target make clean all OS=linux
# each command has a unique target Note
You can back to the Makefile it's easy to understand
- Run the following command in your terminal to build the project:
g++ xml_editor.cpp external/tinyxml2/tinyxml2.cpp -Iexternal/tinyxml2 graph.cpp functions.cpp utils.cpp -o xml_editor
- Verify XML (no fix)
.\xml_editor.exe verify -i full_test.xml -o output_file.xml
- Verify XML (and fix)
.\xml_editor verify -i full_test.xml -f -o output_file.xml
- Format (Prettify)
.\xml_editor.exe format -i full_test.xml -o output_file.xml
- Convert to JSON
.\xml_editor.exe json -i full_test.xml -o output_file.json
- Minify
.\xml_editor.exe mini -i full_test.xml -o output_file.xml
- Compress
.\xml_editor.exe compress -i full_test.xml -o output_file.comp
- Decompress
.\xml_editor.exe decompress -i input_file.comp -o output_file.xml
- Draw Network (Requires Graphviz)
.\xml_editor.exe draw -i input_test_draw.xml -o output_file.jpg
.\xml_editor.exe draw -i full_test.xml -o output_file.jpg
- search by word
.\xml_editor.exe search -w word -i full_test.xml -o output_file.jpg
- search by topic
.\xml_editor.exe search -t topic -i full_test.xml -o output_file.jpg
- Verify XML (no fix)
./xml_editor verify -i full_test.xml -o output_file.xml
- Verify XML (and fix)
./xml_editor verify -i full_test.xml -f -o output_file.xml
- Format (Prettify)
./xml_editor format -i full_test.xml -o output_file.xml
- Convert to JSON
./xml_editor json -i full_test.xml -o output_file.json
- Minify
./xml_editor mini -i full_test.xml -o output_file.xml
- Compress
./xml_editor compress -i full_test.xml -o output_file.comp
- Decompress
./xml_editor decompress -i input_file.comp -o output_file.xml
- Draw Network (Requires Graphviz)
./xml_editor draw -i input_test_draw.xml -o output_file.jpg
./xml_editor draw -i full_test.xml -o output_file.jpg
- search by word
./xml_editor.exe search -w word -i full_test.xml -o output_file.jpg
- search by topic
./xml_editor.exe search -t topic -i full_test.xml -o output_file.jpg