This application is divided into two phases:
-
XML formatter which takes an XML file and do various operations:
validate
,correct
,compress
,decompress
,convert to JSON
,minify
, andprettify
-
Social Network Analyzer which takes the social network data written in XML format from the previous phase and do various operations:
graph visualization
,search in posts
,get mutual users
,most active user
,most influencer user
, andsuggest friends
-
open
XML file
opens XML file
Compressed file
opens a compressed .tkf file -
save
save as
saves the content of the output window in the XML (.tkf or .json) in file system
Validate
validates the XML in the input window and shows errors if found in output windowCorrect
correct errors shown in validatePrettify
prettifies the XML data in the input windowMinify
minified the input data in the input windowTo JSON
takes XML data from input windowcompact
shows a compact JSON in output windownon-compact
shows non-compact JSON in output window reference
Compress
compresses the XML data and shows in output window (.tkf)Decompress
takes compressed data and shows it as prettified XML in output windowSN analyzer
takes the valid XML data and goes to the next phase
Search in posts
case insensitive search in users postsGet Mutual Friends
get the mutual users that two users followSuggest friends
suggest users to follow based on mutual based on users you follow and follow youMost influencer user
gets the most followed userMost active user
gets the users who followed the most usersXML Analyzer
moves back to the previous phase
This figure describes every operation done in this app, when a user wants to perform any operation on XML data the following sequence happens:
- the user type (or open) XML data and press any command button
- the command is sent to the
main
function which read the command and direct it to the corresponding handler - the
handler
is responsible for ensuring that the given data is compatible with thefeature
function, then send the data to the corresponding feature function - the
feature
function is the core of the program that performs the actual work on the data, then send the result back to thehandler
- the
handler
send the response back to theGUI
to be displayed to the user
For trying the project you can download the pre-build copy for windows platform from here or clone the repo and build your own copy
For building your copy make sure you have node and npm installed on your machine, then follow these instructions
- Clone the repo
git clone https://github.com/Ahmed-Khaled24/XML-SN-Analyzer.git
- Install project dependencies
npm install
- For the building process there are two options
- Use the pre-configured scripts in package.json
for windows, linux, and mac platforms respectively
npm run win npm run linux npm run mac
- Customize your build options using electron-builder reference
- Use the pre-configured scripts in package.json
- comments and attributes are not supported
- XML must have a single parent (wrapper tag) for compact json to work properly
- empty XML tags are ignored
- social network XML must be formatted this way
<users>
<user>
<id> 1 </id>
<name> Ahmed Ali </name>
<posts>
<post>
<body>
Lorem ipsum dolor sit amet,
</body>
<topics>
<topic>
economy
</topic>
<topic>
finance
</topic>
</topics>
</post>
</posts>
<followers>
<follower>
<id> 2 </id>
</follower>
<follower>
<id> 3 </id>
</follower>
</followers>
</user>
</users>
- List of
users
- each
user
must have anid
andname
, may havefollowers
andposts
- each
follower
has anid
- each
post
hasbody
andtopics
- each