Index: trunk/autoquest-plugin-html/data/guimappings/guimapping-html-dummy.txt
===================================================================
--- trunk/autoquest-plugin-html/data/guimappings/guimapping-html-dummy.txt	(revision 1064)
+++ 	(revision )
@@ -1,14 +1,0 @@
-document = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
-head = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
-title = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
-script = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
-style = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
-link = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
-meta = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
-iframe = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
-input_hidden = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
-option = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
-tt = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
-br = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
-colgroup = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
-col = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement
Index: trunk/autoquest-plugin-html/data/guimappings/guimapping-html.txt
===================================================================
--- trunk/autoquest-plugin-html/data/guimappings/guimapping-html.txt	(revision 1064)
+++ trunk/autoquest-plugin-html/data/guimappings/guimapping-html.txt	(revision 1069)
@@ -30,4 +30,5 @@
 div = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLPanel
 dl = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLPanel
+document = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLDocument
 dt = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLText
 
@@ -90,5 +91,4 @@
 
 p = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLPanel
-page = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLPage
 # param =
 pre = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLText
Index: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/AbstractDefaultLogParser.java
===================================================================
--- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/AbstractDefaultLogParser.java	(revision 1069)
+++ trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/AbstractDefaultLogParser.java	(revision 1069)
@@ -0,0 +1,432 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.plugin.html;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.eventcore.guimodel.GUIElementTree;
+import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel;
+import de.ugoe.cs.util.console.Console;
+
+/**
+ * <p>
+ * This class provides the functionality to parse XML log files generated monitors of
+ * AutoQUEST. The result of parsing a file is a collection of event sequences and a GUI model.
+ * This class must be extended by implementing a subclass and the abstract method to complete
+ * the implementation.
+ * </p>
+ * 
+ * @author Patrick Harms
+ * @version 1.0
+ * 
+ */
+public abstract class AbstractDefaultLogParser extends DefaultHandler {
+    
+    /**
+     * <p>
+     * Collection of event sequences that is contained in the parsed log file.
+     * </p>
+     */
+    private Collection<List<Event>> sequences;
+
+    /**
+     * <p>
+     * Internal handle to the parsed GUI structure, stored in a GUIElementTree
+     * </p>
+     */
+    private GUIElementTree<String> guiElementTree;
+
+    /**
+     * <p>
+     * Id of the GUI element currently being parsed.
+     * </p>
+     */
+    private String currentGUIElementId;
+
+    /**
+     * <p>
+     * the buffer for GUI elements already parsed but not processed yet (because e.g. the parent
+     * GUI element has not been parsed yet)
+     * </p>
+     */
+    private List<BufferEntry> guiElementBuffer;
+
+    /**
+     * <p>
+     * Internal handle to type of the event currently being parsed.
+     * </p>
+     */
+    private String currentEventType;
+
+    /**
+     * <p>
+     * the buffer for events already parsed but not processed yet (because e.g. the target
+     * GUI element has not been parsed yet)
+     * </p>
+     */
+    private List<BufferEntry> eventBuffer;
+
+    /**
+     * <p>
+     * Internal handle to the parameters of the event currently being entity.
+     * </p>
+     */
+    private Map<String, String> currentParameters;
+
+    /**
+     * <p>
+     * Internal handle to the sequence currently being parsed.
+     * </p>
+     */
+    private List<Event> currentSequence;
+
+    /**
+     * <p>
+     * Constructor. Creates a new logParser.
+     * </p>
+     */
+    public AbstractDefaultLogParser() {
+        sequences = new LinkedList<List<Event>>();
+        guiElementTree = new GUIElementTree<String>();
+        guiElementBuffer = new LinkedList<BufferEntry>();
+        eventBuffer = new LinkedList<BufferEntry>();
+        currentSequence = new LinkedList<Event>();
+    }
+
+    /**
+     * <p>
+     * Parses a log file written by the HTMLMonitor and creates a collection of event sequences.
+     * </p>
+     * 
+     * @param filename
+     *            name and path of the log file
+     */
+    public void parseFile(String filename) {
+        if (filename == null) {
+            throw new IllegalArgumentException("filename must not be null");
+        }
+
+        parseFile(new File(filename));
+    }
+
+    /**
+     * <p>
+     * Parses a log file written by the HTMLMonitor and creates a collection of event sequences.
+     * </p>
+     * 
+     * @param file
+     *            file to be parsed
+     */
+    public void parseFile(File file) {
+        if (file == null) {
+            throw new IllegalArgumentException("file must not be null");
+        }
+        SAXParserFactory spf = SAXParserFactory.newInstance();
+        spf.setValidating(true);
+        SAXParser saxParser = null;
+        InputSource inputSource = null;
+        try {
+            saxParser = spf.newSAXParser();
+            inputSource =
+                new InputSource(new InputStreamReader(new FileInputStream(file), "UTF-8"));
+        }
+        catch (UnsupportedEncodingException e) {
+            Console.printerrln("Error parsing file " + file.getName());
+            Console.logException(e);
+            return;
+        }
+        catch (ParserConfigurationException e) {
+            Console.printerrln("Error parsing file " + file.getName());
+            Console.logException(e);
+            return;
+        }
+        catch (SAXException e) {
+            Console.printerrln("Error parsing file " + file.getName());
+            Console.logException(e);
+        }
+        catch (FileNotFoundException e) {
+            Console.printerrln("Error parsing file " + file.getName());
+            Console.logException(e);
+        }
+        if (inputSource != null) {
+            inputSource.setSystemId("file://" + file.getAbsolutePath());
+            try {
+                if (saxParser == null) {
+                    throw new RuntimeException("SaxParser creation failed");
+                }
+                saxParser.parse(inputSource, this);
+            }
+            catch (SAXParseException e) {
+                Console.printerrln("Failure parsing file in line " + e.getLineNumber() +
+                    ", column " + e.getColumnNumber() + ".");
+                Console.logException(e);
+            }
+            catch (SAXException e) {
+                Console.printerrln("Error parsing file " + file.getName());
+                Console.logException(e);
+                return;
+            }
+            catch (IOException e) {
+                Console.printerrln("Error parsing file " + file.getName());
+                Console.logException(e);
+                return;
+            }
+        }
+    }
+
+    /**
+     * <p>
+     * Returns a collection of event sequences that was obtained from parsing log files.
+     * </p>
+     * 
+     * @return
+     */
+    public Collection<List<Event>> getSequences() {
+        return sequences;
+    }
+
+    /**
+     * <p>
+     * Returns the GUI model that is obtained from parsing log files.
+     * </p>
+     * 
+     * @return GUIModel
+     */
+    public GUIModel getGuiModel() {
+        return guiElementTree.getGUIModel();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String,
+     * java.lang.String, org.xml.sax.Attributes)
+     */
+    @Override
+    public void startElement(String uri, String localName, String qName, Attributes atts)
+        throws SAXException
+    {
+        if (qName.equals("session")) {
+            // do nothing
+        }
+        else if (qName.equals("component")) {
+            currentGUIElementId = atts.getValue("id");
+            currentParameters = new HashMap<String, String>();
+        }
+        else if (qName.equals("event")) {
+            currentEventType = atts.getValue("type");
+            currentParameters = new HashMap<String, String>();
+        }
+        else if (qName.equals("param")) {
+            String paramName = atts.getValue("name");
+            if ((currentGUIElementId != null) || (currentEventType != null)) {
+                currentParameters.put(paramName, atts.getValue("value"));
+            }
+            else {
+                throw new SAXException("param tag found where it should not be.");
+            }
+        }
+        else {
+            throw new SAXException("unknown tag found: " + qName);
+        }
+
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String,
+     * java.lang.String)
+     */
+    @Override
+    public void endElement(String uri, String localName, String qName) throws SAXException {
+        if (qName.equals("session") && (eventBuffer != null)) {
+            eventBuffer.add(new BufferEntry("sessionSwitch", null));
+            processEvents();
+        }
+        else if (qName.equals("component") && (currentGUIElementId != null)) {
+            guiElementBuffer.add(new BufferEntry(currentGUIElementId, currentParameters));
+
+            processGUIElements();
+
+            currentGUIElementId = null;
+            currentParameters = null;
+        }
+        else if (qName.equals("event") && (currentEventType != null)) {
+            eventBuffer.add(new BufferEntry(currentEventType, currentParameters));
+
+            processEvents();
+
+            currentEventType = null;
+            currentParameters = null;
+        }
+    }
+
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @param id
+     * @param parameters
+     * @return
+     */
+    protected abstract boolean handleGUIElement(String id, Map<String, String> parameters) 
+        throws SAXException;
+    
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @param id
+     * @param parameters
+     * @return
+     */
+    protected abstract boolean handleEvent(String type, Map<String, String> parameters)
+        throws SAXException;
+    
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @return
+     */
+    protected GUIElementTree<String> getGUIElementTree() {
+        return guiElementTree;
+    }
+
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @param event
+     */
+    protected void addToSequence(Event event) {
+        currentSequence.add(event);
+    }
+
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     */
+    private void processGUIElements() throws SAXException {
+        int processedElements = 0;
+        boolean processedElement;
+        
+        do {
+            processedElement = false;
+            // search for the next GUI element that can be processed
+            for (int i = 0; i < guiElementBuffer.size(); i++) {
+                BufferEntry entry = guiElementBuffer.get(i);
+                processedElement = handleGUIElement(entry.id, entry.parameters);
+                if (processedElement) {
+                    guiElementBuffer.remove(i);
+                    processedElements++;
+                    break;
+                }
+            }
+        }
+        while (processedElement);
+        
+        if (processedElements > 0) {
+            processEvents();
+        }
+    }
+
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     */
+    private void processEvents() throws SAXException {
+        boolean processedEvent;
+        
+        do {
+            processedEvent = false;
+            // check, if the next event can be processed
+            if (eventBuffer.size() > 0) {
+                BufferEntry entry = eventBuffer.get(0);
+                
+                if ((entry != null) && (entry.id != null) && (entry.parameters != null)) {
+                    processedEvent = handleEvent(entry.id, entry.parameters);
+                    if (processedEvent) {
+                        eventBuffer.remove(0);
+                    }
+                }
+                else {
+                    // the entry signals a session switch. Close the current session and start the
+                    // next one
+                    if (currentSequence.size() > 0) {
+                        sequences.add(currentSequence);
+                        currentSequence = new LinkedList<Event>();
+                        eventBuffer.remove(0);
+                        processedEvent = true;
+                    }
+                }
+            }
+        }
+        while (processedEvent);
+    }
+
+    /**
+     * <p>
+     * TODO document
+     * </p>
+     */
+    private static class BufferEntry {
+        
+        /** */
+        private String id;
+        
+        /** */
+        private Map<String, String> parameters;
+        
+        /**
+         * 
+         */
+        private BufferEntry(String id, Map<String, String> parameters) {
+            this.id = id;
+            this.parameters = parameters;
+        }
+    }
+
+}
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 1064)
+++ trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/HTMLLogParser.java	(revision 1069)
@@ -15,407 +15,271 @@
 package de.ugoe.cs.autoquest.plugin.html;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.DefaultHandler;
 
 import de.ugoe.cs.autoquest.eventcore.Event;
 import de.ugoe.cs.autoquest.eventcore.IEventType;
-import de.ugoe.cs.autoquest.eventcore.guimodel.GUIElementTree;
 import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel;
 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.HTMLDocumentSpec;
 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.HTMLPageElementSpec;
-import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLPageSpec;
 import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLServerSpec;
-import de.ugoe.cs.util.console.Console;
 
 /**
  * <p>
  * This class provides the functionality to parse XML log files generated by the HTMLMonitor of
- * autoquest. The result of parsing a file is a collection of event sequences.
+ * AutoQUEST. The result of parsing a file is a collection of event sequences and a GUI model
  * </p>
  * 
- * @author Fabian Glaser
+ * @author Fabian Glaser, Patrick Harms
  * @version 1.0
  * 
  */
-public class HTMLLogParser extends DefaultHandler {
+public class HTMLLogParser extends AbstractDefaultLogParser {
+    
+    /**
+     *
+     */
+    private Pattern htmlElementPattern =
+        Pattern.compile("(\\w+)(\\[(\\d+)\\]|\\(htmlId=([\\w-]+)\\))");
+
+    /* (non-Javadoc)
+     * @see de.ugoe.cs.autoquest.plugin.html.AbstractDefaultLogParser#handleGUIElement(java.lang.String, java.util.Map)
+     */
+    @Override
+    protected boolean handleGUIElement(String id, Map<String, String> parameters)
+        throws SAXException
+    {
+        HTMLGUIElementSpec specification = null;
+        
+        String parentId = parameters.get("parent");
+        IGUIElement parent = super.getGUIElementTree().find(parentId);
+
+        if (parameters.containsKey("host")) {
+            // this is a server specification
+            int port = 80;
+            String portStr = parameters.get(port);
+            
+            if (portStr != null) {
+                port = Integer.parseInt(portStr);
+            }
+            
+            specification = new HTMLServerSpec(parameters.get("host"), port);
+        }
+        else if (parameters.containsKey("path")) {
+            // this is a document specification
+            
+            if (parent != null) {
+                if (!(parent.getSpecification() instanceof HTMLServerSpec)) {
+                    throw new SAXException
+                        ("invalid log: parent GUI element of a document is not of type server");
+                }
+                
+                specification = new HTMLDocumentSpec
+                    ((HTMLServerSpec) parent.getSpecification(), parameters.get("path"),
+                     parameters.get("query"), parameters.get("title"));
+            }
+            else if (parentId == null) {
+                throw new SAXException("invalid log: a document has no parent id");
+            }
+        }
+        else if (parameters.containsKey("tagname")) {
+            String tagName = parameters.get("tagname");
+            
+            if (!tagNameMustBeConsidered(tagName)) {
+                return true;
+            }
+
+            if (parent != null) {
+                IGUIElement document = parent;
+                
+                while ((document != null) &&
+                       (!(document.getSpecification() instanceof HTMLDocumentSpec)))
+                {
+                    document = document.getParent();
+                }
+                
+                if (document == null) {
+                    throw new SAXException
+                        ("invalid log: parent hierarchy of a page element does not contain a " +
+                         "document");
+                }
+                
+                int index = -1;
+                String indexStr = parameters.get("index");
+
+                if ((indexStr != null) && (!"".equals(indexStr))) {
+                    index = Integer.parseInt(indexStr);
+                }
+
+                specification = new HTMLPageElementSpec
+                    ((HTMLDocumentSpec) document.getSpecification(), tagName,
+                     parameters.get("htmlid"), index);
+            }
+            else if (parentId == null) {
+                throw new SAXException("invalid log: a page element has no parent id");
+            }
+        }
+        else {
+            throw new SAXException("invalid log: unknown GUI element");
+        }
+
+        if (specification != null) {
+            super.getGUIElementTree().add(id, parentId, specification);
+            return true;
+        }
+        else {
+            return false;
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see de.ugoe.cs.autoquest.plugin.html.AbstractDefaultLogParser#handleEvent(java.lang.String, java.util.Map)
+     */
+    @Override
+    protected boolean handleEvent(String type, Map<String, String> parameters) throws SAXException {
+        String targetId = parameters.get("target");
+        
+        if (targetId == null) {
+            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 processable yet
+            return false;
+        }
+
+        IEventType eventType =
+            HTMLEventTypeFactory.getInstance().getEventType(type, parameters, target);
+        
+        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);
+
+        return true;
+    }
+
     /**
      * <p>
-     * Constructor. Creates a new HTMLLogParser.
+     * TODO: comment
      * </p>
-     */
-    public HTMLLogParser() {
-        sequences = new LinkedList<List<Event>>();
+     *
+     * @param targetDocument
+     * @param targetDOMPath
+     * @return
+     */
+    private String determineTargetId(String targetDocument, String targetDOMPath)
+        throws SAXException
+    {
+        IGUIElement document = super.getGUIElementTree().find(targetDocument);
+        
+        if (document == null) {
+            return null;
+        }
+        
+        if (!(document.getSpecification() instanceof HTMLDocumentSpec)) {
+            throw new SAXException("an id that should refer to an HTML document refers to" +
+                                   "something else");
+        }
+        
+        GUIModel model = super.getGUIElementTree().getGUIModel();
+        IGUIElement child = document;
+        String[] pathElements = targetDOMPath.split("/");
+        int pathIndex = 0;
+        
+        HTMLPageElementSpec compareSpec;
+        String tagName;
+        int index;
+        String htmlId;
+        
+        while ((pathIndex < pathElements.length) && (child != null)) {
+            if ((pathElements[pathIndex] != null) && (!"".equals(pathElements[pathIndex]))) {           
+                Matcher matcher = htmlElementPattern.matcher(pathElements[pathIndex]);
+                if (!matcher.matches()) {
+                    throw new SAXException
+                        ("could not parse target DOM path element " + pathElements[pathIndex]);
+                }
+
+                tagName = matcher.group(1);
+                String indexStr = matcher.group(3);
+                htmlId = matcher.group(4);
+
+                index = -1;
+                if ((indexStr != null) && (!"".equals(indexStr))) {
+                    index = Integer.parseInt(indexStr);
+                }
+
+                compareSpec = new HTMLPageElementSpec
+                    ((HTMLDocumentSpec) document.getSpecification(), tagName, htmlId, index);
+
+                List<IGUIElement> children = model.getChildren(child);
+                child = null;
+
+                for (IGUIElement candidate : children) {
+                    if (compareSpec.getSimilarity(candidate.getSpecification())) {
+                        child = candidate;
+                        break;
+                    }
+                }
+            }
+            
+            pathIndex++;
+        }
+        
+        if (child != null) {
+            return super.getGUIElementTree().find(child);
+        }
+        else {
+            return null;
+        }
     }
 
     /**
      * <p>
-     * Collection of event sequences that is contained in the parsed log file.
+     * checks if tags with the provided name must be handled in the GUI model. As an example,
+     * it is not necessary to handle "head" tags and anything included in them. 
      * </p>
-     */
-    private Collection<List<Event>> sequences;
-
-    /**
-     * <p>
-     * Internal handle to the parsed GUI structure, stored in a GUIElementTree
-     * </p>
-     */
-    private GUIElementTree<String> currentGUIElementTree;
-
-    /**
-     * <p>
-     * Path of the GUI element currently being parsed.
-     * </p>
-     */
-    private String currentGUIElementPath;
-
-    /**
-     * <p>
-     * Path of the parent of the GUI element currently being parsed.
-     * </p>
-     */
-    private String currentParentPath;
-
-    /**
-     * <p>
-     * Source of the GUI element currently being parsed.
-     * </p>
-     */
-    private String currentEventSource;
-
-    /**
-     * <p>
-     * Timestamp of the event currently being parsed.
-     * </p>
-     */
-    private Long currentEventTimestamp;
-
-    /**
-     * <p>
-     * Internal handle to the parameters of the event currently being parsed.
-     * </p>
-     */
-    private Map<String, String> currentEventParameters;
-
-    /**
-     * <p>
-     * Internal handle to the parameters of the GUI element currently being parsed.
-     * </p>
-     */
-    private Map<String, String> currentGUIElementParameters;
-    /**
-     * <p>
-     * Internal handle to the sequence currently being parsed.
-     * </p>
-     */
-    private List<Event> currentSequence;
-
-    /**
-     * <p>
-     * Internal handle to type of the event currently being parsed.
-     * </p>
-     */
-    private String currentEventType;
-
-    /**
-     * <p>
-     * Class of the GUI element currently being parsed.
-     * </p>
-     */
-    private String currentGUIElementClass;
-
-    /**
-     * <p>
-     * Index of the GUI element currently being parsed.
-     * </p>
-     */
-    private String currentGUIElementIndex;
-
-    /**
-     * <p>
-     * internal handle to the GUI element of the previous event to be potentially reused for the
-     * current
-     * </p>
-     */
-    private IGUIElement lastGUIElement;
-
-    /**
-     * <p>
-     * internal handle to the server specification currently being used.
-     * </p>
-     */
-    private HTMLServerSpec currentServerSpec;
-
-    /**
-     * <p>
-     * Parses a log file written by the HTMLMonitor and creates a collection of event sequences.
-     * </p>
-     * 
-     * @param filename
-     *            name and path of the log file
-     */
-    public void parseFile(String filename) {
-        if (filename == null) {
-            throw new IllegalArgumentException("filename must not be null");
-        }
-
-        parseFile(new File(filename));
-    }
-
-    /**
-     * <p>
-     * Parses a log file written by the HTMLMonitor and creates a collection of event sequences.
-     * </p>
-     * 
-     * @param file
-     *            file to be parsed
-     */
-    public void parseFile(File file) {
-        if (file == null) {
-            throw new IllegalArgumentException("file must not be null");
-        }
-        SAXParserFactory spf = SAXParserFactory.newInstance();
-        spf.setValidating(true);
-        SAXParser saxParser = null;
-        InputSource inputSource = null;
-        try {
-            saxParser = spf.newSAXParser();
-            inputSource =
-                new InputSource(new InputStreamReader(new FileInputStream(file), "UTF-8"));
-        }
-        catch (UnsupportedEncodingException e) {
-            Console.printerr("Error parsing file " + file.getName());
-            Console.logException(e);
-            return;
-        }
-        catch (ParserConfigurationException e) {
-            Console.printerr("Error parsing file " + file.getName());
-            Console.logException(e);
-            return;
-        }
-        catch (SAXException e) {
-            Console.printerr("Error parsing file " + file.getName());
-            Console.logException(e);
-        }
-        catch (FileNotFoundException e) {
-            Console.printerr("Error parsing file " + file.getName());
-            Console.logException(e);
-        }
-        if (inputSource != null) {
-            inputSource.setSystemId("file://" + file.getAbsolutePath());
-            try {
-                if (saxParser == null) {
-                    throw new RuntimeException("SaxParser creation failed");
-                }
-                saxParser.parse(inputSource, this);
-            }
-            catch (SAXParseException e) {
-                Console.printerrln("Failure parsing file in line " + e.getLineNumber() +
-                    ", column " + e.getColumnNumber() + ".");
-                Console.logException(e);
-            }
-            catch (SAXException e) {
-                Console.printerr("Error parsing file " + file.getName());
-                Console.logException(e);
-                return;
-            }
-            catch (IOException e) {
-                Console.printerr("Error parsing file " + file.getName());
-                Console.logException(e);
-                return;
-            }
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String,
-     * java.lang.String, org.xml.sax.Attributes)
-     */
-    @Override
-    public void startElement(String uri, String localName, String qName, Attributes atts)
-        throws SAXException
-    {
-        if (qName.equals("session")) {
-            currentSequence = new LinkedList<Event>();
-            if (currentGUIElementTree == null)
-                currentGUIElementTree = new GUIElementTree<String>();
-        }
-        else if (qName.equals("component")) {
-            currentGUIElementPath = atts.getValue("path");
-            currentGUIElementParameters = new HashMap<String, String>();
-        }
-        else if (qName.equals("event")) {
-            currentEventType = atts.getValue("type");
-            currentEventParameters = new HashMap<String, String>();
-        }
-        else if (qName.equals("param")) {
-            String paramName = atts.getValue("name");
-            if (currentGUIElementPath != null) {
-                if ("parent".equals(paramName)) {
-                    currentParentPath = atts.getValue("value");
-                }
-                if ("class".equals(paramName)) {
-                    currentGUIElementClass = atts.getValue("value");
-                }
-                if ("index".equals(paramName)) {
-                    currentGUIElementIndex = atts.getValue("value");
-                }
-                currentGUIElementParameters.put(paramName, atts.getValue("value"));
-            }
-            else if (currentEventType != null) {
-                if ("target".equals(paramName)) {
-                    currentEventSource = atts.getValue("value");
-                }
-                if ("timestamp".equals(paramName)) {
-                    currentEventTimestamp = Long.parseLong(atts.getValue("value"));
-                }
-                currentEventParameters.put(paramName, atts.getValue("value"));
-            }
-            else {
-                throw new SAXException("param tag found where it should not be.");
-            }
-        }
-        else {
-            throw new SAXException("unknown tag found: " + qName);
-        }
-
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String,
-     * java.lang.String)
-     */
-    @Override
-    public void endElement(String uri, String localName, String qName) throws SAXException {
-        if (qName.equals("session")) {
-            if (currentSequence != null && !currentSequence.isEmpty()) {
-                sequences.add(currentSequence);
-            }
-            currentSequence = null;
-        }
-        else if (qName.equals("component") && currentGUIElementPath != null) {
-            HTMLGUIElementSpec guiElementSpec =
-                getGUIElementSpec(currentGUIElementClass, currentGUIElementParameters);
-            currentGUIElementTree.add(currentGUIElementPath, currentParentPath, guiElementSpec);
-
-            currentParentPath = null;
-            currentGUIElementPath = null;
-            currentGUIElementParameters = null;
-        }
-        else if (qName.equals("event")) {
-            IGUIElement currentGUIElement;
-            currentGUIElement = currentGUIElementTree.find(currentEventSource);
-
-            IEventType eventType =
-                HTMLEventTypeFactory.getInstance().getEventType(currentEventType,
-                                                                currentEventParameters,
-                                                                currentGUIElement);
-            Event event =
-                new Event(eventType, (currentGUIElement == null ? lastGUIElement
-                    : currentGUIElement));
-
-            event.setTimestamp(currentEventTimestamp);
-            HTMLGUIElement currentEventTarget = (HTMLGUIElement) event.getTarget();
-            currentEventTarget.markUsed();
-            currentSequence.add(event);
-
-            currentEventSource = null;
-            currentEventTimestamp = -1l;
-            currentEventParameters = null;
-            currentEventType = null;
-
-            if (currentGUIElement != null) {
-                lastGUIElement = currentGUIElement;
-            }
-
-            currentGUIElement = null;
-        }
-    }
-
-    /**
-     * <p>
-     * Returns a collection of event sequences that was obtained from parsing log files.
-     * </p>
-     * 
+     *
+     * @param tagName
      * @return
      */
-    public Collection<List<Event>> getSequences() {
-        return sequences;
-    }
-
-    /**
-     * <p>
-     * Returns the GUI model that is obtained from parsing log files.
-     * </p>
-     * 
-     * @return GUIModel
-     */
-    public GUIModel getGuiModel() {
-        return currentGUIElementTree.getGUIModel();
-    }
-
-    /**
-     * Returns the HTMLGUIElementSpecification for a GUI Element described
-     * by its class name and its parameters.
-     * @param guiElementClass
-     * @param guiElementParameters
-     * @return
-     */
-    private HTMLGUIElementSpec getGUIElementSpec(String guiElementClass,
-                                                 Map<String, String> guiElementParameters)
-    {
-        HTMLGUIElementSpec specification = null;
-        if ("server".equals(guiElementClass)) {
-            // TODO: add correct port handling
-            specification = new HTMLServerSpec(guiElementParameters.get("htmlId"), 0);
-            currentServerSpec = (HTMLServerSpec) specification;
-        }
-
-        else {
-            String id = guiElementParameters.get("htmlId");
-            if (id == null) {
-                HTMLPageElementSpec parentSpec =
-                    (HTMLPageElementSpec) currentGUIElementTree.find(currentParentPath)
-                        .getSpecification();
-                id = parentSpec.getPage().getPagePath();
-            }
-
-            int index = -1;
-            String indexStr = guiElementParameters.get("index");
-
-            if ((indexStr != null) && (!"".equals(indexStr))) {
-                index = Integer.parseInt(indexStr);
-            }
-            String title = guiElementParameters.get("title");
-            HTMLPageSpec page = new HTMLPageSpec(currentServerSpec, id, title);
-            specification = new HTMLPageElementSpec(page, guiElementClass, id, index);
-        }
-
-        return specification;
-    }
+    private boolean tagNameMustBeConsidered(String tagName) {
+        return
+            !"head".equals(tagName) && !"title".equals(tagName) && !"script".equals(tagName) &&
+            !"style".equals(tagName) && !"link".equals(tagName) && !"meta".equals(tagName) &&
+            !"iframe".equals(tagName) && !"input_hidden".equals(tagName) &&
+            !"option".equals(tagName) && !"tt".equals(tagName) && !"br".equals(tagName) &&
+            !"colgroup".equals(tagName) && !"col".equals(tagName);
+
+    }
+
 }
Index: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/NewHTMLLogParser.java
===================================================================
--- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/NewHTMLLogParser.java	(revision 1064)
+++ 	(revision )
@@ -1,421 +1,0 @@
-//   Copyright 2012 Georg-August-Universität Göttingen, Germany
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-package de.ugoe.cs.autoquest.plugin.html;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import de.ugoe.cs.autoquest.eventcore.Event;
-import de.ugoe.cs.autoquest.eventcore.IEventType;
-import de.ugoe.cs.autoquest.eventcore.guimodel.GUIElementTree;
-import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel;
-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.HTMLGUIElement;
-import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElementSpec;
-import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLPageElementSpec;
-import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLPageSpec;
-import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLServerSpec;
-import de.ugoe.cs.util.console.Console;
-
-/**
- * <p>
- * This class provides the functionality to parse XML log files generated by the HTMLMonitor of
- * autoquest. The result of parsing a file is a collection of event sequences.
- * </p>
- * 
- * @author Fabian Glaser
- * @version 1.0
- * 
- */
-public class NewHTMLLogParser extends DefaultHandler {
-    /**
-     * <p>
-     * Constructor. Creates a new HTMLLogParser.
-     * </p>
-     */
-    public NewHTMLLogParser() {
-        sequences = new LinkedList<List<Event>>();
-    }
-
-    /**
-     * <p>
-     * Collection of event sequences that is contained in the parsed log file.
-     * </p>
-     */
-    private Collection<List<Event>> sequences;
-
-    /**
-     * <p>
-     * Internal handle to the parsed GUI structure, stored in a GUIElementTree
-     * </p>
-     */
-    private GUIElementTree<String> currentGUIElementTree;
-
-    /**
-     * <p>
-     * Path of the GUI element currently being parsed.
-     * </p>
-     */
-    private String currentGUIElementPath;
-
-    /**
-     * <p>
-     * Path of the parent of the GUI element currently being parsed.
-     * </p>
-     */
-    private String currentParentPath;
-
-    /**
-     * <p>
-     * Source of the GUI element currently being parsed.
-     * </p>
-     */
-    private String currentEventSource;
-
-    /**
-     * <p>
-     * Timestamp of the event currently being parsed.
-     * </p>
-     */
-    private Long currentEventTimestamp;
-
-    /**
-     * <p>
-     * Internal handle to the parameters of the event currently being parsed.
-     * </p>
-     */
-    private Map<String, String> currentEventParameters;
-
-    /**
-     * <p>
-     * Internal handle to the parameters of the GUI element currently being parsed.
-     * </p>
-     */
-    private Map<String, String> currentGUIElementParameters;
-    /**
-     * <p>
-     * Internal handle to the sequence currently being parsed.
-     * </p>
-     */
-    private List<Event> currentSequence;
-
-    /**
-     * <p>
-     * Internal handle to type of the event currently being parsed.
-     * </p>
-     */
-    private String currentEventType;
-
-    /**
-     * <p>
-     * Class of the GUI element currently being parsed.
-     * </p>
-     */
-    private String currentGUIElementClass;
-
-    /**
-     * <p>
-     * Index of the GUI element currently being parsed.
-     * </p>
-     */
-    private String currentGUIElementIndex;
-
-    /**
-     * <p>
-     * internal handle to the GUI element of the previous event to be potentially reused for the
-     * current
-     * </p>
-     */
-    private IGUIElement lastGUIElement;
-
-    /**
-     * <p>
-     * internal handle to the server specification currently being used.
-     * </p>
-     */
-    private HTMLServerSpec currentServerSpec;
-
-    /**
-     * <p>
-     * Parses a log file written by the HTMLMonitor and creates a collection of event sequences.
-     * </p>
-     * 
-     * @param filename
-     *            name and path of the log file
-     */
-    public void parseFile(String filename) {
-        if (filename == null) {
-            throw new IllegalArgumentException("filename must not be null");
-        }
-
-        parseFile(new File(filename));
-    }
-
-    /**
-     * <p>
-     * Parses a log file written by the HTMLMonitor and creates a collection of event sequences.
-     * </p>
-     * 
-     * @param file
-     *            file to be parsed
-     */
-    public void parseFile(File file) {
-        if (file == null) {
-            throw new IllegalArgumentException("file must not be null");
-        }
-        SAXParserFactory spf = SAXParserFactory.newInstance();
-        spf.setValidating(true);
-        SAXParser saxParser = null;
-        InputSource inputSource = null;
-        try {
-            saxParser = spf.newSAXParser();
-            inputSource =
-                new InputSource(new InputStreamReader(new FileInputStream(file), "UTF-8"));
-        }
-        catch (UnsupportedEncodingException e) {
-            Console.printerr("Error parsing file " + file.getName());
-            Console.logException(e);
-            return;
-        }
-        catch (ParserConfigurationException e) {
-            Console.printerr("Error parsing file " + file.getName());
-            Console.logException(e);
-            return;
-        }
-        catch (SAXException e) {
-            Console.printerr("Error parsing file " + file.getName());
-            Console.logException(e);
-        }
-        catch (FileNotFoundException e) {
-            Console.printerr("Error parsing file " + file.getName());
-            Console.logException(e);
-        }
-        if (inputSource != null) {
-            inputSource.setSystemId("file://" + file.getAbsolutePath());
-            try {
-                if (saxParser == null) {
-                    throw new RuntimeException("SaxParser creation failed");
-                }
-                saxParser.parse(inputSource, this);
-            }
-            catch (SAXParseException e) {
-                Console.printerrln("Failure parsing file in line " + e.getLineNumber() +
-                    ", column " + e.getColumnNumber() + ".");
-                Console.logException(e);
-            }
-            catch (SAXException e) {
-                Console.printerr("Error parsing file " + file.getName());
-                Console.logException(e);
-                return;
-            }
-            catch (IOException e) {
-                Console.printerr("Error parsing file " + file.getName());
-                Console.logException(e);
-                return;
-            }
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String,
-     * java.lang.String, org.xml.sax.Attributes)
-     */
-    @Override
-    public void startElement(String uri, String localName, String qName, Attributes atts)
-        throws SAXException
-    {
-        if (qName.equals("session")) {
-            currentSequence = new LinkedList<Event>();
-            if (currentGUIElementTree == null)
-                currentGUIElementTree = new GUIElementTree<String>();
-        }
-        else if (qName.equals("component")) {
-            currentGUIElementPath = atts.getValue("path");
-            currentGUIElementParameters = new HashMap<String, String>();
-        }
-        else if (qName.equals("event")) {
-            currentEventType = atts.getValue("type");
-            currentEventParameters = new HashMap<String, String>();
-        }
-        else if (qName.equals("param")) {
-            String paramName = atts.getValue("name");
-            if (currentGUIElementPath != null) {
-                if ("parent".equals(paramName)) {
-                    currentParentPath = atts.getValue("value");
-                }
-                if ("class".equals(paramName)) {
-                    currentGUIElementClass = atts.getValue("value");
-                }
-                if ("index".equals(paramName)) {
-                    currentGUIElementIndex = atts.getValue("value");
-                }
-                currentGUIElementParameters.put(paramName, atts.getValue("value"));
-            }
-            else if (currentEventType != null) {
-                if ("target".equals(paramName)) {
-                    currentEventSource = atts.getValue("value");
-                }
-                if ("timestamp".equals(paramName)) {
-                    currentEventTimestamp = Long.parseLong(atts.getValue("value"));
-                }
-                currentEventParameters.put(paramName, atts.getValue("value"));
-            }
-            else {
-                throw new SAXException("param tag found where it should not be.");
-            }
-        }
-        else {
-            throw new SAXException("unknown tag found: " + qName);
-        }
-
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String,
-     * java.lang.String)
-     */
-    @Override
-    public void endElement(String uri, String localName, String qName) throws SAXException {
-        if (qName.equals("session")) {
-            if (currentSequence != null && !currentSequence.isEmpty()) {
-                sequences.add(currentSequence);
-            }
-            currentSequence = null;
-        }
-        else if (qName.equals("component") && currentGUIElementPath != null) {
-            HTMLGUIElementSpec guiElementSpec =
-                getGUIElementSpec(currentGUIElementClass, currentGUIElementParameters);
-            currentGUIElementTree.add(currentGUIElementPath, currentParentPath, guiElementSpec);
-
-            currentParentPath = null;
-            currentGUIElementPath = null;
-            currentGUIElementParameters = null;
-        }
-        else if (qName.equals("event")) {
-            IGUIElement currentGUIElement;
-            currentGUIElement = currentGUIElementTree.find(currentEventSource);
-
-            IEventType eventType =
-                HTMLEventTypeFactory.getInstance().getEventType(currentEventType,
-                                                                currentEventParameters,
-                                                                currentGUIElement);
-            Event event =
-                new Event(eventType, (currentGUIElement == null ? lastGUIElement
-                    : currentGUIElement));
-
-            event.setTimestamp(currentEventTimestamp);
-            HTMLGUIElement currentEventTarget = (HTMLGUIElement) event.getTarget();
-            currentEventTarget.markUsed();
-            currentSequence.add(event);
-
-            currentEventSource = null;
-            currentEventTimestamp = -1l;
-            currentEventParameters = null;
-            currentEventType = null;
-
-            if (currentGUIElement != null) {
-                lastGUIElement = currentGUIElement;
-            }
-
-            currentGUIElement = null;
-        }
-    }
-
-    /**
-     * <p>
-     * Returns a collection of event sequences that was obtained from parsing log files.
-     * </p>
-     * 
-     * @return
-     */
-    public Collection<List<Event>> getSequences() {
-        return sequences;
-    }
-
-    /**
-     * <p>
-     * Returns the GUI model that is obtained from parsing log files.
-     * </p>
-     * 
-     * @return GUIModel
-     */
-    public GUIModel getGuiModel() {
-        return currentGUIElementTree.getGUIModel();
-    }
-
-    /**
-     * Returns the HTMLGUIElementSpecification for a GUI Element described
-     * by its class name and its parameters.
-     * @param guiElementClass
-     * @param guiElementParameters
-     * @return
-     */
-    private HTMLGUIElementSpec getGUIElementSpec(String guiElementClass,
-                                                 Map<String, String> guiElementParameters)
-    {
-        HTMLGUIElementSpec specification = null;
-        if ("server".equals(guiElementClass)) {
-            // TODO: add correct port handling
-            specification = new HTMLServerSpec(guiElementParameters.get("htmlId"), 0);
-            currentServerSpec = (HTMLServerSpec) specification;
-        }
-
-        else {
-            String id = guiElementParameters.get("htmlId");
-            if (id == null) {
-                HTMLPageElementSpec parentSpec =
-                    (HTMLPageElementSpec) currentGUIElementTree.find(currentParentPath)
-                        .getSpecification();
-                id = parentSpec.getPage().getPagePath();
-            }
-
-            int index = -1;
-            String indexStr = guiElementParameters.get("index");
-
-            if ((indexStr != null) && (!"".equals(indexStr))) {
-                index = Integer.parseInt(indexStr);
-            }
-            String title = guiElementParameters.get("title");
-            HTMLPageSpec page = new HTMLPageSpec(currentServerSpec, id, title);
-            specification = new HTMLPageElementSpec(page, guiElementClass, id, index);
-        }
-
-        return specification;
-    }
-}
Index: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/OldHTMLLogParser.java
===================================================================
--- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/OldHTMLLogParser.java	(revision 1064)
+++ 	(revision )
@@ -1,448 +1,0 @@
-//   Copyright 2012 Georg-August-Universität Göttingen, Germany
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-package de.ugoe.cs.autoquest.plugin.html;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import de.ugoe.cs.autoquest.eventcore.Event;
-import de.ugoe.cs.autoquest.eventcore.gui.DialogClose;
-import de.ugoe.cs.autoquest.eventcore.gui.DialogOpen;
-import de.ugoe.cs.autoquest.eventcore.gui.IInteraction;
-import de.ugoe.cs.autoquest.eventcore.gui.KeyboardFocusChange;
-import de.ugoe.cs.autoquest.eventcore.gui.MouseButtonInteraction;
-import de.ugoe.cs.autoquest.eventcore.gui.MouseClick;
-import de.ugoe.cs.autoquest.eventcore.gui.Scroll;
-import de.ugoe.cs.autoquest.eventcore.gui.TextInput;
-import de.ugoe.cs.autoquest.eventcore.guimodel.GUIElementFactory;
-import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel;
-import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModelException;
-import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement;
-import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElementSpec;
-import de.ugoe.cs.autoquest.eventcore.guimodel.ITextArea;
-import de.ugoe.cs.autoquest.eventcore.guimodel.ITextField;
-import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLPageElementSpec;
-import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLPageSpec;
-import de.ugoe.cs.util.FileTools;
-import de.ugoe.cs.util.console.Console;
-
-/**
- * <p>
- * TODO comment
- * </p>
- * 
- * @author Patrick Harms
- */
-public class OldHTMLLogParser {
-
-    /**
-     * <p>
-     * Name and path of the robot filter.
-     * </p>
-     */
-    private static final String ROBOTFILTERFILE = "data/robots/robotfilter.txt";
-
-    /**
-     * <p>
-     * Field that contains a regular expression that matches all robots
-     * contained in {@link #ROBOTFILTERFILE}.
-     * </p>
-     */
-    private String robotRegex = null;
-
-    /**
-     * 
-     */
-    private Pattern htmlElementPattern = Pattern.compile("(\\w+)(\\[(\\d+)\\]|\\(id=([\\w-]+)\\))");
-
-    /**
-     * 
-     */
-    private List<List<Event>> sequences = new ArrayList<List<Event>>();
-    
-    /**
-     * 
-     */
-    private GUIModel guiModel = new GUIModel();
-    
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     * 
-     * @param source
-     */
-    public void parseFile(String source) throws IllegalArgumentException {
-        if (source == null) {
-            throw new IllegalArgumentException("source must not be null");
-        }
-
-        parseFile(new File(source));
-    }
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     * 
-     * @param source
-     */
-    public void parseFile(File source) throws IllegalArgumentException {
-        if (source == null) {
-            throw new IllegalArgumentException("source must not be null");
-        }
-        else if (!source.exists()) {
-            throw new IllegalArgumentException("source file does not exist");
-        }
-        else if (!source.isFile()) {
-            throw new IllegalArgumentException("source is not a file");
-        }
-
-        BufferedReader reader = null;
-        
-        try {
-            reader =
-                new BufferedReader(new InputStreamReader(new FileInputStream(source), "UTF-8"));
-        
-            loadRobotRegex();
-
-            List<Event> sequence = new ArrayList<Event>();
-
-            int lineCounter = 0;
-            String line = reader.readLine();
-            while ((line != null) && (!"".equals(line))) {
-                lineCounter++;
-                String[] values = line.substring(1, line.length() - 1).split("\" \"");
-
-                String clientId = values[0];
-                long timestamp = Long.parseLong(values[1]);
-                String title = values[2];
-                String uriString = values[3];
-                String agent = values[4];
-                String eventName = values[5];
-                String htmlElementPath = values[6];
-
-                List<String> eventParameters = null;
-                if (values.length > 7) {
-                    eventParameters = new ArrayList<String>();
-
-                    for (int i = 7; i < values.length; i++) {
-                        eventParameters.add(values[i]);
-                    }
-                }
-                
-                if (isRobot(agent)) {
-                    // do not handle sessions of robots
-                    Console.println("ignoring robot session: " + agent);
-                    break;
-                }
-                
-                
-                try {
-                    URL url = new URL(uriString);
-                    IGUIElement guiElement = getGUIElement(url, title, htmlElementPath);
-                    IInteraction interaction =
-                        getInteraction(eventName, guiElement, eventParameters);
-                    
-                    if (interaction != null) {
-                        Event event =
-                            createEvent(clientId, interaction, guiElement, timestamp, agent);
-                        sequence.add(event);
-                    }
-                }
-                catch (MalformedURLException e) {
-                    Console.traceln(Level.FINE, "Ignored line " + lineCounter + ": " +
-                                    e.getMessage());
-                }
-                
-                line = reader.readLine();
-            }
-            
-            Console.traceln(Level.INFO, "read user sequence with " + sequence.size() +
-                            " events from " + source);
-            
-            sequences.add(sequence);
-        }
-        catch (Exception e) {
-            Console.printerrln("could not parse file " + source + ": " + e);
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     * 
-     * @return
-     */
-    public Collection<List<Event>> getSequences() {
-        return sequences;
-    }
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     * 
-     * @return
-     */
-    public GUIModel getGuiModel() {
-        return guiModel;
-    }
-
-    /**
-     * <p>
-     * Reads {@link #ROBOTFILTERFILE} and creates a regular expression that
-     * matches all the robots defined in the file. The regular expression is
-     * stored in the field {@link #robotRegex}.
-     * </p>
-     * 
-     * @throws IOException
-     *             thrown if there is a problem reading the robot filter
-     * @throws FileNotFoundException
-     *             thrown if the robot filter is not found
-     */
-    private void loadRobotRegex() throws IOException, FileNotFoundException {
-        String[] lines = FileTools.getLinesFromFile(ROBOTFILTERFILE);
-        StringBuilder regex = new StringBuilder();
-        for (int i = 0; i < lines.length; i++) {
-            regex.append("(.*" + lines[i] + ".*)");
-            if (i != lines.length - 1) {
-                regex.append('|');
-            }
-        }
-        robotRegex = regex.toString();
-    }
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     *
-     * @param htmlElementPath
-     * @return
-     * @throws GUIModelException 
-     * @throws  
-     */
-    private IGUIElement getGUIElement(URL url, String title, String htmlElementPath)
-        throws GUIModelException
-    {
-        String[] pathElements = htmlElementPath.split("/");
-        List<IGUIElementSpec> guiElementPath = new ArrayList<IGUIElementSpec>();
-        
-        HTMLPageSpec page = new HTMLPageSpec(url, title);
-        
-        guiElementPath.add(page.getServer());
-        guiElementPath.add(page);
-        
-        for (String pathElement : pathElements) {
-            if ((pathElement != null) && (!"".equals(pathElement))) {            
-                Matcher matcher = htmlElementPattern.matcher(pathElement);
-                if (!matcher.matches()) {
-                    throw new IllegalArgumentException("could not parse HTML element " + pathElement);
-                }
-
-                String type = matcher.group(1);
-                String indexStr = matcher.group(3);
-                String id = matcher.group(4);
-
-                int index = -1;
-
-                if ((indexStr != null) && (!"".equals(indexStr))) {
-                    index = Integer.parseInt(indexStr);
-                }
-
-                guiElementPath.add(new HTMLPageElementSpec(page, type, id, index));
-            }
-        }
-        
-        return guiModel.integratePath(guiElementPath, GUIElementFactory.getInstance());
-    }
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     *
-     * @param eventName
-     * @param guiElement 
-     * @param eventParameters
-     * @return
-     */
-    private IInteraction getInteraction(String       eventName,
-                                        IGUIElement  guiElement,
-                                        List<String> eventParameters)
-    {
-        IInteraction result = null;
-        
-        if ("onclick".equals(eventName)) {
-            int[] coordinates =
-                getCoordinateParameter(eventName, eventParameters, 0, "click coordinates");
-            result = new MouseClick
-                (MouseButtonInteraction.Button.LEFT, coordinates[0], coordinates[1]);
-        }
-        else if ("onfocus".equals(eventName)) {
-            result = new KeyboardFocusChange();
-        }
-        else if ("onscroll".equals(eventName)) {
-            int[] coordinates =
-                getCoordinateParameter(eventName, eventParameters, 0, "click coordinates");
-            result = new Scroll(coordinates[0], coordinates[1]);
-        }
-        else if ("onchange".equals(eventName)) {
-            String value = getStringParameter(eventName, eventParameters, 0, "selected value");
-            
-            if ((guiElement instanceof ITextArea) || (guiElement instanceof ITextField)) {
-                result = new TextInput(value, null);
-            }
-            else {
-                throw new IllegalArgumentException("can not handle onchange events on GUI " +
-                                                   "elements of type " + guiElement.getClass()); 
-            }
-        }
-        else if ("onload".equals(eventName)) {
-            result = new DialogOpen();
-        }
-        else if ("onunload".equals(eventName)) {
-            result = new DialogClose();
-        }
-        else if ("onbeforeunload".equals(eventName) ||
-                 "onpagehide".equals(eventName) ||
-                 "onpageshow".equals(eventName))
-        {
-            Console.traceln(Level.FINE, "Ignored event name \"" + eventName + "\"");
-        }
-        else {
-            throw new IllegalArgumentException("unknown event name: \"" + eventName + "\""); 
-        }
-        
-        return result;
-    }
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     *
-     * @param clientId
-     * @param interaction
-     * @param guiElement
-     * @param timestamp
-     * @param agent
-     * @return
-     */
-    private Event createEvent(String       clientId,
-                              IInteraction interaction,
-                              IGUIElement  guiElement,
-                              long         timestamp,
-                              String       agent)
-    {
-        Event event = new Event(interaction, guiElement);
-        event.setParameter("clientId", clientId);
-        event.setParameter("agent", agent);
-        
-        event.setTimestamp(timestamp);
-        
-        return event;
-    }
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     *
-     * @param eventName
-     * @param eventParameters
-     * @param i
-     * @param string
-     * @return
-     */
-    private String getStringParameter(String       eventName,
-                                      List<String> eventParameters,
-                                      int          parameterIndex,
-                                      String       parameterDesc)
-        throws IllegalArgumentException
-    {
-        String value =
-            eventParameters.size() > parameterIndex ? eventParameters.get(parameterIndex) : null;
-        
-        if (value == null) {
-            throw new IllegalArgumentException
-                (eventName + " event does not provide the " + parameterDesc);
-        }
-        
-        return value;
-    }
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     *
-     * @param eventName
-     * @param eventParameters
-     * @return
-     */
-    private int[] getCoordinateParameter(String       eventName,
-                                         List<String> eventParameters,
-                                         int          parameterIndex,
-                                         String       parameterDesc)
-    {
-        String value =
-            getStringParameter(eventName, eventParameters, parameterIndex, parameterDesc);
-        
-        String[] intStrs = value.split(",");
-        
-        if ((intStrs == null) || (intStrs.length != 2)) {
-            throw new IllegalArgumentException("the " + parameterDesc + " of an " + eventName +
-                                               " event does not provide two correct coordinates");
-        }
-        
-        try {
-            return new int[] { Integer.parseInt(intStrs[0]), Integer.parseInt(intStrs[1]) };
-        }
-        catch (NumberFormatException e) {
-            throw new IllegalArgumentException("the coordinates provided as " + parameterDesc +
-                                               " of an " + eventName + " event are no numbers");
-        }
-    }
-
-    /**
-     * <p>
-     * Checks whether an agent is a robot.
-     * </p>
-     * 
-     * @param agent
-     *            agent that is checked
-     * @return true, if the agent is a robot; false otherwise
-     */
-    private boolean isRobot(String agent) {
-        return agent.matches(robotRegex);
-    }
-
-}
Index: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/eventcore/HTMLEventTypeFactory.java
===================================================================
--- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/eventcore/HTMLEventTypeFactory.java	(revision 1064)
+++ trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/eventcore/HTMLEventTypeFactory.java	(revision 1069)
@@ -23,4 +23,5 @@
 import de.ugoe.cs.autoquest.eventcore.gui.MouseButtonInteraction;
 import de.ugoe.cs.autoquest.eventcore.gui.MouseClick;
+import de.ugoe.cs.autoquest.eventcore.gui.MouseDoubleClick;
 import de.ugoe.cs.autoquest.eventcore.gui.Scroll;
 import de.ugoe.cs.autoquest.eventcore.gui.TextInput;
@@ -76,11 +77,18 @@
 
         if ("onscroll".equals(eventName)) {
-            int[] coordinates = getCoordinateParameter(eventName, eventParameters);
+            int[] coordinates =
+                getCoordinateParameter("scrollX", "scrollY", eventName, eventParameters);
+            
             result = new Scroll(coordinates[0], coordinates[1]);
         }
         else if ("onclick".equals(eventName)) {
-            int[] coordinates = getCoordinateParameter(eventName, eventParameters);
+            int[] coordinates = getCoordinateParameter("X", "Y", eventName, eventParameters);
             result =
                 new MouseClick(MouseButtonInteraction.Button.LEFT, coordinates[0], coordinates[1]);
+        }
+        else if ("ondblclick".equals(eventName)) {
+            int[] coordinates = getCoordinateParameter("X", "Y", eventName, eventParameters);
+            result = new MouseDoubleClick
+                (MouseButtonInteraction.Button.LEFT, coordinates[0], coordinates[1]);
         }
         else if ("onchange".equals(eventName)) {
@@ -118,13 +126,19 @@
      * @return
      */
-    private int[] getCoordinateParameter(String eventName, Map<String, String> eventParameters) {
-        String xCoord = eventParameters.get("X");
+    private int[] getCoordinateParameter(String              xParamName,
+                                         String              yParamName,
+                                         String              eventName,
+                                         Map<String, String> eventParameters)
+    {
+        String xCoord = eventParameters.get(xParamName);
         if (xCoord == null) {
-            throw new IllegalArgumentException("eventParameters do not contain X coordinate.");
+            throw new IllegalArgumentException
+                ("eventParameters do not contain " + xParamName + " coordinate.");
         }
 
-        String yCoord = eventParameters.get("Y");
+        String yCoord = eventParameters.get(yParamName);
         if (yCoord == null) {
-            throw new IllegalArgumentException("eventParameters do not contain Y coordinate.");
+            throw new IllegalArgumentException
+                ("eventParameters do not contain " + yParamName + " coordinate.");
         }
 
@@ -134,5 +148,5 @@
         }
         catch (NumberFormatException e) {
-            throw new IllegalArgumentException("the coordinates provided" + " of an " + eventName +
+            throw new IllegalArgumentException("the coordinates provided by an " + eventName +
                 " event are no numbers");
         }
Index: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLDocument.java
===================================================================
--- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLDocument.java	(revision 1069)
+++ trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLDocument.java	(revision 1069)
@@ -0,0 +1,96 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.plugin.html.guimodel;
+
+import de.ugoe.cs.autoquest.eventcore.guimodel.IDialog;
+
+/**
+ * <p>
+ * TODO comment
+ * </p>
+ * 
+ * @author Patrick Harms
+ */
+public class HTMLDocument extends HTMLGUIElement implements IDialog {
+
+    /**  */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @param specification
+     * @param parent
+     */
+    public HTMLDocument(HTMLDocumentSpec specification, HTMLServer parent) {
+        super(specification, parent);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        return "Document(" + getPath() + ", \"" + getTitle() + "\")";
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement#getElementDescriptor()
+     */
+    @Override
+    protected String getElementDescriptor() {
+        return "Document";
+    }
+
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @return
+     */
+    HTMLServerSpec getServer() {
+        return ((HTMLDocumentSpec) super.getSpecification()).getServer();
+    }
+
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @return
+     */
+    String getPath() {
+        return ((HTMLDocumentSpec) super.getSpecification()).getPath();
+    }
+
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @return
+     */
+    String getTitle() {
+        return ((HTMLDocumentSpec) super.getSpecification()).getTitle();
+    }
+
+}
Index: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLDocumentSpec.java
===================================================================
--- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLDocumentSpec.java	(revision 1069)
+++ trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLDocumentSpec.java	(revision 1069)
@@ -0,0 +1,140 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.plugin.html.guimodel;
+
+import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElementSpec;
+
+/**
+ * <p>
+ * TODO comment
+ * </p>
+ * 
+ * @author Patrick Harms
+ */
+public class HTMLDocumentSpec extends HTMLGUIElementSpec implements IGUIElementSpec {
+
+    /**  */
+    private static final long serialVersionUID = 1L;
+    
+    /** */
+    private HTMLServerSpec server;
+    
+    /** */
+    private String path;
+    
+    /** */
+    private String query;
+    
+    /** */
+    private String title;
+    
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @param server
+     * @param pagePath
+     * @param pageTitle
+     */
+    public HTMLDocumentSpec(HTMLServerSpec server, String path, String query, String title) {
+        super("document");
+        
+        if (server == null) {
+            throw new IllegalArgumentException("server must not be null");
+        }
+        else if (path == null) {
+            throw new IllegalArgumentException("pagePath must not be null");
+        }
+        
+        this.server = server;
+        this.path = path;
+        this.query = query;
+        this.title = title;
+    }
+
+    /* (non-Javadoc)
+     * @see de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElementSpec#getSimilarity(IGUIElementSpec)
+     */
+    @Override
+    public boolean getSimilarity(IGUIElementSpec other) {
+        if (other instanceof HTMLDocumentSpec) {
+            HTMLDocumentSpec otherSpec = (HTMLDocumentSpec) other;
+            
+            if (!super.getSimilarity(otherSpec)) {
+                return false;
+            }
+            else if (!server.getSimilarity(otherSpec.server)) {
+                return false;
+            }
+            else if (!path.equals(otherSpec.path)) {
+                return false;
+            }
+            else if (query != null ? !query.equals(otherSpec.query) : otherSpec.query != null) {
+                return false;
+            }
+            else {
+                return (title != null ? title.equals(otherSpec.title) : otherSpec.title == null);
+            }
+        }
+        
+        return false;
+    }
+
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @return
+     */
+    public HTMLServerSpec getServer() {
+        return server;
+    }
+
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @return
+     */
+    String getPath() {
+        return path;
+    }
+
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @return
+     */
+    String getQuery() {
+        return query;
+    }
+
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @return
+     */
+    String getTitle() {
+        return title;
+    }
+
+}
Index: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPage.java
===================================================================
--- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPage.java	(revision 1064)
+++ 	(revision )
@@ -1,96 +1,0 @@
-//   Copyright 2012 Georg-August-Universität Göttingen, Germany
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-package de.ugoe.cs.autoquest.plugin.html.guimodel;
-
-import de.ugoe.cs.autoquest.eventcore.guimodel.IDialog;
-
-/**
- * <p>
- * TODO comment
- * </p>
- * 
- * @author Patrick Harms
- */
-public class HTMLPage extends HTMLGUIElement implements IDialog {
-
-    /**  */
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     *
-     * @param specification
-     * @param parent
-     */
-    public HTMLPage(HTMLPageSpec specification, HTMLServer parent) {
-        super(specification, parent);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see java.lang.Object#toString()
-     */
-    @Override
-    public String toString() {
-        return "Page(" + getPagePath() + ", \"" + getPageTitle() + "\")";
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement#getElementDescriptor()
-     */
-    @Override
-    protected String getElementDescriptor() {
-        return "Page";
-    }
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     *
-     * @return
-     */
-    HTMLServerSpec getServer() {
-        return ((HTMLPageSpec) super.getSpecification()).getServer();
-    }
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     *
-     * @return
-     */
-    String getPagePath() {
-        return ((HTMLPageSpec) super.getSpecification()).getPagePath();
-    }
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     *
-     * @return
-     */
-    String getPageTitle() {
-        return ((HTMLPageSpec) super.getSpecification()).getPageTitle();
-    }
-
-}
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 1064)
+++ trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageElement.java	(revision 1069)
@@ -47,5 +47,5 @@
      * @param parent
      */
-    public HTMLPageElement(HTMLPageElementSpec specification, HTMLPage parent) {
+    public HTMLPageElement(HTMLPageElementSpec specification, HTMLDocument parent) {
         super(specification, parent);
     }
@@ -58,11 +58,11 @@
     @Override
     public String toString() {
-        String str = getTag();
+        String str = getTagName();
         
-        if ((getTagId() != null) && (!"".equals(getTagId()))) {
-            str += "(id=\"" + getTagId() + "\")";
+        if ((getHtmlId() != null) && (!"".equals(getHtmlId()))) {
+            str += "(id=\"" + getHtmlId() + "\")";
         }
         else {
-            str += "[" + getTagIndex() + "]";
+            str += "[" + getIndex() + "]";
         }
         
@@ -77,5 +77,5 @@
     @Override
     protected String getElementDescriptor() {
-        return getTag();
+        return getTagName();
     }
 
@@ -87,5 +87,5 @@
      * @return
      */
-    HTMLPageSpec getPage() {
+    HTMLDocumentSpec getPage() {
         return ((HTMLPageElementSpec) super.getSpecification()).getPage();
     }
@@ -98,6 +98,6 @@
      * @return
      */
-    String getTag() {
-        return ((HTMLPageElementSpec) super.getSpecification()).getTag();
+    String getTagName() {
+        return ((HTMLPageElementSpec) super.getSpecification()).getTagName();
     }
 
@@ -109,6 +109,6 @@
      * @return
      */
-    String getTagId() {
-        return ((HTMLPageElementSpec) super.getSpecification()).getTagId();
+    String getHtmlId() {
+        return ((HTMLPageElementSpec) super.getSpecification()).getHtmlId();
     }
 
@@ -120,6 +120,6 @@
      * @return
      */
-    int getTagIndex() {
-        return ((HTMLPageElementSpec) super.getSpecification()).getTagIndex();
+    int getIndex() {
+        return ((HTMLPageElementSpec) super.getSpecification()).getIndex();
     }
 
Index: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageElementSpec.java
===================================================================
--- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageElementSpec.java	(revision 1064)
+++ trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageElementSpec.java	(revision 1069)
@@ -30,11 +30,11 @@
     
     /** */
-    private HTMLPageSpec page;
+    private HTMLDocumentSpec page;
     
     /** */
-    private String tag;
+    private String tagName;
     
     /** */
-    private String id;
+    private String htmlId;
     
     /** */
@@ -50,14 +50,14 @@
      * @param id
      */
-    public HTMLPageElementSpec(HTMLPageSpec page, String tag, String id, int index) {
-        super(tag);
+    public HTMLPageElementSpec(HTMLDocumentSpec page, String tagName, String htmlId, int index) {
+        super(tagName);
         
         if (page == null) {
             throw new IllegalArgumentException("page must not be null");
         }
-        else if (tag == null) {
+        else if (tagName == null) {
             throw new IllegalArgumentException("tag must not be null");
         }
-        else if ((id == null) && (index < 0)) {
+        else if ((htmlId == null) && (index < 0)) {
             throw new IllegalArgumentException
                 ("either id must not be null or the index must be greater or equal to 0");
@@ -65,6 +65,6 @@
         
         this.page = page;
-        this.tag = tag;
-        this.id = id;
+        this.tagName = tagName;
+        this.htmlId = htmlId;
         this.index = index;
     }
@@ -84,10 +84,10 @@
                 return false;
             }
-            else if (!tag.equals(otherSpec.tag)) {
+            else if (!tagName.equals(otherSpec.tagName)) {
                 return false;
             }
             
-            if (id != null) {
-                return id.equals(otherSpec.id);
+            if (htmlId != null) {
+                return htmlId.equals(otherSpec.htmlId);
             }
             else if (index >= 0) {
@@ -106,5 +106,5 @@
      * @return
      */
-    public HTMLPageSpec getPage() {
+    HTMLDocumentSpec getPage() {
         return page;
     }
@@ -117,6 +117,6 @@
      * @return
      */
-    String getTag() {
-        return tag;
+    String getTagName() {
+        return tagName;
     }
 
@@ -128,6 +128,6 @@
      * @return
      */
-    String getTagId() {
-        return id;
+    String getHtmlId() {
+        return htmlId;
     }
 
@@ -139,5 +139,5 @@
      * @return
      */
-    int getTagIndex() {
+    int getIndex() {
         return index;
     }
Index: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageSpec.java
===================================================================
--- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageSpec.java	(revision 1064)
+++ 	(revision )
@@ -1,151 +1,0 @@
-//   Copyright 2012 Georg-August-Universität Göttingen, Germany
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-package de.ugoe.cs.autoquest.plugin.html.guimodel;
-
-import java.net.URL;
-
-import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElementSpec;
-
-/**
- * <p>
- * TODO comment
- * </p>
- * 
- * @author Patrick Harms
- */
-public class HTMLPageSpec extends HTMLGUIElementSpec implements IGUIElementSpec {
-
-    /**  */
-    private static final long serialVersionUID = 1L;
-    
-    /** */
-    private HTMLServerSpec server;
-    
-    /** */
-    private String pagePath;
-    
-    /** */
-    private String pageTitle;
-    
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     *
-     * @param server
-     * @param pagePath
-     * @param pageTitle
-     */
-    public HTMLPageSpec(HTMLServerSpec server, String pagePath, String pageTitle) {
-        super("page");
-        
-        if (server == null) {
-            throw new IllegalArgumentException("server must not be null");
-        }
-        else if (pagePath == null) {
-            throw new IllegalArgumentException("pagePath must not be null");
-        }
-//        else if (pageTitle == null) {
-//            throw new IllegalArgumentException("pageTitle must not be null");
-//        }
-        
-        this.server = server;
-        this.pagePath = pagePath;
-        this.pageTitle = pageTitle;
-    }
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     *
-     * @param server
-     * @param pagePath
-     * @param pageTitle
-     */
-    public HTMLPageSpec(URL pageURL, String pageTitle) {
-        super("page");
-        
-        if (pageURL == null) {
-            throw new IllegalArgumentException("pageURL must not be null");
-        }
-        else if (pageTitle == null) {
-            throw new IllegalArgumentException("pageTitle must not be null");
-        }
-        
-        this.server = new HTMLServerSpec(pageURL);
-        this.pagePath = pageURL.getPath();
-        this.pageTitle = pageTitle;
-    }
-
-    /* (non-Javadoc)
-     * @see de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElementSpec#getSimilarity(IGUIElementSpec)
-     */
-    @Override
-    public boolean getSimilarity(IGUIElementSpec other) {
-        if (other instanceof HTMLPageSpec) {
-            HTMLPageSpec otherSpec = (HTMLPageSpec) other;
-            
-            if (!super.getSimilarity(otherSpec)) {
-                return false;
-            }
-            else if (!server.getSimilarity(otherSpec.server)) {
-                return false;
-            }
-            else if (!pagePath.equals(otherSpec.pagePath)) {
-                return false;
-            }
-            else {
-                return pageTitle.equals(otherSpec.pageTitle);
-            }
-        }
-        
-        return false;
-    }
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     *
-     * @return
-     */
-    public HTMLServerSpec getServer() {
-        return server;
-    }
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     *
-     * @return
-     */
-    public String getPagePath() {
-        return pagePath;
-    }
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     *
-     * @return
-     */
-    String getPageTitle() {
-        return pageTitle;
-    }
-
-}
Index: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLServerSpec.java
===================================================================
--- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLServerSpec.java	(revision 1064)
+++ trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLServerSpec.java	(revision 1069)
@@ -14,6 +14,4 @@
 
 package de.ugoe.cs.autoquest.plugin.html.guimodel;
-
-import java.net.URL;
 
 import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElementSpec;
@@ -58,22 +56,4 @@
         this.host = host;
         this.port = port;
-    }
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     *
-     * @param pageURL
-     */
-    public HTMLServerSpec(URL pageURL) {
-        super("server");
-
-        if (pageURL == null) {
-            throw new IllegalArgumentException("page URL must not be null");
-        }
-
-        this.host = pageURL.getHost();
-        this.port = pageURL.getPort();
     }
 
