Index: trunk/src/xmlpatterns/acceltree/qacceltreebuilder.cpp
===================================================================
--- trunk/src/xmlpatterns/acceltree/qacceltreebuilder.cpp	(revision 5)
+++ trunk/src/xmlpatterns/acceltree/qacceltreebuilder.cpp	(revision 561)
@@ -2,5 +2,6 @@
 **
 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
 **
 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
@@ -21,8 +22,7 @@
 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 **
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
 **
 ** GNU General Public License Usage
@@ -34,6 +34,6 @@
 ** met: http://www.gnu.org/copyleft/gpl.html.
 **
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
 ** $QT_END_LICENSE$
 **
@@ -50,13 +50,15 @@
                                                  const QUrl &baseURI,
                                                  const NamePool::Ptr &np,
-                                                 ReportContext *const context) : m_preNumber(-1)
-                                                                               , m_isPreviousAtomic(false)
-                                                                               , m_hasCharacters(false)
-                                                                               , m_isCharactersCompressed(false)
-                                                                               , m_namePool(np)
-                                                                               , m_document(new AccelTree(docURI, baseURI))
-                                                                               , m_skippedDocumentNodes(0)
-                                                                               , m_documentURI(docURI)
-                                                                               , m_context(context)
+                                                 ReportContext *const context,
+                                                 Features features) : m_preNumber(-1)
+                                                                    , m_isPreviousAtomic(false)
+                                                                    , m_hasCharacters(false)
+                                                                    , m_isCharactersCompressed(false)
+                                                                    , m_namePool(np)
+                                                                    , m_document(new AccelTree(docURI, baseURI))
+                                                                    , m_skippedDocumentNodes(0)
+                                                                    , m_documentURI(docURI)
+                                                                    , m_context(context)
+                                                                    , m_features(features)
 {
     Q_ASSERT(m_namePool);
@@ -127,7 +129,16 @@
 void AccelTreeBuilder<FromDocument>::startElement(const QXmlName &name)
 {
+    startElement(name, 1, 1);
+}
+
+template <bool FromDocument>
+void AccelTreeBuilder<FromDocument>::startElement(const QXmlName &name, qint64 line, qint64 column)
+{
     startStructure();
 
-    m_document->basicData.append(AccelTree::BasicNodeData(currentDepth(), currentParent(), QXmlNodeModelIndex::Element, -1, name));
+    AccelTree::BasicNodeData data(currentDepth(), currentParent(), QXmlNodeModelIndex::Element, -1, name);
+    m_document->basicData.append(data);
+    if (m_features & SourceLocationsFeature)
+        m_document->sourcePositions.insert(m_document->maximumPreNumber(), qMakePair(line, column));
 
     ++m_preNumber;
