Index: /trunk/autoquest-htmlmonitor-test/src/test/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorTest.java
===================================================================
--- /trunk/autoquest-htmlmonitor-test/src/test/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorTest.java	(revision 1495)
+++ /trunk/autoquest-htmlmonitor-test/src/test/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorTest.java	(revision 1496)
@@ -19,5 +19,4 @@
 import java.io.File;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -152,5 +151,5 @@
         assertTrue(logFile.exists());
         
-        HTMLLogParser parser = new HTMLLogParser(new HashMap<String, List<String>>());
+        HTMLLogParser parser = new HTMLLogParser(null);
         
         parser.parseFile(logFile);
@@ -368,5 +367,5 @@
         assertTrue(logFile.exists());
         
-        HTMLLogParser parser = new HTMLLogParser(new HashMap<String, List<String>>());
+        HTMLLogParser parser = new HTMLLogParser(null);
         
         parser.parseFile(logFile);
@@ -526,5 +525,5 @@
         htmlMonitor = null;
         
-        HTMLLogParser parser = new HTMLLogParser(new HashMap<String, List<String>>());
+        HTMLLogParser parser = new HTMLLogParser(null);
         
         // assert 9 already rotated log files
@@ -685,5 +684,5 @@
         assertTrue(logFile2.exists());
          
-        HTMLLogParser parser = new HTMLLogParser(new HashMap<String, List<String>>());
+        HTMLLogParser parser = new HTMLLogParser(null);
         
         parser.parseFile(logFile1);
Index: /trunk/autoquest-plugin-html-test/src/test/java/de/ugoe/cs/autoquest/plugin/html/HTMLLogParserTest.java
===================================================================
--- /trunk/autoquest-plugin-html-test/src/test/java/de/ugoe/cs/autoquest/plugin/html/HTMLLogParserTest.java	(revision 1495)
+++ /trunk/autoquest-plugin-html-test/src/test/java/de/ugoe/cs/autoquest/plugin/html/HTMLLogParserTest.java	(revision 1496)
@@ -18,12 +18,12 @@
 
 import java.io.File;
+import java.io.FileOutputStream;
+import java.io.PrintWriter;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.Iterator;
-import java.util.LinkedList;
 import java.util.List;
-import java.util.Map;
 import java.util.logging.Level;
 
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -42,255 +42,266 @@
 public class HTMLLogParserTest {
 
-    /**
-    *
-    */
-   @Before
-   public void setUp() {
-       new TextConsole(Level.FINEST);
-   }
-
-   /**
-    * Tests the parseFile method with a given trace file.
-    * @throws Exception
-    */
-   @Test
-   public void testParseFile_1() throws Exception {
-       HTMLLogParser parser = new HTMLLogParser(new HashMap<String, List<String>>());
-       parser.parseFile
-           (new File(ClassLoader.getSystemResource("htmlmonitor_testtrace_1.xml").getFile()));
-       Collection<List<Event>> events = parser.getSequences();
-
-       assertNotNull(events);
-       assertEquals(1, events.size());
-       
-       Iterator<List<Event>> iterator = events.iterator();
-       assertNotNull(iterator);
-       assertEquals(1, iterator.next().size());
-       assertFalse(iterator.hasNext());
-
-       System.err.println("{");
-       for (List<Event> session : events) {
-           System.err.println("  {");
-           for (Event event : session) {
-               System.err.print("    ");
-               System.err.print(event);
-               System.err.println(",");
-           }
-           System.err.println("  }");
-       }
-       System.err.println("}");
-       System.err.println("\n\n");
-
-       GUIModel guiModel = parser.getGuiModel();
-       assertNotNull(guiModel);
-
-       for (IGUIElement root : guiModel.getRootElements()) {
-           dumpGUIElement(root, guiModel, "");
-       }
-   }
-
-   /**
-    * Tests the parseFile method with a given trace file.
-    * @throws Exception
-    */
-   @Test
-   public void testParseFile_2() throws Exception {
-       HTMLLogParser parser = new HTMLLogParser(new HashMap<String, List<String>>());
-       parser.parseFile
-           (new File(ClassLoader.getSystemResource("htmlmonitor_testtrace_2.xml").getFile()));
-       Collection<List<Event>> events = parser.getSequences();
-
-       assertNotNull(events);
-       assertEquals(1, events.size());
-       
-       Iterator<List<Event>> iterator = events.iterator();
-       assertNotNull(iterator);
-       assertEquals(2, iterator.next().size());
-       assertFalse(iterator.hasNext());
-
-       System.err.println("{");
-       for (List<Event> session : events) {
-           System.err.println("  {");
-           for (Event event : session) {
-               System.err.print("    ");
-               System.err.print(event);
-               System.err.println(",");
-           }
-           System.err.println("  }");
-       }
-       System.err.println("}");
-       System.err.println("\n\n");
-
-       GUIModel guiModel = parser.getGuiModel();
-       assertNotNull(guiModel);
-
-       for (IGUIElement root : guiModel.getRootElements()) {
-           dumpGUIElement(root, guiModel, "");
-       }
-   }
-
-   /**
-    * Tests the parseFile method with a given trace file.
-    * @throws Exception
-    */
-   @Test
-   public void testParseFile_3() throws Exception {
-       Map<String, List<String>> params = new HashMap<String, List<String>>();
-       List<String> list = new LinkedList<String>();
-       list.add("td[2]");
-       list.add("th");
-       params.put("clearIndex", list);
-       HTMLLogParser parser = new HTMLLogParser(params);
-       
-       parser.parseFile
-           (new File(ClassLoader.getSystemResource("htmlmonitor_testtrace_3.xml").getFile()));
-       Collection<List<Event>> events = parser.getSequences();
-
-       assertNotNull(events);
-       assertEquals(1, events.size());
-       
-       Iterator<List<Event>> iterator = events.iterator();
-       assertNotNull(iterator);
-       assertEquals(2, iterator.next().size());
-       assertFalse(iterator.hasNext());
-
-       System.err.println("{");
-       for (List<Event> session : events) {
-           System.err.println("  {");
-           for (Event event : session) {
-               System.err.print("    ");
-               System.err.print(event);
-               System.err.println(",");
-           }
-           System.err.println("  }");
-       }
-       System.err.println("}");
-       System.err.println("\n\n");
-
-       GUIModel guiModel = parser.getGuiModel();
-       assertNotNull(guiModel);
-
-       for (IGUIElement root : guiModel.getRootElements()) {
-           dumpGUIElement(root, guiModel, "");
-       }
-   }
-
-   /**
-    * Tests the parseFile method with a given trace file.
-    * @throws Exception
-    */
-   @Test
-   public void testParseFile_4() throws Exception {
-       Map<String, List<String>> params = new HashMap<String, List<String>>();
-       List<String> list = new LinkedList<String>();
-       list.add("html/body[1]/h1");
-       params.put("clearId", list);
-       HTMLLogParser parser = new HTMLLogParser(params);
-       
-       parser.parseFile
-           (new File(ClassLoader.getSystemResource("htmlmonitor_testtrace_4.xml").getFile()));
-       Collection<List<Event>> events = parser.getSequences();
-
-       assertNotNull(events);
-       assertEquals(1, events.size());
-       
-       Iterator<List<Event>> iterator = events.iterator();
-       assertNotNull(iterator);
-       assertEquals(2, iterator.next().size());
-       assertFalse(iterator.hasNext());
-
-       System.err.println("{");
-       for (List<Event> session : events) {
-           System.err.println("  {");
-           for (Event event : session) {
-               System.err.print("    ");
-               System.err.print(event);
-               System.err.println(",");
-           }
-           System.err.println("  }");
-       }
-       System.err.println("}");
-       System.err.println("\n\n");
-
-       GUIModel guiModel = parser.getGuiModel();
-       assertNotNull(guiModel);
-
-       for (IGUIElement root : guiModel.getRootElements()) {
-           dumpGUIElement(root, guiModel, "");
-       }
-   }
-
-   /**
-    * Tests the parseFile method with a given trace file.
-    * @throws Exception
-    */
-   @Test
-   public void testParseFile_5() throws Exception {
-       Map<String, List<String>> params = new HashMap<String, List<String>>();
-       List<String> list = new LinkedList<String>();
-       list.add("html/body[1]/h1(htmlId=id_h1)");
-       params.put("clearId", list);
-       HTMLLogParser parser = new HTMLLogParser(params);
-       
-       parser.parseFile
-           (new File(ClassLoader.getSystemResource("htmlmonitor_testtrace_4.xml").getFile()));
-       Collection<List<Event>> events = parser.getSequences();
-
-       assertNotNull(events);
-       assertEquals(1, events.size());
-       
-       Iterator<List<Event>> iterator = events.iterator();
-       assertNotNull(iterator);
-       assertEquals(2, iterator.next().size());
-       assertFalse(iterator.hasNext());
-
-       System.err.println("{");
-       for (List<Event> session : events) {
-           System.err.println("  {");
-           for (Event event : session) {
-               System.err.print("    ");
-               System.err.print(event);
-               System.err.println(",");
-           }
-           System.err.println("  }");
-       }
-       System.err.println("}");
-       System.err.println("\n\n");
-
-       GUIModel guiModel = parser.getGuiModel();
-       assertNotNull(guiModel);
-
-       for (IGUIElement root : guiModel.getRootElements()) {
-           dumpGUIElement(root, guiModel, "");
-       }
-   }
-
-   /**
-    * Helper method to print out GUIElements
-    * @param guiElement
-    * @param guiModel
-    * @param indent
-    */
-   private void dumpGUIElement(IGUIElement guiElement, GUIModel guiModel, String indent) {
-       assertTrue(guiElement instanceof HTMLGUIElement);
-
-       System.err.print(indent);
-       System.err.print(guiElement);
-
-       List<IGUIElement> children = guiModel.getChildren(guiElement);
-
-       if ((children != null) && (children.size() > 0)) {
-           System.err.println(" {");
-
-           for (IGUIElement child : children) {
-               dumpGUIElement(child, guiModel, indent + "  ");
-           }
-
-           System.err.print(indent);
-           System.err.print("}");
-       }
-
-       System.err.println();
-   }
+    /** */
+    private static final String PARSE_PARAM_FILE = "tmpParseParamFile";
+    
+    /**
+     *
+     */
+    @Before
+    public void setUp() {
+        new TextConsole(Level.FINEST);
+    }
+
+    /**
+     *
+     */
+    @After
+    public void tearDown() {
+        new File(PARSE_PARAM_FILE).delete();
+    }
+
+    /**
+     * Tests the parseFile method with a given trace file.
+     * @throws Exception
+     */
+    @Test
+    public void testParseFile_1() throws Exception {
+        HTMLLogParser parser = new HTMLLogParser(null);
+        parser.parseFile
+        (new File(ClassLoader.getSystemResource("htmlmonitor_testtrace_1.xml").getFile()));
+        Collection<List<Event>> events = parser.getSequences();
+
+        assertNotNull(events);
+        assertEquals(1, events.size());
+
+        Iterator<List<Event>> iterator = events.iterator();
+        assertNotNull(iterator);
+        assertEquals(1, iterator.next().size());
+        assertFalse(iterator.hasNext());
+
+        System.err.println("{");
+        for (List<Event> session : events) {
+            System.err.println("  {");
+            for (Event event : session) {
+                System.err.print("    ");
+                System.err.print(event);
+                System.err.println(",");
+            }
+            System.err.println("  }");
+        }
+        System.err.println("}");
+        System.err.println("\n\n");
+
+        GUIModel guiModel = parser.getGuiModel();
+        assertNotNull(guiModel);
+
+        for (IGUIElement root : guiModel.getRootElements()) {
+            dumpGUIElement(root, guiModel, "");
+        }
+    }
+
+    /**
+     * Tests the parseFile method with a given trace file.
+     * @throws Exception
+     */
+    @Test
+    public void testParseFile_2() throws Exception {
+        HTMLLogParser parser = new HTMLLogParser(null);
+        parser.parseFile
+        (new File(ClassLoader.getSystemResource("htmlmonitor_testtrace_2.xml").getFile()));
+        Collection<List<Event>> events = parser.getSequences();
+
+        assertNotNull(events);
+        assertEquals(1, events.size());
+
+        Iterator<List<Event>> iterator = events.iterator();
+        assertNotNull(iterator);
+        assertEquals(2, iterator.next().size());
+        assertFalse(iterator.hasNext());
+
+        System.err.println("{");
+        for (List<Event> session : events) {
+            System.err.println("  {");
+            for (Event event : session) {
+                System.err.print("    ");
+                System.err.print(event);
+                System.err.println(",");
+            }
+            System.err.println("  }");
+        }
+        System.err.println("}");
+        System.err.println("\n\n");
+
+        GUIModel guiModel = parser.getGuiModel();
+        assertNotNull(guiModel);
+
+        for (IGUIElement root : guiModel.getRootElements()) {
+            dumpGUIElement(root, guiModel, "");
+        }
+    }
+
+    /**
+     * Tests the parseFile method with a given trace file.
+     * @throws Exception
+     */
+    @Test
+    public void testParseFile_3() throws Exception {
+        PrintWriter out = new PrintWriter(new FileOutputStream(new File(PARSE_PARAM_FILE)));
+        out.println("td[2]=CLEAR_INDEX");
+        out.println("th=CLEAR_INDEX");
+        out.close();
+
+        HTMLLogParser parser = new HTMLLogParser(PARSE_PARAM_FILE);
+
+        parser.parseFile
+        (new File(ClassLoader.getSystemResource("htmlmonitor_testtrace_3.xml").getFile()));
+        Collection<List<Event>> events = parser.getSequences();
+
+        assertNotNull(events);
+        assertEquals(1, events.size());
+
+        Iterator<List<Event>> iterator = events.iterator();
+        assertNotNull(iterator);
+        assertEquals(2, iterator.next().size());
+        assertFalse(iterator.hasNext());
+
+        System.err.println("{");
+        for (List<Event> session : events) {
+            System.err.println("  {");
+            for (Event event : session) {
+                System.err.print("    ");
+                System.err.print(event);
+                System.err.println(",");
+            }
+            System.err.println("  }");
+        }
+        System.err.println("}");
+        System.err.println("\n\n");
+
+        GUIModel guiModel = parser.getGuiModel();
+        assertNotNull(guiModel);
+
+        for (IGUIElement root : guiModel.getRootElements()) {
+            dumpGUIElement(root, guiModel, "");
+        }
+    }
+
+    /**
+     * Tests the parseFile method with a given trace file.
+     * @throws Exception
+     */
+    @Test
+    public void testParseFile_4() throws Exception {
+        PrintWriter out = new PrintWriter(new FileOutputStream(new File(PARSE_PARAM_FILE)));
+        out.println("html/body[1]/h1=");
+        out.close();
+
+        HTMLLogParser parser = new HTMLLogParser(PARSE_PARAM_FILE);
+
+        parser.parseFile
+        (new File(ClassLoader.getSystemResource("htmlmonitor_testtrace_4.xml").getFile()));
+        Collection<List<Event>> events = parser.getSequences();
+
+        assertNotNull(events);
+        assertEquals(1, events.size());
+
+        Iterator<List<Event>> iterator = events.iterator();
+        assertNotNull(iterator);
+        assertEquals(2, iterator.next().size());
+        assertFalse(iterator.hasNext());
+
+        System.err.println("{");
+        for (List<Event> session : events) {
+            System.err.println("  {");
+            for (Event event : session) {
+                System.err.print("    ");
+                System.err.print(event);
+                System.err.println(",");
+            }
+            System.err.println("  }");
+        }
+        System.err.println("}");
+        System.err.println("\n\n");
+
+        GUIModel guiModel = parser.getGuiModel();
+        assertNotNull(guiModel);
+
+        for (IGUIElement root : guiModel.getRootElements()) {
+            dumpGUIElement(root, guiModel, "");
+        }
+    }
+
+    /**
+     * Tests the parseFile method with a given trace file.
+     * @throws Exception
+     */
+    @Test
+    public void testParseFile_5() throws Exception {
+        PrintWriter out = new PrintWriter(new FileOutputStream(new File(PARSE_PARAM_FILE)));
+        out.println("html/body[1]/h1(htmlId\\=id_h1)=");
+        out.close();
+        
+        HTMLLogParser parser = new HTMLLogParser(PARSE_PARAM_FILE);
+
+        parser.parseFile
+        (new File(ClassLoader.getSystemResource("htmlmonitor_testtrace_4.xml").getFile()));
+        Collection<List<Event>> events = parser.getSequences();
+
+        assertNotNull(events);
+        assertEquals(1, events.size());
+
+        Iterator<List<Event>> iterator = events.iterator();
+        assertNotNull(iterator);
+        assertEquals(2, iterator.next().size());
+        assertFalse(iterator.hasNext());
+
+        System.err.println("{");
+        for (List<Event> session : events) {
+            System.err.println("  {");
+            for (Event event : session) {
+                System.err.print("    ");
+                System.err.print(event);
+                System.err.println(",");
+            }
+            System.err.println("  }");
+        }
+        System.err.println("}");
+        System.err.println("\n\n");
+
+        GUIModel guiModel = parser.getGuiModel();
+        assertNotNull(guiModel);
+
+        for (IGUIElement root : guiModel.getRootElements()) {
+            dumpGUIElement(root, guiModel, "");
+        }
+    }
+
+    /**
+     * Helper method to print out GUIElements
+     * @param guiElement
+     * @param guiModel
+     * @param indent
+     */
+    private void dumpGUIElement(IGUIElement guiElement, GUIModel guiModel, String indent) {
+        assertTrue(guiElement instanceof HTMLGUIElement);
+
+        System.err.print(indent);
+        System.err.print(guiElement);
+
+        List<IGUIElement> children = guiModel.getChildren(guiElement);
+
+        if ((children != null) && (children.size() > 0)) {
+            System.err.println(" {");
+
+            for (IGUIElement child : children) {
+                dumpGUIElement(child, guiModel, indent + "  ");
+            }
+
+            System.err.print(indent);
+            System.err.print("}");
+        }
+
+        System.err.println();
+    }
 
 }
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 1495)
+++ /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/HTMLLogParser.java	(revision 1496)
@@ -19,6 +19,6 @@
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.util.Arrays;
 import java.util.HashMap;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -35,4 +35,5 @@
 import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement;
 import de.ugoe.cs.autoquest.plugin.html.eventcore.HTMLEventTypeFactory;
+import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLDocument;
 import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLDocumentSpec;
 import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement;
@@ -48,5 +49,5 @@
  * </p>
  * <p>
- * The parser can be configured with parsing parameters to ignore, e.g., ids or indexes of
+ * The parser can be configured with parsing parameters to adapt, e.g., ids or or ignore indexes of
  * parsed GUI elements. Details can be found in the manual pages of the respective parsing commands.
  * </p>
@@ -68,16 +69,8 @@
     /**
      * <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;
+     * file containing parameters to influence parsing
+     * </p>
+     */
+    private String parseParamFile;
 
     /**
@@ -86,23 +79,15 @@
      * </p>
      */
-    private Map<String, String> idReplacements;
-
-    /**
-     * <p>
-     * initializes the parser with the parsing parameters to be considered
+    private Map<String, List<ReplacementSpecification>> replacementSpecifications;
+
+    /**
+     * <p>
+     * initializes the parser with the file containing parsing parameters to be considered
      * </p>
      *
-     * @param parseParams the parsing parameters to be considered
-     */
-    public HTMLLogParser(Map<String, List<String>> parseParams) {
-        this.parseParams = parseParams;
-        
-        for (String paramKey : parseParams.keySet()) {
-            if (!"clearId".equals(paramKey) && !"clearIndex".equals(paramKey) &&
-                !"idReplacements".equals(paramKey))
-            {
-                throw new IllegalArgumentException("unknown parse parameter key " + paramKey);
-            }
-        }
+     * @param parseParamFile the parsing parameters to be considered
+     */
+    public HTMLLogParser(String parseParamFile) {
+        this.parseParamFile = parseParamFile;
     }
 
@@ -114,4 +99,6 @@
         throws SAXException
     {
+        ensureParsingParameters();
+        
         HTMLGUIElementSpec specification = null;
         
@@ -182,14 +169,22 @@
                 String htmlId = parameters.get("htmlid");
                 
-                if (clearIndex(tagName, index, htmlId, parent)) {
-                    index = -1;
-                }
-                
-                String idReplacement = replaceHTMLId(tagName, index, htmlId, parent);
-                if (idReplacement != null) {
-                    htmlId = idReplacement;
-                }
-                else if (clearHTMLId(tagName, index, htmlId, parent)) {
-                    htmlId = null;
+                String replacement = getReplacementMapping(tagName, index, htmlId, parent);
+                
+                if (replacement != null) {
+                    if (replacement.startsWith("CLEAR_INDEX,")) {
+                        index = -1;
+                        replacement = replacement.substring("CLEAR_INDEX,".length());
+                    }
+                    else if ("CLEAR_INDEX".equals(replacement)) {
+                        index = -1;
+                        replacement = htmlId;
+                    }
+                    
+                    if ("".equals(replacement)) {
+                        htmlId = null;
+                    }
+                    else {
+                        htmlId = replacement;
+                    }
                 }
                 
@@ -226,52 +221,113 @@
         }
     }
-
-    /**
-     * <p>
-     * checks if for a specific GUI element the index shall be ignored or not by considering the
-     * parsing parameters.
+    
+    /**
+     * <p>
+     * returns the replacement mapping for the tag specified by the parameters, if a mapping exists.
      * </p>
      *
-     * @param tagName the tag of the considered GUI element
-     * @param index   the index of the GUI element
-     * @param id      the id of the GUI element
-     * @param parent  the parent GUI element of the considered GUI element
+     * @param tagName      the tag of the considered GUI element
+     * @param index        the index of the GUI element
+     * @param id           the id of the GUI element
+     * @param parent       the parent GUI element of the considered GUI element
      * 
-     * @return true if the index shall be ignored, false else.
-     */
-    private boolean clearIndex(String tagName, int index, String id, HTMLGUIElement parent) {
-        return clearSomething("clearIndex", tagName, index, id, parent);
-    }
-
-    /**
-     * <p>
-     * checks if the parsing parameters define a replacement for the id of the given GUI element
-     * and if so returns this replacement
-     * </p>
-     *
-     * @param tagName the tag of the considered GUI element
-     * @param index   the index of the GUI element
-     * @param id      the id of the GUI element
-     * @param parent  the parent GUI element of the considered GUI element
-     * 
-     * @return the identified replacement
-     */
-    private String replaceHTMLId(String tagName, int index, String htmlId, HTMLGUIElement parent)
-        throws SAXException
+     * @return the replacement mapping, if any is configured; null else
+     */
+    private String getReplacementMapping(String         tagName,
+                                         int            index,
+                                         String         htmlId,
+                                         HTMLGUIElement parent)
     {
-        if ((idReplacements == null) && (parseParams.containsKey("idReplacements"))) {
-            idReplacements = new HashMap<String, String>();
-            for (String fileName : parseParams.get("idReplacements")) {
+        List<ReplacementSpecification> mappingCandidates = replacementSpecifications.get(tagName);
+        
+        if (mappingCandidates != null) {
+            for (ReplacementSpecification replacementSpec : mappingCandidates) {
+                if (replacementSpec.matches(tagName, index, htmlId, parent)) {
+                    return replacementSpec.getReplacement();
+                }
+            }
+        }
+        
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see de.ugoe.cs.autoquest.plugin.html.AbstractDefaultLogParser#handleEvent(String, Map)
+     */
+    @Override
+    protected boolean handleEvent(String type, Map<String, String> parameters) throws SAXException {
+        String targetId = parameters.get("target");
+        
+        if (targetId == null) {
+            if (replacementSpecifications.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");
+            
+            if ((targetDocument == null) || (targetDOMPath == null)) {
+                throw new SAXException("event has no target defined");
+            }
+            
+            targetId = determineTargetId(targetDocument, targetDOMPath);
+            
+            if (targetId == null) {
+                // the target id can not be determined yet
+                return false;
+            }
+        }
+        
+        IGUIElement target = super.getGUIElementTree().find(targetId);
+        
+        if (target == null) {
+            // event not processible yet
+            return false;
+        }
+
+        IEventType eventType =
+            HTMLEventTypeFactory.getInstance().getEventType(type, parameters, target);
+        
+        if (eventType != null) {
+            Event event = new Event(eventType, target);
+
+            String timestampStr = parameters.get("timestamp");
+        
+            if (timestampStr != null) {
+                event.setTimestamp(Long.parseLong(timestampStr));
+            }
+
+            ((HTMLGUIElement) event.getTarget()).markUsed();
+        
+            super.addToSequence(event);
+        }
+        // else ignore unknown event type
+
+        return true;
+    }
+
+    /**
+     * <p>
+     * reads parsing parameters from the config file and makes them available for the parsing
+     * process
+     * </p>
+     */
+    private void ensureParsingParameters() throws SAXException {
+        if (replacementSpecifications == null) {
+            replacementSpecifications = new HashMap<String, List<ReplacementSpecification>>();
+            
+            if (parseParamFile != null) {
                 Properties props = new Properties();
                 FileInputStream stream = null;
                 try {
-                    stream = new FileInputStream(new File(fileName));
+                    stream = new FileInputStream(new File(parseParamFile));
                     props.load(stream);
                 }
                 catch (FileNotFoundException e) {
-                    throw new SAXException("could not find file " + fileName, e);
+                    throw new SAXException("could not find file " + parseParamFile, e);
                 }
                 catch (IOException e) {
-                    throw new SAXException("error reading file " + fileName, e);
+                    throw new SAXException("error reading file " + parseParamFile, e);
                 }
                 finally {
@@ -285,245 +341,23 @@
                     }
                 }
-                
+
                 for (Map.Entry<Object, Object> entry : props.entrySet()) {
-                    idReplacements.put((String) entry.getKey(), (String) entry.getValue());
-                }
-            }
-        }
-        
-        if (idReplacements != null) {
-            for (Map.Entry<String, String> replacementSpec : idReplacements.entrySet()) {
-                String tagSpec = replacementSpec.getKey();
-
-                if (tagSpec.startsWith("/")) {
-                    throw new IllegalArgumentException("can not handle absolute specifications");
-                }
-                else if (tagSpec.endsWith("/")) {
-                    throw new IllegalArgumentException("specifications may not end with a /");
-                }
-
-                String[] tagSpecs = tagSpec.split("/");
-
-                if (tagMatchesTagSpec(tagName, index, htmlId, parent, tagSpecs)) {
-                    return replacementSpec.getValue();
-                }
-            }
-        }
-        
-        return null;
-    }
-
-    /**
-     * <p>
-     * checks if for a specific GUI element the id shall be ignored or not by considering the
-     * parsing parameters.
-     * </p>
-     *
-     * @param tagName the tag of the considered GUI element
-     * @param index   the index of the GUI element
-     * @param id      the id of the GUI element
-     * @param parent  the parent GUI element of the considered GUI element
-     * 
-     * @return true if the id shall be ignored, false else.
-     */
-    private boolean clearHTMLId(String tagName, int index, String id, HTMLGUIElement parent) {
-        return clearSomething("clearId", tagName, index, id, parent);
+                    ReplacementSpecification replSpec = new ReplacementSpecification
+                        ((String) entry.getKey(), (String) entry.getValue());
+                    
+                    List<ReplacementSpecification> similarReplSpecs =
+                        replacementSpecifications.get(replSpec.getLastTagName());
+                    
+                    if (similarReplSpecs == null) {
+                        similarReplSpecs = new LinkedList<ReplacementSpecification>();
+                        replacementSpecifications.put(replSpec.getLastTagName(), similarReplSpecs);
+                    }
+                    
+                    similarReplSpecs.add(replSpec);
+                }
+            }
+        }
     }
     
-    /**
-     * <p>
-     * convenience method to check for the existence for specific parsing parameters for clearing
-     * ids or indexes of GUI elements.
-     * </p>
-     *
-     * @param parseParamId the id of the parsing parameter to be checked for the GUI element
-     * @param tagName      the tag of the considered GUI element
-     * @param index        the index of the GUI element
-     * @param id           the id of the GUI element
-     * @param parent       the parent GUI element of the considered GUI element
-     * 
-     * @return true if the denoted parse parameter is set to ignore, false else.
-     */
-    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>
-     * convenience method to check if a given GUI element matches a specification tags provided
-     * through the parsing parameters.
-     * </p>
-     *
-     * @param tagName  the tag of the considered GUI element
-     * @param index    the index of the GUI element
-     * @param id       the id of the GUI element
-     * @param parent   the parent GUI element of the considered GUI element
-     * @param tagSpecs the specification of a GUI element to match against the given GUI element
-     * 
-     * @return true if the denoted parse parameter is set to ignore, false else.
-     */
-    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)) {
-                    // check if the id condition would match with ignoring specific characters
-                    if ((id != null) && (idCondition.indexOf('#') > -1)) {
-                        // first of all, the length must match
-                        if (idCondition.length() != id.length()) {
-                            return false;
-                        }
-                        
-                        for (int i = 0; i < idCondition.length(); i++) {
-                            if ((idCondition.charAt(i) != '#') &&
-                                (idCondition.charAt(i) != id.charAt(i)))
-                            {
-                                // if there is a character that is neither ignored not matches
-                                // the condition at a specific position, return "no match"
-                                return false;
-                            }
-                        }
-                        
-                    }
-                    else {
-                        // no condition ignoring specific characters
-                        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)
-     */
-    @Override
-    protected boolean handleEvent(String type, Map<String, String> parameters) throws SAXException {
-        String targetId = parameters.get("target");
-        
-        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");
-            
-            if ((targetDocument == null) || (targetDOMPath == null)) {
-                throw new SAXException("event has no target defined");
-            }
-            
-            targetId = determineTargetId(targetDocument, targetDOMPath);
-            
-            if (targetId == null) {
-                // the target id can not be determined yet
-                return false;
-            }
-        }
-        
-        IGUIElement target = super.getGUIElementTree().find(targetId);
-        
-        if (target == null) {
-            // event not processible yet
-            return false;
-        }
-
-        IEventType eventType =
-            HTMLEventTypeFactory.getInstance().getEventType(type, parameters, target);
-        
-        if (eventType != null) {
-            Event event = new Event(eventType, target);
-
-            String timestampStr = parameters.get("timestamp");
-        
-            if (timestampStr != null) {
-                event.setTimestamp(Long.parseLong(timestampStr));
-            }
-
-            ((HTMLGUIElement) event.getTarget()).markUsed();
-        
-            super.addToSequence(event);
-        }
-        // else ignore unknown event type
-
-        return true;
-    }
-
     /**
      * <p>
@@ -647,3 +481,376 @@
     }
 
+    /**
+     * <p>specification for a replacement consisting of path of tag or document specifications
+     * and the appropriate replacement.</p>
+     */
+    private static class ReplacementSpecification {
+        
+        /**
+         * <p>
+         * the pattern used for parsing parsing parameters
+         * </p>
+         */
+        private Pattern htmlElementSpecPattern = Pattern.compile
+            ("(document\\(path=([\\w/-]+)\\))|((\\w+)(\\[(\\d+)\\]|\\(htmlId=([\\w-_#]+)\\))?)");
+        
+        /**
+         * <p>
+         * the path of specifications (tags and document) specifying the tag for which this
+         * replacement is specified
+         * </p>
+         */
+        private List<Spec> specs = new LinkedList<Spec>();
+        
+        /**
+         * <p>
+         * the name of the last tag in the specification path (used for indexing purposes)
+         * </p>
+         */
+        private String lastTagName;
+        
+        /**
+         * <p>
+         * the configured replacement
+         * </p>
+         */
+        private String replacement;
+
+        /**
+         * <p>
+         * initializes the specification with the key/value strings from the config file. Parses
+         * the key to get the specification path consisting of, optionally, a document
+         * specification and one or more tag specification.
+         * </p>
+         */
+        public ReplacementSpecification(String tagSpec, String replacement) {
+            List<String> tagSpecs = split(tagSpec);
+            
+            for (int i = 0; i < tagSpecs.size(); i++) {
+                Matcher matcher = htmlElementSpecPattern.matcher(tagSpecs.get(i));
+                
+                if (!matcher.matches()) {
+                    throw new IllegalArgumentException
+                        ("illegal tag specification " + tagSpecs.get(i));
+                }
+                
+                if (matcher.group(1) != null) {
+                    this.specs.add(new DocumentSpec(matcher.group(2)));
+                }
+                else if (matcher.group(4) != null) {
+                    String indexConditionStr = matcher.group(6);
+                    Integer indexCondition = null;
+                
+                    if (indexConditionStr != null) {
+                        try {
+                            indexCondition = Integer.parseInt(indexConditionStr);
+                        }
+                        catch (NumberFormatException e) {
+                            throw new IllegalArgumentException
+                                ("illegal tag index specification " + indexConditionStr, e);
+                        }
+                    }
+                
+                    this.specs.add
+                        (new TagSpec(matcher.group(4), indexCondition, matcher.group(7)));
+                }
+            }
+            
+            this.lastTagName = ((TagSpec) this.specs.get(this.specs.size() - 1)).getTagName();
+            
+            this.replacement = replacement;
+        }
+
+        /**
+         * <p>
+         * convenience method to split the key of a key/value pair from the config file into its
+         * parts
+         * </p>
+         */
+        private List<String> split(String tagSpec) {
+            List<String> specs = new LinkedList<String>();
+            
+            StringBuffer currentSpec = new StringBuffer();
+            int openBraces = 0;
+            
+            for (int i = 0; i < tagSpec.length(); i++) {
+                char curChar = tagSpec.charAt(i);
+                if ((openBraces == 0) && ('/' == curChar) && (currentSpec.length() > 0)) {
+                    specs.add(currentSpec.toString());
+                    currentSpec.setLength(0);
+                }
+                else {
+                    if ('(' == curChar) {
+                        openBraces++;
+                    }
+                    else if (')' == curChar) {
+                        openBraces--;
+                    }
+                    currentSpec.append(curChar);
+                }
+            }
+            
+            if (currentSpec.length() > 0) {
+                specs.add(currentSpec.toString());
+            }
+            
+            return specs;
+        }
+
+        /**
+         * <p>
+         * checks, if the tag identified by the parameters matches this specificaiton.
+         * </p>
+         */
+        private boolean matches(String tagName, int index, String htmlId, HTMLGUIElement parent) {
+            String currentTagName = tagName;
+            int currentIndex = index;
+            String currentHtmlId = htmlId;
+            String currentPath = null;
+            HTMLGUIElement currentParent = parent;
+            
+            int i = specs.size() - 1;
+            
+            while (i >= 0) {
+                if ((specs.get(i) instanceof TagSpec) &&
+                    (!((TagSpec) specs.get(i)).matches(currentTagName, currentIndex, currentHtmlId)))
+                {
+                    return false;
+                }
+                else if ((specs.get(i) instanceof DocumentSpec) &&
+                         (!((DocumentSpec) specs.get(i)).matches(currentPath)))
+                {
+                    return false;
+                }
+                
+                i--;
+                
+                if (i >= 0) {
+                    if (currentParent instanceof HTMLPageElement) {
+                        currentTagName = ((HTMLPageElement) currentParent).getTagName();
+                        currentIndex = ((HTMLPageElement) currentParent).getIndex();
+                        currentHtmlId = ((HTMLPageElement) currentParent).getHtmlId();
+                        currentPath = null;
+                        currentParent = (HTMLGUIElement) currentParent.getParent();
+                     }
+                    else if (currentParent instanceof HTMLDocument) {
+                        currentTagName = null;
+                        currentIndex = Integer.MIN_VALUE;
+                        currentHtmlId = null;
+                        currentPath = ((HTMLDocument) currentParent).getPath();
+                        currentParent = (HTMLGUIElement) currentParent.getParent();
+                    }
+                    else {
+                        throw new IllegalArgumentException
+                            ("specification matches documents or servers. This is not supported yet.");
+                    }
+                }
+            }
+            
+            return true;
+        }
+
+        /**
+         * <p>
+         * returns the specified replacement
+         * </p>
+         */
+        private String getReplacement() {
+            return replacement;
+        }
+
+        /**
+         * <p>
+         * returns the name of the last tag specified in the specification path
+         * </p>
+         */
+        private String getLastTagName() {
+            return lastTagName;
+        }
+
+        /* (non-Javadoc)
+         * @see java.lang.Object#toString()
+         */
+        @Override
+        public String toString() {
+            StringBuffer result = new StringBuffer();
+            for (Spec spec : specs) {
+                if (result.length() > 0) {
+                    result.append("/");
+                }
+                result.append(spec);
+            }
+            
+            result.append('=');
+            result.append(replacement);
+            
+            return result.toString();
+        }
+        
+    }
+
+    /**
+     * <p>
+     * parent type for document and tag specifications
+     * </p>
+     */
+    private static interface Spec { }
+
+    /**
+     * <p>
+     * specification of a document
+     * </p>
+     */
+    private static class DocumentSpec implements Spec {
+        
+        /**
+         * <p>
+         * the part of the path the document path must have to match this specification
+         * </p>
+         */
+        private String pathPart;
+
+        /**
+         * <p>
+         * initializes the document specification with the path part
+         * </p>
+         */
+        private DocumentSpec(String pathPart) {
+            this.pathPart = pathPart;
+        }
+
+        /**
+         * <p>
+         * returns true if the provided path contains the path part provided to the parameter
+         * </p>
+         */
+        private boolean matches(String path) {
+            return path.contains(pathPart);
+        }
+
+        /* (non-Javadoc)
+         * @see java.lang.Object#toString()
+         */
+        @Override
+        public String toString() {
+            return "document(path=" + pathPart + ")";
+        }
+    }
+
+    /**
+     * <p>
+     * specification for a tag containing a tag name and either an index or id condition.
+     * </p>
+     */
+    private static class TagSpec implements Spec {
+
+        /**
+         * <p>
+         * the name of the tag to match
+         * </p>
+         */
+        private String tagName;
+        
+        /**
+         * <p>
+         * the index of the tag to match
+         * </p>
+         */
+        private Integer indexCondition;
+        
+        /**
+         * <p>
+         * the id of the tag to match
+         * </p>
+         */
+        private String idCondition;
+
+        /**
+         * <p>
+         * initializes the specification with all required parameters
+         * </p>
+         */
+        private TagSpec(String tagName, Integer indexCondition, String idCondition) {
+            this.tagName = tagName;
+            this.indexCondition = indexCondition;
+            this.idCondition = idCondition;
+        }
+
+        /**
+         * <p>
+         * returns true if the provided tag information matches this specification. The id is
+         * checked first. If the id condition has a # at some position, the respective element
+         * of the provided id is ignored.
+         * </p>
+         */
+        private boolean matches(String tagName, int index, String htmlId) {
+            if (!this.tagName.equals(tagName)) {
+                return false;
+            }
+            
+            if (idCondition != null) {
+                if (!idCondition.equals(htmlId)) {
+                    // check if the id condition would match with ignoring specific characters
+                    if ((htmlId != null) && (idCondition.indexOf('#') > -1)) {
+                        // first of all, the length must match
+                        if (idCondition.length() != htmlId.length()) {
+                            return false;
+                        }
+                        
+                        for (int i = 0; i < idCondition.length(); i++) {
+                            if ((idCondition.charAt(i) != '#') &&
+                                (idCondition.charAt(i) != htmlId.charAt(i)))
+                            {
+                                // if there is a character that is neither ignored nor matches
+                                // the condition at a specific position, return "no match"
+                                return false;
+                            }
+                        }
+                        
+                    }
+                    else {
+                        // no condition ignoring specific characters
+                        return false;
+                    }
+                }
+            }
+            
+            if ((indexCondition != null) && (index != indexCondition)) {
+                return false;
+            }
+            
+            return true;
+        }
+
+        /**
+         * <p>
+         * returns the name of the tags matched by this specification
+         * </p>
+         */
+        private String getTagName() {
+            return tagName;
+        }
+
+        /* (non-Javadoc)
+         * @see java.lang.Object#toString()
+         */
+        @Override
+        public String toString() {
+            StringBuffer result = new StringBuffer(tagName);
+            
+            if (idCondition != null) {
+                result.append("(htmlId=");
+                result.append(idCondition);
+                result.append(')');
+            }
+            else if (indexCondition != null) {
+                result.append('[');
+                result.append(indexCondition);
+                result.append(']');
+            }
+            
+            return result.toString();
+        }
+        
+    }
 }
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 1495)
+++ /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDcorrectHTMLLogDirs.java	(revision 1496)
@@ -17,5 +17,4 @@
 import java.io.File;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.List;
 import java.util.logging.Level;
@@ -91,5 +90,5 @@
             String serverName = null;
             
-            HTMLLogParser parser = new HTMLLogParser(new HashMap<String, List<String>>());
+            HTMLLogParser parser = new HTMLLogParser(null);
             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 1495)
+++ /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDparseDirHTML.java	(revision 1496)
@@ -18,8 +18,5 @@
 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;
@@ -55,5 +52,5 @@
         String path = null;
         String sequencesName = null;
-        Map<String, List<String>> parseParams = new HashMap<String, List<String>>();
+        String parseParamFile = null;
 
         try {
@@ -69,20 +66,19 @@
                 }
                 else {
-                    Pattern parseParamPattern = Pattern.compile("-(\\w*)=([\\w=\\[\\]\\(\\)/\\.-]*)");
+                    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);
+                        if (!"parseParamFile".equals(key)) {
+                            String message = "unknown parameter: " + key;
+                            Console.printerrln(message);
+                            throw new IllegalArgumentException(message);
                         }
                         
-                        values.add(matcher.group(2));
+                        parseParamFile = matcher.group(2);
                     }
                     else {
-                        String message = "parse parameter does not follow format: -<key>=<value>";
+                        String message = "parameter does not follow format: -<key>=<value>";
                         Console.printerrln(message);
                         throw new IllegalArgumentException(message);
@@ -105,5 +101,5 @@
         }
 
-        HTMLLogParser parser = new HTMLLogParser(parseParams);
+        HTMLLogParser parser = new HTMLLogParser(parseParamFile);
 
         parseFile(folder, parser);
@@ -161,7 +157,5 @@
     @Override
     public String help() {
-        return "parseDirHTML <directory> [<sequencesName>] " +
-            "{-idReplacements=path/to/replacementfile} {-clearId=path/to[0]/gui(htmlId=element)} " +
-            "{-clearIndex=path/to[0]/gui(htmlId=element)}";
+        return "parseDirHTML <directory> [<sequencesName>] {-parseParams=path/to/parseParamsFile}";
     }
 
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 1495)
+++ /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDparseHTML.java	(revision 1496)
@@ -16,8 +16,5 @@
 
 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;
@@ -50,5 +47,5 @@
         String filename = null;
         String sequencesName = null;
-        Map<String, List<String>> parseParams = new HashMap<String, List<String>>();
+        String parseParamFile = null;
 
         try {
@@ -64,20 +61,19 @@
                 }
                 else {
-                    Pattern parseParamPattern = Pattern.compile("-(\\w*)=([\\w=\\[\\]\\(\\)/\\.-]*)");
+                    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);
+                        if (!"parseParamFile".equals(key)) {
+                            String message = "unknown parameter: " + key;
+                            Console.printerrln(message);
+                            throw new IllegalArgumentException(message);
                         }
                         
-                        values.add(matcher.group(2));
+                        parseParamFile = matcher.group(2);
                     }
                     else {
-                        String message = "parse parameter does not follow format: -<key>=<value>";
+                        String message = "parameter does not follow format: -<key>=<value>";
                         Console.printerrln(message);
                         throw new IllegalArgumentException(message);
@@ -94,5 +90,5 @@
         }
 
-        HTMLLogParser parser = new HTMLLogParser(parseParams);
+        HTMLLogParser parser = new HTMLLogParser(parseParamFile);
 
         try {
@@ -124,7 +120,5 @@
     @Override
     public String help() {
-        return "parseHTML <filename> [<sequencesName>] " +
-            "{-idReplacements=path/to/replacementfile} {-clearId=path/to[0]/gui(htmlId=element)} " +
-            "{-clearIndex=path/to[0]/gui(htmlId=element)}";
+        return "parseHTML <filename> [<sequencesName>] {-parseParams=path/to/parseParamsFile}";
     }
 
Index: /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageElement.java
===================================================================
--- /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageElement.java	(revision 1495)
+++ /trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageElement.java	(revision 1496)
@@ -90,5 +90,5 @@
         }
         else if (otherElement instanceof HTMLPageElement) {
-            if (this == otherElement) {
+            if (equals(otherElement)) {
                 return DISTANCE_NONE;
             }
Index: /trunk/autoquest-plugin-html/src/main/resources/manuals/parseDirHTML
===================================================================
--- /trunk/autoquest-plugin-html/src/main/resources/manuals/parseDirHTML	(revision 1495)
+++ /trunk/autoquest-plugin-html/src/main/resources/manuals/parseDirHTML	(revision 1496)
@@ -1,14 +1,36 @@
 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 replace or ignore ids or indexes of GUI elements in the log files. If they are replaced or 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 replacing or ignoring indexes or ids of the rows, each row is treated separately. But with replaced or ignored indexes or ids, all rows are considered the same.
+The parsing process can be parameterized. This allows to replace ids or ignore indexes of GUI elements in the log files. If they are replaced or 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 or replaced 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".  
+The parameterization is done in a separate properties file. The keys in the file specify the tags for which either the id shall be replaced or the index shall be ignored. A specification for a simple tag either simply by its name, by its name and index or by its name and id looks as follows:
 
-To replace ids, a separate files with mappings must be created. The path to this file must be provided using the idReplacements parameter. The file follows a typical properties format. The key is the path denoting the GUI element of which the id shall be set. The value is the actual id. The key may contain the # character to denote a wildcard in html ids. This allows matching several GUI elements with similar ids at once and to give them the same id. An example entry of this file is:
+tagName
+tagName[index]
+tagName(htmlId\=id)
 
-div(htmlId\=id_number_#)=div_number_X
+Furthermore, tags can be specified as paths through the DOM in that several tags specifications are given and concatenated using /. An example with three specified tag (tag1 with index 5, tag 2, and tag 3 with id "id") is the following:
 
-This line would give all divs with an id "id_number_#" where # denotes any character the new id "div_number_X". Please note that for specifying the keys, it is required to escape any = sign in the key specification. This is usually required if the path to the denoted GUI elements denotes elements by their id as shown in the example.
+tag1[5]/tag2/tag3(htmlId\=id)
 
+The specification of a tag id may contain the # character to denote a wildcard. This allows matching several GUI elements with similar ids at once and to give them the same id. An example entry of this is:
+
+div(htmlId\=id_number_#)
+
+This line would match all divs with an id starting with "id_number_" where # denotes any character.
+
+It is also possible to specify the document in which the tag path should match. A document is specified by giving a part of the documents path in the URL. After the document specification, the full path to the specified tag must be given. An example is the following:
+
+document(path\=accounts)/html/body/div[0]/ul/li(htmlId\=breadcrumb1)/a
+
+Please note that for specifying the keys, it is required to escape any = sign in the key specification. This is usually required if the path to the denoted GUI elements denotes elements by their id as shown in the example.
+
+To remove the id of a specified tag, the value must be empty. To set the id, the value must the id the tag shall have. To clear the index of the specified tag, that value must be CLEAR_INDEX. Here are some further example entries:
+
+body/div/div/div/form=
+body/p/small/a=imprint-link
+document(path\=accounts/login)/html/body/div[0]/div[1]/div[0]/form/p/a=password-reset-link
+document(path\=accounts/login)/html/body/div[0]/div[1]/div[0]/form/div/button=CLEAR_INDEX
+body/div[5]=date-chooser
+div(htmlId\=date-chooser)/div[0]=date-chooser_day
 
 
@@ -19,13 +41,8 @@
 [<sequenceNames>]
     array of sequences into which the parsed events shall be stored
-{-idReplacements=path/to/replacementfile}
+{-parseParams=path/to/replacementfile}
     used to define id replacements as described in a separate file
-{-clearId=path/to[0]/gui(htmlId=element)}
-    used to define GUI elements of which the ids shall be ignored
-{-clearIndex=path/to[0]/gui(htmlId=element)}
-    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
-parseDirHTML /path/to/directory sequences -idReplacements=idReplacements.txt -clearId=body
+parseDirHTML /path/to/directory sequences -parseParams=idReplacements.txt
Index: /trunk/autoquest-plugin-html/src/main/resources/manuals/parseHTML
===================================================================
--- /trunk/autoquest-plugin-html/src/main/resources/manuals/parseHTML	(revision 1495)
+++ /trunk/autoquest-plugin-html/src/main/resources/manuals/parseHTML	(revision 1496)
@@ -1,15 +1,36 @@
 Parses an HTML log file them into an event sequence and a GUI model.
 
-The parsing process can be parameterized. This allows to replace or ignore ids or indexes of GUI elements in the log files. If they are replaced or 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 or replaced indexes or ids, all rows are considered the same.
+The parsing process can be parameterized. This allows to replace ids or ignore indexes of GUI elements in the log files. If they are replaced or 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 or replaced 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".  
+The parameterization is done in a separate properties file. The keys in the file specify the tags for which either the id shall be replaced or the index shall be ignored. A specification for a simple tag either simply by its name, by its name and index or by its name and id looks as follows:
 
-To replace ids, a separate files with mappings must be created. The path to this file must be provided using the idReplacements parameter. The file follows a typical properties format. The key is the path denoting the GUI element of which the id shall be set. The value is the actual id. The key may contain the # character to denote a wildcard in html ids. This allows matching several GUI elements with similar ids at once and to give them the same id. An example entry of this file is:
+tagName
+tagName[index]
+tagName(htmlId\=id)
 
-div(htmlId\=id_number_#)=div_number_X
+Furthermore, tags can be specified as paths through the DOM in that several tags specifications are given and concatenated using /. An example with three specified tag (tag1 with index 5, tag 2, and tag 3 with id "id") is the following:
 
-This line would give all divs with an id "id_number_#" where # denotes any character the new id "div_number_X". Please note that for specifying the keys, it is required to escape any = sign in the key specification. This is usually required if the path to the denoted GUI elements denotes elements by their id as shown in the example.
+tag1[5]/tag2/tag3(htmlId\=id)
 
+The specification of a tag id may contain the # character to denote a wildcard. This allows matching several GUI elements with similar ids at once and to give them the same id. An example entry of this is:
 
+div(htmlId\=id_number_#)
+
+This line would match all divs with an id starting with "id_number_" where # denotes any character.
+
+It is also possible to specify the document in which the tag path should match. A document is specified by giving a part of the documents path in the URL. After the document specification, the full path to the specified tag must be given. An example is the following:
+
+document(path\=accounts)/html/body/div[0]/ul/li(htmlId\=breadcrumb1)/a
+
+Please note that for specifying the keys, it is required to escape any = sign in the key specification. This is usually required if the path to the denoted GUI elements denotes elements by their id as shown in the example.
+
+To remove the id of a specified tag, the value must be empty. To set the id, the value must the id the tag shall have. To clear the index of the specified tag, that value must be CLEAR_INDEX. Here are some further example entries:
+
+body/div/div/div/form=
+body/p/small/a=imprint-link
+document(path\=accounts/login)/html/body/div[0]/div[1]/div[0]/form/p/a=password-reset-link
+document(path\=accounts/login)/html/body/div[0]/div[1]/div[0]/form/div/button=CLEAR_INDEX
+body/div[5]=date-chooser
+div(htmlId\=date-chooser)/div[0]=date-chooser_day
 
 $USAGE$
@@ -19,13 +40,8 @@
 [<sequenceNames>]
     array of sequences into which the parsed events shall be stored
-{-idReplacements=path/to/replacementfile}
+{-parseParams=path/to/replacementfile}
     used to define id replacements as described in a separate file
-{-clearId=path/to[0]/gui(htmlId=element)}
-    used to define GUI elements of which the ids shall be ignored
-{-clearIndex=path/to[0]/gui(htmlId=element)}
-    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
-parseDirHTML /path/to/directory sequences -idReplacements=idReplacements.txt -clearId=body
+parseDirHTML /path/to/file.log sequences -parseParams=idReplacements.txt
