Browse Prior Art Database

Algorithm to create complete html file by parsing linked script files

IP.com Disclosure Number: IPCOM000247642D
Publication Date: 2016-Sep-22
Document File: 3 page(s) / 31K

Publishing Venue

The IP.com Prior Art Database

Abstract

A method to do static validation/verification of HTML files with content thats modified using javaScript.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 53% of the total text.

Page 01 of 3

Algorithm to create complete html file by parsing linked script files


Currently for any validation/verification on the application Html, user has to do that at run time by loading the application in the browser and opening the respective page. He cannot do any validation/verification at compile/static time. For example, if user wants to verify an xpath, he has to do that at run time. He doesn't have that capability at compile time, so he cannot automate the process to validate xpath.

Get the main html file of the application and parse the associated script files one by one. Create a temporary html file for each script file. Parse the script file and add newly created dom elements along with its properties in the temporary html file. Parse the script file and get references for the dom elements in the main html file. Remove the dom element entry from the temporary html file and add it as a child for the dom element in the main html file.

Advantages:
1. Automatic generation of xpath for the newly added dom elements.

2. Validation of xpath at compile time.

Following is the algorithm to create complete html file for the application by parsing all the script files -


1. Get the main html file from plugin.xml or prompt user to input the main html file.

2. Parse html file to get the list of associated script files.

3. Iterate through the script files one by one.

4. Create a temporary html file for each script file.

5. Parse the script file and look out for dom creation APIs like - document.createElement and add respective tag entry in temporary html file.

6. Add an attribute "tempId" with value as the name of variable inside the html tag created in step 5.

7. Look out for dom object created in step 5 inside the script file and update its attributes (properties) in the temporary html file.

8. Check if dom object is added as child of some parent node, then search the parent object entry inside the temporary html file using "tempId" attribute and move the dom object entry as child of parent object inside the temporary html file.

9. If parent node doesn't exist...