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 fileopens XML file
Compressed fileopens a compressed .tkf file -
save

save assaves the content of the output window in the XML (.tkf or .json) in file system
Validatevalidates the XML in the input window and shows errors if found in output windowCorrectcorrect errors shown in validatePrettifyprettifies the XML data in the input windowMinifyminified the input data in the input windowTo JSONtakes XML data from input windowcompactshows a compact JSON in output windownon-compactshows non-compact JSON in output window reference
Compresscompresses the XML data and shows in output window (.tkf)Decompresstakes compressed data and shows it as prettified XML in output windowSN analyzertakes the valid XML data and goes to the next phase
Search in postscase insensitive search in users postsGet Mutual Friendsget the mutual users that two users followSuggest friendssuggest users to follow based on mutual based on users you follow and follow youMost influencer usergets the most followed userMost active usergets the users who followed the most usersXML Analyzermoves 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
mainfunction which read the command and direct it to the corresponding handler - the
handleris responsible for ensuring that the given data is compatible with thefeaturefunction, then send the data to the corresponding feature function - the
featurefunction is the core of the program that performs the actual work on the data, then send the result back to thehandler - the
handlersend the response back to theGUIto 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
usermust have anidandname, may havefollowersandposts - each
followerhas anid - each
posthasbodyandtopics
- each

