* @param filepath file to parse
* @param root html root tag, childs will be attached to it
*/
public static void parse(String filepath, HTMLTag root)
{
HTMLTag parent = root;
for(String tag : parseTags(filepath))
{
if(tag.contains(WICKET_ID))
{
try {
HTMLTag htmltag = new HTMLTag(tag.substring(0, tag.indexOf(" ")));
int i1 = tag.indexOf("\"", tag.indexOf(WICKET_ID)) + 1;
int i2 = tag.indexOf("\"", i1);
htmltag.setId(tag.substring(i1, i2));
htmltag.setParent(parent);
parent.addChild(htmltag);
if(!tag.endsWith("/"))
parent = htmltag;