Index: /trunk/autoquest-plugin-html/.classpath
===================================================================
--- /trunk/autoquest-plugin-html/.classpath	(revision 1338)
+++ /trunk/autoquest-plugin-html/.classpath	(revision 1339)
@@ -13,4 +13,5 @@
 		</attributes>
 	</classpathentry>
+	<classpathentry kind="src" path="src/main/resources"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
 		<attributes>
Index: /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/HTMLLogParser.java
===================================================================
--- /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/HTMLLogParser.java	(revision 1338)
+++ /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/HTMLLogParser.java	(revision 1339)
@@ -15,4 +15,5 @@
 package de.ugoe.cs.autoquest.plugin.html;
 
+import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
@@ -31,4 +32,5 @@
 import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement;
 import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElementSpec;
+import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLPageElement;
 import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLPageElementSpec;
 import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLServerSpec;
@@ -53,4 +55,36 @@
     private Pattern htmlElementPattern =
         Pattern.compile("(\\w+)(\\[(\\d+)\\]|\\(htmlId=([\\w-]+)\\))");
+    
+    /**
+     * <p>
+     * the pattern used for parsing parsing parameters
+     * </p>
+     */
+    private Pattern htmlElementSpecPattern =
+        Pattern.compile("(\\w+)(\\[(\\d+)\\]|\\(htmlId=([\\w-]+)\\))?");
+    
+    /**
+     * <p>
+     * parameters to influence parsing
+     * </p>
+     */
+    private Map<String, List<String>> parseParams;
+
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @param parseParams
+     */
+    public HTMLLogParser(Map<String, List<String>> parseParams) {
+        this.parseParams = parseParams;
+        
+        for (String paramKey : parseParams.keySet()) {
+            if (!"clearId".equals(paramKey) && !"clearIndex".equals(paramKey)) {
+                throw new IllegalArgumentException("unknown parse parameter key " + paramKey);
+            }
+        }
+    }
 
     /* (non-Javadoc)
@@ -64,5 +98,5 @@
         
         String parentId = parameters.get("parent");
-        IGUIElement parent = super.getGUIElementTree().find(parentId);
+        HTMLGUIElement parent = (HTMLGUIElement) super.getGUIElementTree().find(parentId);
 
         if (parameters.containsKey("host")) {
@@ -122,8 +156,22 @@
                     index = Integer.parseInt(indexStr);
                 }
+                
+                String htmlId = parameters.get("htmlid");
+                
+                if (clearIndex(tagName, index, htmlId, parent)) {
+                    index = -1;
+                }
+                
+                if (clearHTMLId(tagName, index, htmlId, parent)) {
+                    htmlId = null;
+                }
+                
+                if ((htmlId == null) && (index == -1)) {
+                    // set at least a default index, if all is to be ignored.
+                    index = 0;
+                }
 
                 specification = new HTMLPageElementSpec
-                    ((HTMLDocumentSpec) document.getSpecification(), tagName,
-                     parameters.get("htmlid"), index);
+                    ((HTMLDocumentSpec) document.getSpecification(), tagName, htmlId, index);
                 
             }
@@ -151,4 +199,139 @@
     }
 
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @param tagName
+     * @param parent
+     * @return
+     */
+    private boolean clearIndex(String tagName, int index, String id, HTMLGUIElement parent) {
+        return clearSomething("clearIndex", tagName, index, id, parent);
+    }
+
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @param tagName
+     * @param parent
+     * @return
+     */
+    private boolean clearHTMLId(String tagName, int index, String id, HTMLGUIElement parent) {
+        return clearSomething("clearId", tagName, index, id, parent);
+    }
+    
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @param tagName
+     * @param parent
+     * @return
+     */
+    private boolean clearSomething(String         parseParamId,
+                                   String         tagName,
+                                   int            index,
+                                   String         id,
+                                   HTMLGUIElement parent)
+    {
+        if (parseParams.containsKey(parseParamId)) {
+            for (String spec : parseParams.get(parseParamId)) {
+                // determine the specification parts
+                if (spec.startsWith("/")) {
+                    throw new IllegalArgumentException("can not handle absolute specifications");
+                }
+                else if (spec.endsWith("/")) {
+                    throw new IllegalArgumentException("specifications may not end with a /");
+                }
+                
+                String[] tagSpecs = spec.split("/");
+                
+                if (tagMatchesTagSpec(tagName, index, id, parent, tagSpecs)) {
+                    return true;
+                }
+            }
+        }
+        
+        return false;
+    }
+
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @param tagName
+     * @param parent
+     * @param spec
+     * @return
+     */
+    private boolean tagMatchesTagSpec(String         tagName,
+                                      int            index,
+                                      String         id,
+                                      HTMLGUIElement parent,
+                                      String[]       tagSpecs)
+    {
+        
+        if (tagSpecs.length > 0) {
+            Matcher matcher = htmlElementSpecPattern.matcher(tagSpecs[tagSpecs.length - 1]);
+            
+            if (!matcher.matches()) {
+                throw new IllegalArgumentException
+                    ("illegal tag specification " + tagSpecs[tagSpecs.length - 1]);
+            }
+            
+            if (!tagName.equals(matcher.group(1))) {
+                return false;
+            }
+            
+            String idCondition = matcher.group(4);
+            
+            if (idCondition != null) {
+                if (!idCondition.equals(id)) {
+                    return false;
+                }
+            }
+            
+            String indexCondition = matcher.group(3);
+            
+            if (indexCondition != null) {
+                try {
+                    if (index != Integer.parseInt(indexCondition)) {
+                        return false;
+                    }
+                }
+                catch (NumberFormatException e) {
+                    throw new IllegalArgumentException
+                        ("illegal tag index specification " + indexCondition, e);
+                }
+            }
+            
+            if (tagSpecs.length > 1) {
+                if (parent instanceof HTMLPageElement) {
+                    return tagMatchesTagSpec(((HTMLPageElement) parent).getTagName(),
+                                             ((HTMLPageElement) parent).getIndex(),
+                                             ((HTMLPageElement) parent).getHtmlId(),
+                                             (HTMLGUIElement) parent.getParent(),
+                                             Arrays.copyOfRange(tagSpecs, 0, tagSpecs.length - 1));
+                }
+                else {
+                    throw new IllegalArgumentException
+                        ("specification matches documents or servers. This is not supported yet.");
+                }
+            }
+            else {
+                return true;
+            }
+        }
+        else {
+            return true;
+        }
+    }
+
     /* (non-Javadoc)
      * @see de.ugoe.cs.autoquest.plugin.html.AbstractDefaultLogParser#handleEvent(String, Map)
@@ -159,4 +342,9 @@
         
         if (targetId == null) {
+            if (parseParams.size() != 0) {
+                throw new SAXException
+                    ("old log file versions can not be parsed with parse parameters");
+            }
+            
             String targetDocument = parameters.get("targetDocument");
             String targetDOMPath = parameters.get("targetDOMPath");
Index: /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDcorrectHTMLLogDirs.java
===================================================================
--- /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDcorrectHTMLLogDirs.java	(revision 1338)
+++ /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDcorrectHTMLLogDirs.java	(revision 1339)
@@ -17,4 +17,5 @@
 import java.io.File;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
 import java.util.logging.Level;
@@ -90,5 +91,5 @@
             String serverName = null;
             
-            HTMLLogParser parser = new HTMLLogParser();
+            HTMLLogParser parser = new HTMLLogParser(new HashMap<String, List<String>>());
             try {
                 parser.parseFile(file);
Index: /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDparseDirHTML.java
===================================================================
--- /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDparseDirHTML.java	(revision 1338)
+++ /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDparseDirHTML.java	(revision 1339)
@@ -18,6 +18,11 @@
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 import java.util.logging.Level;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import de.ugoe.cs.autoquest.CommandHelpers;
@@ -48,15 +53,48 @@
     @Override
     public void run(List<Object> parameters) {
-        String path;
-        String sequencesName = "sequences";
+        String path = null;
+        String sequencesName = null;
+        Map<String, List<String>> parseParams = new HashMap<String, List<String>>();
 
         try {
-            path = (String) parameters.get(0);
-            if (parameters.size() >= 2) {
-                sequencesName = (String) parameters.get(1);
+            for (int i = 0; i < parameters.size(); i++) {
+                String param = (String) parameters.get(i);
+                if (!param.startsWith("-")) {
+                    if (path == null) {
+                        path = param;
+                    }
+                    else if (sequencesName == null) {
+                        sequencesName = param;
+                    }
+                }
+                else {
+                    Pattern parseParamPattern = Pattern.compile("-(\\w*)=([\\w=\\[\\]\\(\\)/]*)");
+                    Matcher matcher = parseParamPattern.matcher(param);
+                    
+                    if (matcher.matches()) {
+                        String key = matcher.group(1);
+                        List<String> values = parseParams.get(key);
+                        
+                        if (values == null) {
+                            values = new LinkedList<String>();
+                            parseParams.put(key, values);
+                        }
+                        
+                        values.add(matcher.group(2));
+                    }
+                    else {
+                        String message = "parse parameter does not follow format: -<key>=<value>";
+                        Console.printerrln(message);
+                        throw new IllegalArgumentException(message);
+                    }
+                }
             }
         }
         catch (Exception e) {
             throw new IllegalArgumentException("illegal parameters provided: " + e);
+        }
+        
+        if (sequencesName == null) {
+            sequencesName = "sequences";
         }
 
@@ -67,5 +105,5 @@
         }
 
-        HTMLLogParser parser = new HTMLLogParser();
+        HTMLLogParser parser = new HTMLLogParser(parseParams);
 
         parseFile(folder, parser);
@@ -123,5 +161,5 @@
     @Override
     public String help() {
-        return "parseDirHTML <directory> {<sequencesName>}";
+        return "parseDirHTML <directory> {<sequencesName>} {<clearId>} {<clearIndex>}";
     }
 
Index: /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDparseHTML.java
===================================================================
--- /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDparseHTML.java	(revision 1338)
+++ /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDparseHTML.java	(revision 1339)
@@ -16,5 +16,10 @@
 
 import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import de.ugoe.cs.autoquest.CommandHelpers;
@@ -43,18 +48,51 @@
     @Override
     public void run(List<Object> parameters) {
-        String filename;
-        String sequencesName = "sequences";
+        String filename = null;
+        String sequencesName = null;
+        Map<String, List<String>> parseParams = new HashMap<String, List<String>>();
 
         try {
-            filename = (String) parameters.get(0);
-            if (parameters.size() >= 2) {
-                sequencesName = (String) parameters.get(1);
+            for (int i = 0; i < parameters.size(); i++) {
+                String param = (String) parameters.get(i);
+                if (!param.startsWith("-")) {
+                    if (filename == null) {
+                        filename = param;
+                    }
+                    else if (sequencesName == null) {
+                        sequencesName = param;
+                    }
+                }
+                else {
+                    Pattern parseParamPattern = Pattern.compile("-(\\w*)=([\\w=\\[\\]\\(\\)/]*)");
+                    Matcher matcher = parseParamPattern.matcher(param);
+                    
+                    if (matcher.matches()) {
+                        String key = matcher.group(1);
+                        List<String> values = parseParams.get(key);
+                        
+                        if (values == null) {
+                            values = new LinkedList<String>();
+                            parseParams.put(key, values);
+                        }
+                        
+                        values.add(matcher.group(2));
+                    }
+                    else {
+                        String message = "parse parameter does not follow format: -<key>=<value>";
+                        Console.printerrln(message);
+                        throw new IllegalArgumentException(message);
+                    }
+                }
             }
         }
         catch (Exception e) {
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("illegal parameters provided: " + e);
         }
 
-        HTMLLogParser parser = new HTMLLogParser();
+        if (sequencesName == null) {
+            sequencesName = "sequences";
+        }
+
+        HTMLLogParser parser = new HTMLLogParser(parseParams);
 
         try {
Index: /trunk/autoquest-plugin-html/src/main/resources/manuals/parseDirHTML
===================================================================
--- /trunk/autoquest-plugin-html/src/main/resources/manuals/parseDirHTML	(revision 1339)
+++ /trunk/autoquest-plugin-html/src/main/resources/manuals/parseDirHTML	(revision 1339)
@@ -0,0 +1,15 @@
+Treats all files in a directory structure as HTML log files and parses them into event sequences and a GUI model. Also sub directories are parsed.
+
+The parsing process can be parameterized. This allows to ignore ids or indexes of GUI elements in the log files. If they are ignored, the GUI model is more harmonized and GUI elements are considered equal although they are not. This may be helpful, e.g., if you have a table where each row is semantically the same. Without ignoring indexes or ids of the rows, each row is treated separately. But with ignored indexes or ids, all rows are considered the same.
+
+To ignore the indexes, add -clearIndex=<path to GUI element> as parameter to the command call. To ignore ids, add -clearId=<path to GUI element> to the command call. The path to the GUI element is written using the HTML tag names and either their index or their id as identification. E.g., to denote all rows in a table where the table has the id "table_1" you can specify "table(htmlId=table_1)/tbody/tr". To denote e.g. all divs being the child of a div with an index 1, you specify "div[1]/div".  
+
+$USAGE$
+<directory> path to the directory 
+[<sequenceNames>] array of sequences into which the parsed events shall be stored
+[<clearId>] used to define GUI elements of which the ids shall be ignored
+[<clearIndex>] used to define GUI elements of which the indexes shall be ignored
+
+Example(s):
+parseDirHTML /path/to/directory
+parseDirHTML /path/to/directory sequences -clearId=table(htmlId=overview)/tbody[0]/tr
Index: /trunk/autoquest-plugin-html/src/main/resources/manuals/parseHTML
===================================================================
--- /trunk/autoquest-plugin-html/src/main/resources/manuals/parseHTML	(revision 1339)
+++ /trunk/autoquest-plugin-html/src/main/resources/manuals/parseHTML	(revision 1339)
@@ -0,0 +1,15 @@
+Parses an HTML log file them into an event sequence and a GUI model.
+
+The parsing process can be parameterized. This allows to ignore ids or indexes of GUI elements in the log files. If they are ignored, the GUI model is more harmonized and GUI elements are considered equal although they are not. This may be helpful, e.g., if you have a table where each row is semantically the same. Without ignoring indexes or ids of the rows, each row is treated separately. But with ignored indexes or ids, all rows are considered the same.
+
+To ignore the indexes, add -clearIndex=<path to GUI element> as parameter to the command call. To ignore ids, add -clearId=<path to GUI element> to the command call. The path to the GUI element is written using the HTML tag names and either their index or their id as identification. E.g., to denote all rows in a table where the table has the id "table_1" you can specify "table(htmlId=table_1)/tbody/tr". To denote e.g. all divs being the child of a div with an index 1, you specify "div[1]/div".  
+
+$USAGE$
+<file> path to the file to be parsed 
+[<sequenceNames>] array of sequences into which the parsed events shall be stored
+[<clearId>] used to define GUI elements of which the ids shall be ignored
+[<clearIndex>] used to define GUI elements of which the indexes shall be ignored
+
+Example(s):
+parseDirHTML /path/to/file.log
+parseDirHTML /path/to/file.log sequences -clearId=table(htmlId=overview)/tbody[0]/tr
