- Description π
- Features π οΈ
- Installation π₯
- Usage π₯οΈ
- Documentation π
- Contributing π€
- License π
XMLEditor is a comprehensive JavaFX-based desktop application designed for parsing, editing, and visualizing XML files. It provides a wide range of features for manipulating XML data, including validation, formatting, compression, and conversion to JSON. Additionally, the application offers tools for analyzing and visualizing social network data represented in XML format, such as identifying influential users, mutual followers, and suggesting connections. The application is designed to cater to both casual users through a Graphical User Interface (GUI) and advanced users via a Command-Line Interface (CLI), ensuring accessibility and usability for a wide range of users.
For detailed documentation on how the project works and how to contribute, please refer to the Documentation.
- Validation: The application ensures that XML files are well-formed by checking for proper tag nesting, closing tags, and structural integrity.
- Error Handling: Errors are highlighted with line numbers, and the application provides options for auto-correction, allowing users to fix issues and save the corrected file.
- Prettifying: The application improves the readability of XML files by indenting nested elements and removing unnecessary whitespace while maintaining the structure.
- Minification: Users can reduce the file size by removing all unnecessary whitespace and newlines, making the XML file more compact.
- Conversion: The application converts XML data into JSON format, making it easier to integrate with JavaScript-based tools and applications.
- Compatibility: The JSON output is structured to ensure compatibility with modern web applications and APIs.
- Compression: The application uses Byte Pair Encoding (BPE) to compress XML/JSON files, reducing their size for efficient storage and transfer.
- Decompression: Compressed files can be decompressed back to their original format, ensuring data integrity and usability.
- Graph Representation: The application visualizes user relationships as a directed graph, where nodes represent users and edges represent follower relationships.
- Interactive Graph: Users can interact with the graph, zoom in/out, and explore connections between users.
- Influential Users: The application identifies the most influential user in the network (the user with the maximum number of followers).
- Active Users: It also identifies the most active user (the user with the maximum number of connections).
- Mutual Followers: Users can find mutual followers between any two users in the network.
- Follow Suggestions: The application suggests new connections by analyzing the network and recommending users to follow (e.g., followers of followers).
- Keyword Search: Users can search for posts containing specific keywords or topics within the XML data.
- Topic Search: The application allows users to search for posts related to specific topics, making it easier to analyze user-generated content.
- Graphical User Interface (GUI): The GUI is designed for ease of use, with intuitive buttons and menus for performing operations like parsing, formatting, compressing, and visualizing XML files.
- Command-Line Interface (CLI): Advanced users can use the CLI to execute operations through simple commands, making it suitable for automation and scripting.
-
Clone the repository:
git clone https://github.com/MoustafaHashem/XMLEditorProject.git
-
Navigate to the project directory:
cd XMLEditorProject -
Compile and run the application:
./run.sh
- Opening Files: Users can open XML files using the "Open" button in the GUI. The application supports various file formats, including
.xml,.json, and.comp. - Performing Operations: Users can perform operations like validation, formatting, compression, and conversion by clicking the corresponding buttons in the GUI.
- Visualizing Data: The application provides a graph visualization tool to explore user relationships and network analysis results.
The CLI mode allows advanced users to execute operations through commands. Below are the available commands and their expected outputs:
- Command:
xml_editor verify -i input_file.xml -f -o output_file.xml
- Expected Output:
- If the XML is consistent, the output will be "Valid XML" in the console.
- If the XML is invalid, the application will display the number of errors and the lines where they occur.
- If the
-foption is used, the application will fix the errors and save the corrected version inoutput_file.xml.
- Command:
xml_editor format -i input_file.xml -o output_file.xml
- Expected Output:
- The input XML file will be formatted (prettified) and saved in
output_file.xml.
- The input XML file will be formatted (prettified) and saved in
- Command:
xml_editor json -i input_file.xml -o output_file.json
- Expected Output:
- The input XML file will be converted to JSON format and saved in
output_file.json.
- The input XML file will be converted to JSON format and saved in
- Command:
xml_editor mini -i input_file.xml -o output_file.xml
- Expected Output:
- The input XML file will be minified (unnecessary whitespace removed) and saved in
output_file.xml.
- The input XML file will be minified (unnecessary whitespace removed) and saved in
- Command:
xml_editor compress -i input_file.xml -o output_file.comp
- Expected Output:
- The input XML file will be compressed using Byte Pair Encoding and saved in
output_file.comp.
- The input XML file will be compressed using Byte Pair Encoding and saved in
- Command:
xml_editor decompress -i input_file.comp -o output_file.xml
- Expected Output:
- The compressed file (
input_file.comp) will be decompressed and saved asoutput_file.xml.
- The compressed file (
- Command:
xml_editor draw -i input_file.xml -o output_file.jpg
- Expected Output:
- The input XML data will be represented as a graph and saved as
output_file.jpg.
- The input XML data will be represented as a graph and saved as
-
Most Active User:
- Command:
xml_editor most_active -i input_file.xml
- Expected Output:
- The most active user's name and ID will be displayed.
- Command:
-
Most Influencer User:
- Command:
xml_editor most_influencer -i input_file.xml
- Expected Output:
- The most influential user's name and ID will be displayed.
- Command:
-
Mutual Followers:
- Command:
xml_editor mutual -i input_file.xml -ids 1,2,3
- Expected Output:
- A list of mutual followers between users with IDs 1, 2, and 3 will be displayed.
- Command:
-
Follow Suggestions:
- Command:
xml_editor suggest -i input_file.xml -id 1
- Expected Output:
- A list of suggested users for the user with ID 1 will be displayed.
- Command:
-
Keyword Search:
- Command:
xml_editor search -w word -i input_file.xml
- Expected Output:
- A list of posts containing the specified keyword will be displayed.
- Command:
-
Topic Search:
- Command:
xml_editor search -t topic -i input_file.xml
- Expected Output:
- A list of posts related to the specified topic will be displayed.
- Command:
For more detailed information on how to use the application, its features, and how to contribute, please visit the Documentation.
We welcome contributions to the project! If you'd like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a detailed description of your changes.
This project is licensed under the MIT License. See the LICENSE file for more details.