summaryrefslogtreecommitdiffstats
path: root/examples/xml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/xml')
-rw-r--r--examples/xml/README40
-rw-r--r--examples/xml/dombookmarks/dombookmarks.pro20
-rw-r--r--examples/xml/dombookmarks/frank.xbel230
-rw-r--r--examples/xml/dombookmarks/jennifer.xbel93
-rw-r--r--examples/xml/dombookmarks/main.cpp52
-rw-r--r--examples/xml/dombookmarks/mainwindow.cpp145
-rw-r--r--examples/xml/dombookmarks/mainwindow.h75
-rw-r--r--examples/xml/dombookmarks/xbeltree.cpp186
-rw-r--r--examples/xml/dombookmarks/xbeltree.h74
-rw-r--r--examples/xml/htmlinfo/apache_org.html281
-rw-r--r--examples/xml/htmlinfo/htmlinfo.pro19
-rw-r--r--examples/xml/htmlinfo/main.cpp118
-rw-r--r--examples/xml/htmlinfo/nokia_com.html215
-rw-r--r--examples/xml/htmlinfo/simpleexample.html11
-rw-r--r--examples/xml/htmlinfo/trolltech_com.html955
-rw-r--r--examples/xml/htmlinfo/w3c_org.html507
-rw-r--r--examples/xml/htmlinfo/youtube_com.html1585
-rw-r--r--examples/xml/rsslisting/main.cpp63
-rw-r--r--examples/xml/rsslisting/rsslisting.cpp247
-rw-r--r--examples/xml/rsslisting/rsslisting.h90
-rw-r--r--examples/xml/rsslisting/rsslisting.pro12
-rw-r--r--examples/xml/saxbookmarks/frank.xbel230
-rw-r--r--examples/xml/saxbookmarks/jennifer.xbel93
-rw-r--r--examples/xml/saxbookmarks/main.cpp56
-rw-r--r--examples/xml/saxbookmarks/mainwindow.cpp169
-rw-r--r--examples/xml/saxbookmarks/mainwindow.h77
-rw-r--r--examples/xml/saxbookmarks/saxbookmarks.pro28
-rw-r--r--examples/xml/saxbookmarks/xbelgenerator.cpp114
-rw-r--r--examples/xml/saxbookmarks/xbelgenerator.h68
-rw-r--r--examples/xml/saxbookmarks/xbelhandler.cpp146
-rw-r--r--examples/xml/saxbookmarks/xbelhandler.h78
-rw-r--r--examples/xml/streambookmarks/frank.xbel230
-rw-r--r--examples/xml/streambookmarks/jennifer.xbel93
-rw-r--r--examples/xml/streambookmarks/main.cpp54
-rw-r--r--examples/xml/streambookmarks/mainwindow.cpp174
-rw-r--r--examples/xml/streambookmarks/mainwindow.h79
-rw-r--r--examples/xml/streambookmarks/streambookmarks.pro16
-rw-r--r--examples/xml/streambookmarks/xbelreader.cpp175
-rw-r--r--examples/xml/streambookmarks/xbelreader.h83
-rw-r--r--examples/xml/streambookmarks/xbelwriter.cpp92
-rw-r--r--examples/xml/streambookmarks/xbelwriter.h65
-rw-r--r--examples/xml/xml.pro20
-rw-r--r--examples/xml/xmlstreamlint/main.cpp127
-rw-r--r--examples/xml/xmlstreamlint/xmlstreamlint.pro12
44 files changed, 7297 insertions, 0 deletions
diff --git a/examples/xml/README b/examples/xml/README
new file mode 100644
index 0000000000..a6d81bb58a
--- /dev/null
+++ b/examples/xml/README
@@ -0,0 +1,40 @@
+XML parsing and handling is supported through SAX and DOM compliant APIs.
+
+Qt's SAX compliant classes allow you to parse XML incrementally; the DOM
+classes enable more complex document-level operations to be performed on
+XML files.
+
+
+The example launcher provided with Qt can be used to explore each of the
+examples in this directory.
+
+Documentation for these examples can be found via the Tutorial and Examples
+link in the main Qt documentation.
+
+
+Finding the Qt Examples and Demos launcher
+==========================================
+
+On Windows:
+
+The launcher can be accessed via the Windows Start menu. Select the menu
+entry entitled "Qt Examples and Demos" entry in the submenu containing
+the Qt tools.
+
+On Mac OS X:
+
+For the binary distribution, the qtdemo executable is installed in the
+/Developer/Applications/Qt directory. For the source distribution, it is
+installed alongside the other Qt tools on the path specified when Qt is
+configured.
+
+On Unix/Linux:
+
+The qtdemo executable is installed alongside the other Qt tools on the path
+specified when Qt is configured.
+
+On all platforms:
+
+The source code for the launcher can be found in the demos/qtdemo directory
+in the Qt package. This example is built at the same time as the Qt libraries,
+tools, examples, and demonstrations.
diff --git a/examples/xml/dombookmarks/dombookmarks.pro b/examples/xml/dombookmarks/dombookmarks.pro
new file mode 100644
index 0000000000..d071ccd0ee
--- /dev/null
+++ b/examples/xml/dombookmarks/dombookmarks.pro
@@ -0,0 +1,20 @@
+HEADERS = mainwindow.h \
+ xbeltree.h
+SOURCES = main.cpp \
+ mainwindow.cpp \
+ xbeltree.cpp
+QT += xml
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml/dombookmarks
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS dombookmarks.pro *.xbel
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml/dombookmarks
+INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+
+wince*: {
+ addFiles.files = frank.xbel jennifer.xbel
+ addFiles.path = "\\My Documents"
+ DEPLOYMENT += addFiles
+}
diff --git a/examples/xml/dombookmarks/frank.xbel b/examples/xml/dombookmarks/frank.xbel
new file mode 100644
index 0000000000..6bd63b8b07
--- /dev/null
+++ b/examples/xml/dombookmarks/frank.xbel
@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xbel>
+<xbel version="1.0">
+ <folder folded="yes">
+ <title>Literate Programming</title>
+ <bookmark href="http://www.vivtek.com/litprog.html">
+ <title>Synopsis of Literate Programming</title>
+ </bookmark>
+ <bookmark href="http://vasc.ri.cmu.edu/old_help/Programming/Literate/literate.html">
+ <title>Literate Programming: Propaganda and Tools</title>
+ </bookmark>
+ <bookmark href="http://www.isy.liu.se/%7Eturbell/litprog/">
+ <title>Literate Programming by Henrik Turbell</title>
+ </bookmark>
+ <bookmark href="http://www.desy.de/user/projects/LitProg.html">
+ <title>Literate Programming Library</title>
+ </bookmark>
+ <bookmark href="http://www.loria.fr/services/tex/english/litte.html">
+ <title>Literate Programming Basics</title>
+ </bookmark>
+ <bookmark href="http://ei.cs.vt.edu/%7Ecs5014/courseNotes/4.LiterateProgramming/literate_prog.html">
+ <title>Literate Programming Overview</title>
+ </bookmark>
+ <bookmark href="http://www.perl.com/pub/a/tchrist/litprog.html">
+ <title>POD is not Literate Programming</title>
+ </bookmark>
+ <bookmark href="http://www.cornellcollege.edu/%7Eltabak/publications/articles/swsafety.html">
+ <title>Computers That We Can Count On</title>
+ </bookmark>
+ <bookmark href="http://www.cs.auc.dk/%7Enormark/litpro/issues-and-problems.html">
+ <title>Literate Programming - Issues and Problems</title>
+ </bookmark>
+ <bookmark href="http://c2.com/cgi/wiki?LiterateProgramming">
+ <title>Literate Programming - Wiki Pages</title>
+ </bookmark>
+ <bookmark href="http://developers.slashdot.org/developers/02/05/19/2216233.shtml">
+ <title>What is well-commented code?</title>
+ </bookmark>
+ <bookmark href="http://liinwww.ira.uka.de/bibliography/SE/litprog.html">
+ <title>Bibliography on literate programming - A searchable bibliography</title>
+ </bookmark>
+ <bookmark href="http://www2.umassd.edu/SWPI/ProcessBibliography/bib-codereading.html">
+ <title>Program comprehension and code reading bibliography</title>
+ </bookmark>
+ <bookmark href="http://www.cs.auc.dk/%7Enormark/elucidative-programming/">
+ <title>Elucidative Programming</title>
+ </bookmark>
+ <bookmark href="http://www.msu.edu/%7Epfaffben/avl/index.html">
+ <title>AVL Trees (TexiWeb)</title>
+ </bookmark>
+ <bookmark href="http://literate-programming.wikiverse.org/">
+ <title>Literate Programming on Wikiverse</title>
+ </bookmark>
+ <bookmark href="http://www.pbrt.org/">
+ <title>Physically Based Rendering: From Theory to Implementation</title>
+ </bookmark>
+ </folder>
+ <folder folded="no">
+ <title>Useful C++ Links</title>
+ <folder folded="no">
+ <title>STL</title>
+ <bookmark href="http://www.sgi.com/tech/stl/table_of_contents.html">
+ <title>STL Reference Documentation</title>
+ </bookmark>
+ <bookmark href="http://www.yrl.co.uk/~phil/stl/stl.htmlx">
+ <title>STL Tutorial</title>
+ </bookmark>
+ <bookmark href="http://www.cppreference.com/cpp_stl.html">
+ <title>STL Reference</title>
+ </bookmark>
+ </folder>
+ <folder folded="no">
+ <title>Qt</title>
+ <bookmark href="http://qt.nokia.com/doc/2.3/">
+ <title>Qt 2.3 Reference</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/doc/3.3/">
+ <title>Qt 3.3 Reference</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/doc/4.0/">
+ <title>Qt 4.0 Reference</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/">
+ <title>Qt Home Page</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>IOStreams</title>
+ <bookmark href="http://www.cplusplus.com/ref/iostream/index.html">
+ <title>IO Stream Library</title>
+ </bookmark>
+ <bookmark href="http://courses.cs.vt.edu/~cs2604/fall01/binio.html">
+ <title>Binary I/O</title>
+ </bookmark>
+ <bookmark href="http://www.parashift.com/c++-faq-lite/input-output.html">
+ <title>I/O Stream FAQ</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>gdb</title>
+ <bookmark href="http://www.cs.princeton.edu/~benjasik/gdb/gdbtut.html">
+ <title>GDB Tutorial</title>
+ </bookmark>
+ <bookmark href="http://www.gnu.org/manual/gdb-4.17/html_mono/gdb.html">
+ <title>Debugging with GDB</title>
+ </bookmark>
+ <bookmark href="http://www.cs.washington.edu/orgs/acm/tutorials/dev-in-unix/gdb-refcard.pdf">
+ <title>GDB Quick Reference Page (PDF) (Handy)</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>Classes and Constructors</title>
+ <bookmark href="http://www.parashift.com/c++-faq-lite/ctors.html">
+ <title>Constructor FAQ</title>
+ </bookmark>
+ <bookmark href="http://www.juicystudio.com/tutorial/cpp/index.html">
+ <title>Organizing Classes</title>
+ </bookmark>
+ </folder>
+ </folder>
+ <folder folded="yes">
+ <title>Software Documentation or System Documentation</title>
+ <bookmark href="http://www.martinfowler.com/distributedComputing/thud.html">
+ <title>The Almighty Thud</title>
+ </bookmark>
+ <bookmark href="http://msdn.microsoft.com/library/techart/cfr.htm">
+ <title>Microsoft Coding Techniques and Programming Practices</title>
+ </bookmark>
+ <bookmark href="http://www.bearcave.com/software/prog_docs.html">
+ <title>Software and Documentation</title>
+ </bookmark>
+ <bookmark href="http://c2.com/cgi/wiki?TheSourceCodeIsTheDesign">
+ <title>The Source Code is the Design</title>
+ </bookmark>
+ <bookmark href="http://www.bleading-edge.com/Publications/C++Journal/Cpjour2.htm">
+ <title>What is Software Design?</title>
+ </bookmark>
+ <bookmark href="http://www.mindprod.com/unmain.html">
+ <title>How To Write Unmaintainable Code</title>
+ </bookmark>
+ <bookmark href="http://www.idinews.com/selfDoc.html">
+ <title>Self Documenting Program Code Remains a Distant Goal</title>
+ </bookmark>
+ <bookmark href="http://www.sdmagazine.com/documents/s=730/sdm0106m/0106m.htm">
+ <title>Place Tab A in Slot B</title>
+ </bookmark>
+ <bookmark href="http://www.holub.com/class/uml/uml.html">
+ <title>UML Reference Card</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>TeX Resources</title>
+ <bookmark href="http://www.tug.org/">
+ <title>The TeX User's Group</title>
+ </bookmark>
+ <bookmark href="http://www.miktex.org/">
+ <title>MikTeX website</title>
+ </bookmark>
+ <bookmark href="http://cm.bell-labs.com/who/hobby/MetaPost.html">
+ <title>MetaPost website</title>
+ </bookmark>
+ <bookmark href="http://pauillac.inria.fr/%7Emaranget/hevea/">
+ <title>HEVEA is a quite complete and fast LATEX to HTML translator</title>
+ </bookmark>
+ </folder>
+ <folder folded="no">
+ <title>Portable Document Format (PDF)</title>
+ <bookmark href="http://www.adobe.com/">
+ <title>Adobe - The postscript and PDF standards</title>
+ </bookmark>
+ <bookmark href="http://partners.adobe.com/asn/developer/technotes/acrobatpdf.html">
+ <title>Reference Manual Portable Document Format</title>
+ </bookmark>
+ <bookmark href="http://partners.adobe.com/asn/developer/acrosdk/main.html">
+ <title>Adobe Acrobat Software Development Kit</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>Literature Sites</title>
+ <bookmark href="http://www.cc.columbia.edu/cu/libraries/subjects/speccol.html">
+ <title>Guide to Special Collections (Columbia University)</title>
+ </bookmark>
+ <bookmark href="http://www.ipl.org/ref/litcrit/">
+ <title>Literary Criticism on the Web from the Internet Public Library</title>
+ </bookmark>
+ <bookmark href="http://www.victorianweb.org/">
+ <title>Victorian Web.</title>
+ </bookmark>
+ <bookmark href="http://vos.ucsb.edu/">
+ <title>Voice of the Shuttle.</title>
+ </bookmark>
+ <bookmark href="http://www.modjourn.brown.edu/">
+ <title>Modernist Journals Project</title>
+ </bookmark>
+ <bookmark href="http://www.poetspath.com">
+ <title>Museum of American Poetics</title>
+ </bookmark>
+ <bookmark href="http://www.english.uiuc.edu/maps/">
+ <title>Modern American Poetry</title>
+ </bookmark>
+ <bookmark href="http://www.findarticles.com/">
+ <title>FindArticles.com</title>
+ </bookmark>
+ <bookmark href="http://www.literaryhistory.com">
+ <title>Literary History</title>
+ </bookmark>
+ <bookmark href="http://www.litencyc.com/LitEncycFrame.htm">
+ <title>Literary Encyclopedia</title>
+ </bookmark>
+ <separator/>
+ <bookmark href="http://texts.cdlib.org/ucpress/">
+ <title>The University of California Press</title>
+ </bookmark>
+ <bookmark href="http://www.letrs.indiana.edu/web/w/wright2/">
+ <title>Wright American Fiction, 1851-1875</title>
+ </bookmark>
+ <bookmark href="http://docsouth.unc.edu/">
+ <title>Documenting the American South: Beginnings to 1920</title>
+ </bookmark>
+ <bookmark href="http://etext.lib.virginia.edu/eng-on.html">
+ <title>Electronic Text Center at the University of Virginia</title>
+ </bookmark>
+ <bookmark href="http://digital.nypl.org/schomburg/writers_aa19/">
+ <title>The Schomburg Center for Research in Black Culture</title>
+ </bookmark>
+ <bookmark href="http://www.infomotions.com/alex2/">
+ <title>Alex Catalogue of Electronic Texts.</title>
+ </bookmark>
+ </folder>
+</xbel>
diff --git a/examples/xml/dombookmarks/jennifer.xbel b/examples/xml/dombookmarks/jennifer.xbel
new file mode 100644
index 0000000000..36256fda0a
--- /dev/null
+++ b/examples/xml/dombookmarks/jennifer.xbel
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xbel>
+<xbel version="1.0">
+ <folder folded="no">
+ <title>Qt Resources</title>
+ <folder folded="yes">
+ <title>Qt Partners</title>
+ <bookmark href="http://partners.trolltech.com/partners/training.html">
+ <title>Training Partners</title>
+ </bookmark>
+ <bookmark href="http://partners.trolltech.com/partners/service.html">
+ <title>Consultants and System Integrators</title>
+ </bookmark>
+ <bookmark href="http://partners.trolltech.com/partners/tech.html">
+ <title>Technology Partners</title>
+ </bookmark>
+ <bookmark href="http://partners.trolltech.com/partners/resellers.html">
+ <title>Value Added Resellers (VARs)</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>Community Resources</title>
+ <bookmark href="http://www.qtforum.org/">
+ <title>QtForum.org</title>
+ </bookmark>
+ <bookmark href="http://www.digitalfanatics.org/projects/qt_tutorial/">
+ <title>The Independent Qt Tutorial</title>
+ </bookmark>
+ <bookmark href="http://prog.qt.free.fr/">
+ <title>French PROG.Qt</title>
+ </bookmark>
+ <bookmark href="http://www.qtforum.de/">
+ <title>German Qt Forum</title>
+ </bookmark>
+ <bookmark href="http://www.korone.net/">
+ <title>Korean Qt Community Site</title>
+ </bookmark>
+ <bookmark href="http://prog.org.ru/forum/forum_14.html">
+ <title>Russian Qt Forum</title>
+ </bookmark>
+ <bookmark href="http://qt4.digitalfanatics.org/">
+ <title>Digitalfanatics: The QT 4 Resource Center</title>
+ </bookmark>
+ <bookmark href="http://www.qtquestions.org/">
+ <title>QtQuestions</title>
+ </bookmark>
+ </folder>
+ <bookmark href="http://qt.nokia.com/doc/qq/">
+ <title>Qt Quarterly</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/">
+ <title>Qt home page</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/doc/4.0/">
+ <title>Qt 4.0 documentation</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/developer/faqs/">
+ <title>Frequently Asked Questions</title>
+ </bookmark>
+ </folder>
+ <folder folded="no">
+ <title>Online Dictionaries</title>
+ <bookmark href="http://www.dictionary.com/">
+ <title>Dictionary.com</title>
+ </bookmark>
+ <bookmark href="http://www.m-w.com/">
+ <title>Merriam-Webster Online</title>
+ </bookmark>
+ <bookmark href="http://dictionary.cambridge.org/">
+ <title>Cambridge Dictionaries Online</title>
+ </bookmark>
+ <bookmark href="http://www.onelook.com/">
+ <title>OneLook Dictionary Search</title>
+ </bookmark>
+ <separator/>
+ <bookmark href="www.iee.et.tu-dresden.de/">
+ <title>The New English-German Dictionary</title>
+ </bookmark>
+ <bookmark href="http://dict.tu-chemnitz.de/">
+ <title>TU Chemnitz German-English Dictionary</title>
+ </bookmark>
+ <separator/>
+ <bookmark href="http://atilf.atilf.fr/tlf.htm">
+ <title>Trésor de la Langue Française informatisé</title>
+ </bookmark>
+ <bookmark href="http://dictionnaires.atilf.fr/dictionnaires/ACADEMIE/">
+ <title>Dictionnaire de l'Académie Française</title>
+ </bookmark>
+ <bookmark href="http://elsap1.unicaen.fr/cgi-bin/cherches.cgi">
+ <title>Dictionnaire des synonymes</title>
+ </bookmark>
+ </folder>
+</xbel>
diff --git a/examples/xml/dombookmarks/main.cpp b/examples/xml/dombookmarks/main.cpp
new file mode 100644
index 0000000000..71ce6aec0b
--- /dev/null
+++ b/examples/xml/dombookmarks/main.cpp
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ MainWindow mainWin;
+ mainWin.show();
+ mainWin.open();
+ return app.exec();
+}
diff --git a/examples/xml/dombookmarks/mainwindow.cpp b/examples/xml/dombookmarks/mainwindow.cpp
new file mode 100644
index 0000000000..b3bfe64e17
--- /dev/null
+++ b/examples/xml/dombookmarks/mainwindow.cpp
@@ -0,0 +1,145 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "mainwindow.h"
+#include "xbeltree.h"
+
+MainWindow::MainWindow()
+{
+ xbelTree = new XbelTree;
+ setCentralWidget(xbelTree);
+
+ createActions();
+ createMenus();
+
+ statusBar()->showMessage(tr("Ready"));
+
+ setWindowTitle(tr("DOM Bookmarks"));
+ resize(480, 320);
+}
+
+void MainWindow::open()
+{
+ QString fileName =
+ QFileDialog::getOpenFileName(this, tr("Open Bookmark File"),
+ QDir::currentPath(),
+ tr("XBEL Files (*.xbel *.xml)"));
+ if (fileName.isEmpty())
+ return;
+
+ QFile file(fileName);
+ if (!file.open(QFile::ReadOnly | QFile::Text)) {
+ QMessageBox::warning(this, tr("SAX Bookmarks"),
+ tr("Cannot read file %1:\n%2.")
+ .arg(fileName)
+ .arg(file.errorString()));
+ return;
+ }
+
+ if (xbelTree->read(&file))
+ statusBar()->showMessage(tr("File loaded"), 2000);
+}
+
+void MainWindow::saveAs()
+{
+ QString fileName =
+ QFileDialog::getSaveFileName(this, tr("Save Bookmark File"),
+ QDir::currentPath(),
+ tr("XBEL Files (*.xbel *.xml)"));
+ if (fileName.isEmpty())
+ return;
+
+ QFile file(fileName);
+ if (!file.open(QFile::WriteOnly | QFile::Text)) {
+ QMessageBox::warning(this, tr("SAX Bookmarks"),
+ tr("Cannot write file %1:\n%2.")
+ .arg(fileName)
+ .arg(file.errorString()));
+ return;
+ }
+
+ if (xbelTree->write(&file))
+ statusBar()->showMessage(tr("File saved"), 2000);
+}
+
+void MainWindow::about()
+{
+ QMessageBox::about(this, tr("About DOM Bookmarks"),
+ tr("The <b>DOM Bookmarks</b> example demonstrates how to "
+ "use Qt's DOM classes to read and write XML "
+ "documents."));
+}
+
+void MainWindow::createActions()
+{
+ openAct = new QAction(tr("&Open..."), this);
+ openAct->setShortcuts(QKeySequence::Open);
+ connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
+
+ saveAsAct = new QAction(tr("&Save As..."), this);
+ saveAsAct->setShortcuts(QKeySequence::SaveAs);
+ connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));
+
+ exitAct = new QAction(tr("E&xit"), this);
+ exitAct->setShortcuts(QKeySequence::Quit);
+ connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
+
+ aboutAct = new QAction(tr("&About"), this);
+ connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
+
+ aboutQtAct = new QAction(tr("About &Qt"), this);
+ connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
+}
+
+void MainWindow::createMenus()
+{
+ fileMenu = menuBar()->addMenu(tr("&File"));
+ fileMenu->addAction(openAct);
+ fileMenu->addAction(saveAsAct);
+ fileMenu->addAction(exitAct);
+
+ menuBar()->addSeparator();
+
+ helpMenu = menuBar()->addMenu(tr("&Help"));
+ helpMenu->addAction(aboutAct);
+ helpMenu->addAction(aboutQtAct);
+}
diff --git a/examples/xml/dombookmarks/mainwindow.h b/examples/xml/dombookmarks/mainwindow.h
new file mode 100644
index 0000000000..058f5cc221
--- /dev/null
+++ b/examples/xml/dombookmarks/mainwindow.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+
+class XbelTree;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void open();
+ void saveAs();
+ void about();
+
+private:
+ void createActions();
+ void createMenus();
+
+ XbelTree *xbelTree;
+
+ QMenu *fileMenu;
+ QMenu *helpMenu;
+ QAction *openAct;
+ QAction *saveAsAct;
+ QAction *exitAct;
+ QAction *aboutAct;
+ QAction *aboutQtAct;
+};
+
+#endif
diff --git a/examples/xml/dombookmarks/xbeltree.cpp b/examples/xml/dombookmarks/xbeltree.cpp
new file mode 100644
index 0000000000..2a072b2d54
--- /dev/null
+++ b/examples/xml/dombookmarks/xbeltree.cpp
@@ -0,0 +1,186 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "xbeltree.h"
+
+XbelTree::XbelTree(QWidget *parent)
+ : QTreeWidget(parent)
+{
+ QStringList labels;
+ labels << tr("Title") << tr("Location");
+
+ header()->setResizeMode(QHeaderView::Stretch);
+ setHeaderLabels(labels);
+
+ folderIcon.addPixmap(style()->standardPixmap(QStyle::SP_DirClosedIcon),
+ QIcon::Normal, QIcon::Off);
+ folderIcon.addPixmap(style()->standardPixmap(QStyle::SP_DirOpenIcon),
+ QIcon::Normal, QIcon::On);
+ bookmarkIcon.addPixmap(style()->standardPixmap(QStyle::SP_FileIcon));
+}
+
+bool XbelTree::read(QIODevice *device)
+{
+ QString errorStr;
+ int errorLine;
+ int errorColumn;
+
+ if (!domDocument.setContent(device, true, &errorStr, &errorLine,
+ &errorColumn)) {
+ QMessageBox::information(window(), tr("DOM Bookmarks"),
+ tr("Parse error at line %1, column %2:\n%3")
+ .arg(errorLine)
+ .arg(errorColumn)
+ .arg(errorStr));
+ return false;
+ }
+
+ QDomElement root = domDocument.documentElement();
+ if (root.tagName() != "xbel") {
+ QMessageBox::information(window(), tr("DOM Bookmarks"),
+ tr("The file is not an XBEL file."));
+ return false;
+ } else if (root.hasAttribute("version")
+ && root.attribute("version") != "1.0") {
+ QMessageBox::information(window(), tr("DOM Bookmarks"),
+ tr("The file is not an XBEL version 1.0 "
+ "file."));
+ return false;
+ }
+
+ clear();
+
+ disconnect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)),
+ this, SLOT(updateDomElement(QTreeWidgetItem*,int)));
+
+ QDomElement child = root.firstChildElement("folder");
+ while (!child.isNull()) {
+ parseFolderElement(child);
+ child = child.nextSiblingElement("folder");
+ }
+
+ connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)),
+ this, SLOT(updateDomElement(QTreeWidgetItem*,int)));
+
+ return true;
+}
+
+bool XbelTree::write(QIODevice *device)
+{
+ const int IndentSize = 4;
+
+ QTextStream out(device);
+ domDocument.save(out, IndentSize);
+ return true;
+}
+
+void XbelTree::updateDomElement(QTreeWidgetItem *item, int column)
+{
+ QDomElement element = domElementForItem.value(item);
+ if (!element.isNull()) {
+ if (column == 0) {
+ QDomElement oldTitleElement = element.firstChildElement("title");
+ QDomElement newTitleElement = domDocument.createElement("title");
+
+ QDomText newTitleText = domDocument.createTextNode(item->text(0));
+ newTitleElement.appendChild(newTitleText);
+
+ element.replaceChild(newTitleElement, oldTitleElement);
+ } else {
+ if (element.tagName() == "bookmark")
+ element.setAttribute("href", item->text(1));
+ }
+ }
+}
+
+void XbelTree::parseFolderElement(const QDomElement &element,
+ QTreeWidgetItem *parentItem)
+{
+ QTreeWidgetItem *item = createItem(element, parentItem);
+
+ QString title = element.firstChildElement("title").text();
+ if (title.isEmpty())
+ title = QObject::tr("Folder");
+
+ item->setFlags(item->flags() | Qt::ItemIsEditable);
+ item->setIcon(0, folderIcon);
+ item->setText(0, title);
+
+ bool folded = (element.attribute("folded") != "no");
+ setItemExpanded(item, !folded);
+
+ QDomElement child = element.firstChildElement();
+ while (!child.isNull()) {
+ if (child.tagName() == "folder") {
+ parseFolderElement(child, item);
+ } else if (child.tagName() == "bookmark") {
+ QTreeWidgetItem *childItem = createItem(child, item);
+
+ QString title = child.firstChildElement("title").text();
+ if (title.isEmpty())
+ title = QObject::tr("Folder");
+
+ childItem->setFlags(item->flags() | Qt::ItemIsEditable);
+ childItem->setIcon(0, bookmarkIcon);
+ childItem->setText(0, title);
+ childItem->setText(1, child.attribute("href"));
+ } else if (child.tagName() == "separator") {
+ QTreeWidgetItem *childItem = createItem(child, item);
+ childItem->setFlags(item->flags() & ~(Qt::ItemIsSelectable | Qt::ItemIsEditable));
+ childItem->setText(0, QString(30, 0xB7));
+ }
+ child = child.nextSiblingElement();
+ }
+}
+
+QTreeWidgetItem *XbelTree::createItem(const QDomElement &element,
+ QTreeWidgetItem *parentItem)
+{
+ QTreeWidgetItem *item;
+ if (parentItem) {
+ item = new QTreeWidgetItem(parentItem);
+ } else {
+ item = new QTreeWidgetItem(this);
+ }
+ domElementForItem.insert(item, element);
+ return item;
+}
diff --git a/examples/xml/dombookmarks/xbeltree.h b/examples/xml/dombookmarks/xbeltree.h
new file mode 100644
index 0000000000..ad30de520c
--- /dev/null
+++ b/examples/xml/dombookmarks/xbeltree.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef XBELTREE_H
+#define XBELTREE_H
+
+#include <QDomDocument>
+#include <QHash>
+#include <QIcon>
+#include <QTreeWidget>
+
+class XbelTree : public QTreeWidget
+{
+ Q_OBJECT
+
+public:
+ XbelTree(QWidget *parent = 0);
+
+ bool read(QIODevice *device);
+ bool write(QIODevice *device);
+
+private slots:
+ void updateDomElement(QTreeWidgetItem *item, int column);
+
+private:
+ void parseFolderElement(const QDomElement &element,
+ QTreeWidgetItem *parentItem = 0);
+ QTreeWidgetItem *createItem(const QDomElement &element,
+ QTreeWidgetItem *parentItem = 0);
+
+ QDomDocument domDocument;
+ QHash<QTreeWidgetItem *, QDomElement> domElementForItem;
+ QIcon folderIcon;
+ QIcon bookmarkIcon;
+};
+
+#endif
diff --git a/examples/xml/htmlinfo/apache_org.html b/examples/xml/htmlinfo/apache_org.html
new file mode 100644
index 0000000000..9e5e4d3a68
--- /dev/null
+++ b/examples/xml/htmlinfo/apache_org.html
@@ -0,0 +1,281 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <!--
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ This file is generated from XML source: DO NOT EDIT!
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ -->
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <link rel="stylesheet" href="./style/compressed.css" type="text/css" media="screen, projection"/>
+ <link rel="stylesheet" href="./style/style.css" type="text/css" media="screen, projection"/>
+ <!--[if IE]><link rel="stylesheet" href="./style/ie.css" type="text/css" media="screen, projection"/><![endif]-->
+<link rel="alternate" title="announce@apache.org Archives" type="application/atom+xml" href="http://mail-archives.apache.org/mod_mbox/www-announce/?format=atom" />
+ <meta name="author" content="The Apache Software Foundation" /><meta name="email" content="apache.AT.apache.DOT.org" />
+ <title>Welcome! - The Apache Software Foundation</title>
+ </head>
+ <body>
+ <div class="navigation">
+ <ul>
+ <li><a href="./foundation" title="About the Foundation">Foundation</a></li>
+ <li><a href="http://projects.apache.org" title="Apache Projects">Projects</a></li>
+ <li><a href="http://people.apache.org" title="Apache People">People</a></li>
+ <li><a href="./foundation/getinvolved.html" title="Get involved in Apache">Get Involved</a></li>
+ <li><a href="./foundation/sponsorship.html" title="Support the mission of Apache">Support Apache</a></li>
+ <li class="dlink"><a href="./dyn/closer.cgi" title="Download Apache projects">Download</a></li>
+ </ul>
+ </div>
+ <div class="container">
+ <hr class="space col"/>
+ <div class="block">
+ <div class="column span-24">
+ <div id="header">
+ <h1>The Apache Software Foundation<br />
+ <span class="alt"><small>Meritocracy in Action.</small></span></h1><p class="blurb">The Apache Software Foundation provides support for the Apache community of open-source software projects. The <a href="http://projects.apache.org/">Apache projects</a> are characterized by a collaborative, consensus based development process, an open and pragmatic software license, and a desire to create high quality software that leads the way in its field.</p><p class="highlight">We consider ourselves not simply a group of projects sharing a server, but rather a <em>community of developers and users</em>.</p>
+ </div>
+ </div>
+ </div>
+ <hr/>
+ <div class="block">
+ <div class="column span-15 first append-1">
+ <h3>
+ Latest News
+ </h3>
+ </div>
+ <div class="column span-8 las search">
+ <form action="http://www.google.com/search" method="get">
+ <input value="*.apache.org" name="sitesearch" type="hidden"/>
+ <input size="10" name="q" id="query" type="text"/>
+ <input name="Search" value="Go" type="submit"/>
+ </form>
+ </div>
+ </div>
+ <div class="block content">
+ <div class="column span-15 colborder">
+
+<div class="section-content">
+<p><em>If you would like to keep up with news and announcements from the
+foundation and all its projects, you can subscribe to the
+<a href="foundation/mailinglists.html#foundation-announce">Apache
+Announcements List</a></em>.</p>
+
+<h4 id="apachecon-eu">
+ Free Video Streams from ApacheCon Europe 2008
+</h4>
+<div class="section-content">
+<a href="http://www.eu.apachecon.com/"><img src="images/eu_2008_logo.jpg" alt="ApacheCon Europe 2008" title="ApacheCon Europe 2008" border="0" align="right" /></a>
+<p>
+ApacheCon Europe 2008 held in Amsterdam was a great success, and attracted higher
+than ever attendance figures, with about 500 registered attendees. This
+figure represents an increase of more than 40% over the previous year,
+demonstrating the rapidly growing interest in Apache and Open Source software
+amongst European businesses.
+
+If you have not been able to attend ApacheCon Europe, you can still watch
+<a href="http://streaming.linux-magazin.de/en/archive_apachecon08eu.htm">videos of all keynotes and select talks online</a>. Keynote sessions
+and the opening plenary are available <b>free of charge</b>:</p>
+<ul>
+<li><a href="http://streaming.linux-magazin.de/events/apacheconfree/archive/jjagielski/frames-java.htm" onclick="window.open(this.href, '_blank', 'width=1024, height=768'); return false;">State of the Feather</a>
+ by Jim Jagielski, Chairman of the Apache Software Foundation</li>
+<li><a href="http://streaming.linux-magazin.de/events/apacheconfree/archive/cschmidt/frames-java.htm" onclick="window.open(this.href, '_blank', 'width=1024, height=768'); return false;">Using Audio Technology and Open Content to Reduce Global Illiteracy, Poverty and Disease</a>
+ by Cliff Schmidt, Executive Director of Literacy Bridge</li>
+<li><a href="http://streaming.linux-magazin.de/events/apacheconfree/archive/rghosh/frames-java.htm" onclick="window.open(this.href, '_blank', 'width=1024, height=768'); return false;">Apache and Steam Engines: the Magic of Collaborative Innovation</a>
+ by Rishab Aiyer Ghosh, Open Source Initiative Board Member</li>
+<li><a href="http://streaming.linux-magazin.de/events/apacheconfree/archive/rfielding/frames-java.htm" onclick="window.open(this.href, '_blank', 'width=1024, height=768'); return false;">Apache 3.0 (a Tall Tale)</a>
+ by Roy Fielding, Co-founder of The Apache Software Foundation,
+ and Vice President, Apache HTTP Server</li>
+</ul>
+<p>The talks of the following select ApacheCon Europe tracks are
+available for just 49 Euro:
+<a href="http://streaming.linux-magazin.de/en/archive_apachecon08eu.htm#wednesday">System Administration</a>,
+<a href="http://streaming.linux-magazin.de/en/archive_apachecon08eu.htm#thursday">Web Security</a>,
+<a href="http://streaming.linux-magazin.de/en/archive_apachecon08eu.htm#friday">Web Services and Web 2.0</a>.
+</p>
+<hr />
+</div>
+
+<h4 id="apachecon-us">
+ ApacheCon US 2008 in New Orleans!
+</h4>
+<div class="section-content">
+<p>
+ ApacheCon US 2008 will be held 3 November through 7 November in
+ New Orleans, Louisiana.
+ The Call for Papers has already closed and the program and further
+ information will be made available soon on the ApacheCon US 2008
+ Web site <a href="http://www.us.apachecon.com/us2008/"><strong>www.us.apachecon.com</strong></a>.
+ If you would like to receive information about ApacheCon US 2008, please
+ <a href="mailto:announce-subscribe@apachecon.com">subscribe to
+ the ApacheCon announcement mailing list</a>.
+ </p>
+<hr />
+</div>
+
+<h4 id="sun_jck_letter">
+ Notice regarding open letter to Sun Microsystems
+</h4>
+<div class="section-content">
+<p>
+ The Apache Software Foundation has written an <a href="jcp/sunopenletter.html">open letter</a>
+ to Sun Microsystems regarding our inabillity to acquire an acceptable license for the test kit
+ for Java SE needed by <a href="http://harmony.apache.org">Apache Harmony</a>. For futher information
+ please see the <a href="jcp/sunopenletterfaq.html">FAQ</a> and direct all questions to Apache's VP
+ for JCP issues, geirm at apache dot org, or our regular press inquiry address, press at apache dot org.
+ </p>
+</div>
+</div>
+ </div>
+ <div class="column span-8 last">
+ <div class="block">
+ <div class="nav column span-11">
+ <div>
+ <div class="menuheader"><a
+href="http://projects.apache.org/">Apache Projects</a></div>
+ <ul>
+ <li><a href="http://httpd.apache.org/" title="Apache Web Server (httpd)">HTTP Server</a></li>
+ <li><a href="http://activemq.apache.org/" title="Distributed Messaging System">ActiveMQ</a></li>
+ <li><a href="http://ant.apache.org/" title="Java-based build tool">Ant</a></li>
+ <li><a href="http://apr.apache.org/" title="Apache Portable Runtime libraries">APR</a></li>
+ <li><a href="http://archiva.apache.org/" title="Build Artifact Repository Manager">Archiva</a></li>
+ <li><a href="http://beehive.apache.org/" title="Metadata frameworks for enterprise applications">Beehive</a></li>
+ <li><a href="http://cayenne.apache.org/" title="User-friendly Java ORM with Tools">Cayenne</a></li>
+ <li><a href="http://cocoon.apache.org/" title="Web development framework: separation of concerns, component-based">Cocoon</a></li>
+ <li><a href="http://commons.apache.org/" title="Reusable Java components">Commons</a></li>
+ <li><a href="http://continuum.apache.org/" title="Continuous Integration and Build Server">Continuum</a></li>
+ <li><a href="http://cxf.apache.org/" title="Service Framework">CXF</a></li>
+ <li><a href="http://db.apache.org/" title="Database access">DB</a></li>
+ <li><a href="http://directory.apache.org/" title="Apache Directory Server">Directory</a></li>
+ <li><a href="http://excalibur.apache.org/" title="Embeddable software libraries related to component and service management access">Excalibur</a></li>
+ <li><a href="http://felix.apache.org/" title="OSGi Framework and components.">Felix</a></li>
+ <li><a href="http://forrest.apache.org/" title="Aggregated multi-channel documentation, separation of concerns">Forrest</a></li>
+ <li><a href="http://geronimo.apache.org/" title="Java2, Enterprise Edition (J2EE) container">Geronimo</a></li>
+ <li><a href="http://gump.apache.org/" title="Continuous integration of open source projects">Gump</a></li>
+ <li><a href="http://hadoop.apache.org/" title="Distributed computing platform">Hadoop</a></li>
+ <li><a href="http://harmony.apache.org/" title="Open source implementation of Java SE">Harmony</a></li>
+ <li><a href="http://hivemind.apache.org/" title="A services and configuration microkernel">HiveMind</a></li>
+ <li><a href="http://hc.apache.org/" title="Java toolset of low level HTTP components">HttpComponents</a></li>
+ <li><a href="http://ibatis.apache.org/" title="SQL Data Mapper for Java and .NET">iBATIS</a></li>
+ <li><a href="http://incubator.apache.org/" title="Shepherd for new projects">Incubator</a></li>
+ <li><a href="http://jackrabbit.apache.org/" title="Content Repository for Java">Jackrabbit</a></li>
+ <li><a href="http://jakarta.apache.org/" title="Server-side Java">Jakarta</a></li>
+ <li><a href="http://james.apache.org/" title="Java Apache Mail Enterprise Server">James</a></li>
+ <li><a href="http://labs.apache.org/" title="The Innovation Laboratories of the Apache Software Foundation">Labs</a></li>
+ <li><a href="http://lenya.apache.org/" title="Content Management System">Lenya</a></li>
+ <li><a href="http://logging.apache.org/" title="Cross-language logging services">Logging</a></li>
+ <li><a href="http://lucene.apache.org/" title="Search engine library">Lucene</a></li>
+ <li><a href="http://maven.apache.org/" title="Java project management and comprehension tools">Maven</a></li>
+ <li><a href="http://mina.apache.org/" title="Multipurpose Infrastructure for Network Application">Mina</a></li>
+ <li><a href="http://myfaces.apache.org/" title="JavaServer(tm) Faces implementation and components">MyFaces</a></li>
+ <li><a href="http://ode.apache.org/" title="Orchestration Director Engine: Business Process Management (BPM), Process Orchestration and Workflow through service compositioni.">ODE</a></li>
+ <li><a href="http://ofbiz.apache.org/" title="Open for Business: enterprise automation software">OFBiz</a></li>
+ <li><a href="http://openejb.apache.org/" title="OpenEJB: a modular, configurable, and extendable EJB Container System and Server">OpenEJB</a></li>
+ <li><a href="http://openjpa.apache.org/" title="OpenJPA: Object Relational Mapping for Java">OpenJPA</a></li>
+ <li><a href="http://perl.apache.org/" title="Dynamic websites using Perl">Perl</a></li>
+ <li><a href="http://poi.apache.org/" title="Java API for OLE 2 Compound Documents">POI</a></li>
+ <li><a href="http://portals.apache.org/" title="Portal technology">Portals</a></li>
+ <li><a href="http://roller.apache.org/" title="Java blog server">Roller</a></li>
+ <li><a href="http://santuario.apache.org/" title="XML Security in Java and C++">Santuario</a></li>
+ <li><a href="http://servicemix.apache.org/" title="Enterprise Service Bus">ServiceMix</a></li>
+ <li><a href="http://shale.apache.org/" title="Web application framework based on JavaServer(tm) Faces">Shale</a></li>
+ <li><a href="http://spamassassin.apache.org/" title="Mail filter to identify spam">SpamAssassin</a></li>
+ <li><a href="http://stdcxx.apache.org/" title="Apache C++ Standard Library">STDCXX</a></li>
+ <li><a href="http://struts.apache.org/" title="Model 2 framework for building Java web applications">Struts</a></li>
+ <li><a href="http://synapse.apache.org/" title="Enterprise Service Bus and Mediation Framework">Synapse</a></li>
+ <li><a href="http://tapestry.apache.org/" title="Component-based Java Web Application Framework">Tapestry</a></li>
+ <li><a href="http://tcl.apache.org/" title="Dynamic websites using TCL">TCL</a></li>
+ <li><a href="http://tiles.apache.org/" title="A templating framework for web application user interfaces">Tiles</a></li>
+ <li><a href="http://tomcat.apache.org/" title="A Java Servlet and JSP Container">Tomcat</a></li>
+ <li><a href="http://turbine.apache.org/" title="A Java Servlet Web Application Framework and associated component library">
+ Turbine</a></li>
+ <li><a href="http://velocity.apache.org/" title="A Java Templating Engine">Velocity</a></li>
+ <li><a href="http://wicket.apache.org/" title="Component-based Java Web Application Framework.">Wicket</a></li>
+ <li><a href="http://ws.apache.org/">Web Services</a></li>
+ <li><a href="http://xalan.apache.org/" title="XSLT processors in Java and C++">Xalan</a></li>
+ <li><a href="http://xerces.apache.org/" title="XML parsers in Java, C++ and Perl">Xerces</a></li>
+ <li><a href="http://xml.apache.org/" title="XML solutions focused on the web">XML</a></li>
+ <li><a href="http://xmlbeans.apache.org/" title="XML-Java binding tool">XMLBeans</a></li>
+ <li><a href="http://xmlgraphics.apache.org/" title="Conversion from XML to graphical output">XML Graphics</a></li>
+ </ul>
+ </div>
+ </div>
+ <div class="nav column prepend-1 span-12 last">
+ <h6><a
+href="/foundation/">Foundation</a></h6>
+ <ul>
+ <li><a href="/foundation/faq.html">FAQ</a></li>
+ <li><a href="/licenses/">Licenses</a></li>
+ <li><a href="/foundation/news.html">News</a></li>
+ <li><a href="/foundation/records/">Public Records</a></li>
+ <li><a href="/foundation/sponsorship.html">Sponsorship</a></li>
+ <li><a href="/foundation/contributing.html">Donations</a></li>
+ <li><a href="/foundation/thanks.html">Thanks</a></li>
+ <li><a href="/foundation/contact.html">Contact</a></li>
+ </ul>
+ <h6>Foundation Projects</h6>
+ <ul>
+ <li><a href="/foundation/conferences.html" title="Meetings of developers and users">Conferences</a></li>
+ <li><a href="/dev/" title="ASF Infrastructure: Operations and howto documents for PMCs and contributors">Infrastructure</a></li>
+ <li><a href="/jcp/" title="Apache and the Java Community Process">JCP</a></li>
+ </ul>
+ <h6>How it works</h6>
+ <ul>
+ <li><a href="/foundation/how-it-works.html">Introduction</a></li>
+ <li><a href="/foundation/how-it-works.html#meritocracy">Meritocracy</a></li>
+ <li><a href="/foundation/how-it-works.html#structure">Structure</a></li>
+ <li><a href="/foundation/how-it-works.html#roles">Roles</a></li>
+ <li><a href="/foundation/how-it-works.html#management">Collaboration</a></li>
+ <li><a href="/foundation/how-it-works.html#infrastructure">Infrastructure</a></li>
+ <li><a href="/foundation/how-it-works.html#incubator">Incubator</a></li>
+ <li><a href="/foundation/how-it-works.html#other">Other entities</a></li>
+ <li><a href="/foundation/glossary.html">Glossary</a></li>
+ <li><a href="/foundation/voting.html">Voting</a></li>
+ </ul>
+ <h6><a
+href="/foundation/getinvolved.html">Get Involved</a></h6>
+ <ul>
+ <li><a href="/foundation/mailinglists.html">Mailing Lists</a></li>
+ <li><a href="/dev/version-control.html">Version Control</a></li>
+ <li><a href="/dev/">Developer Info</a></li>
+ </ul>
+ <h6>Download</h6>
+ <ul>
+ <li><a href="/dyn/closer.cgi">from a mirror</a></li>
+ </ul>
+ <h6>Related Sites</h6>
+ <ul>
+ <li><a href="http://apachecon.com/" title="Official Apache Conference">ApacheCon</a></li>
+ <li><a href="http://apachebookstore.com/" title="Apache Books">Bookstore</a></li>
+ <li><a href="http://feathercast.org/" title="Apache Podcasts">Feathercast</a></li>
+ <li><a href="http://planetapache.org/" title="Apache Community Blogs">PlanetApache</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <div class="column span-24 footer">
+ <hr/>
+ <p>Copyright &#169; 2008 The Apache Software Foundation, Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
+ </div>
+ </div>
+ </div>
+</body>
+</html>
+
diff --git a/examples/xml/htmlinfo/htmlinfo.pro b/examples/xml/htmlinfo/htmlinfo.pro
new file mode 100644
index 0000000000..ca64b346a7
--- /dev/null
+++ b/examples/xml/htmlinfo/htmlinfo.pro
@@ -0,0 +1,19 @@
+SOURCES += main.cpp
+QT -= gui
+
+wince*|symbian:{
+ htmlfiles.files = *.html
+ htmlfiles.path = .
+ DEPLOYMENT += htmlfiles
+}
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml/htmlinfo
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.html htmlinfo.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml/htmlinfo
+INSTALLS += target sources
+
+symbian {
+ TARGET.UID3 = 0xA000C609
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/xml/htmlinfo/main.cpp b/examples/xml/htmlinfo/main.cpp
new file mode 100644
index 0000000000..cb7ac528f0
--- /dev/null
+++ b/examples/xml/htmlinfo/main.cpp
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore>
+
+void parseHtmlFile(QTextStream &out, const QString &fileName) {
+ QFile file(fileName);
+
+ out << "Analysis of HTML file: " << fileName << endl;
+
+ if (!file.open(QIODevice::ReadOnly)) {
+ out << " Couldn't open the file." << endl << endl << endl;
+ return;
+ }
+
+//! [0]
+ QXmlStreamReader reader(&file);
+//! [0]
+
+//! [1]
+ int paragraphCount = 0;
+ QStringList links;
+ QString title;
+ while (!reader.atEnd()) {
+ reader.readNext();
+ if (reader.isStartElement()) {
+ if (reader.name() == "title")
+ title = reader.readElementText();
+ else if(reader.name() == "a")
+ links.append(reader.attributes().value("href").toString());
+ else if(reader.name() == "p")
+ ++paragraphCount;
+ }
+ }
+//! [1]
+
+//! [2]
+ if (reader.hasError()) {
+ out << " The HTML file isn't well-formed: " << reader.errorString()
+ << endl << endl << endl;
+ return;
+ }
+//! [2]
+
+ out << " Title: \"" << title << "\"" << endl
+ << " Number of paragraphs: " << paragraphCount << endl
+ << " Number of links: " << links.size() << endl
+ << " Showing first few links:" << endl;
+
+ while(links.size() > 5)
+ links.removeLast();
+
+ foreach(QString link, links)
+ out << " " << link << endl;
+ out << endl << endl;
+}
+
+int main(int argc, char **argv)
+{
+ // initialize QtCore application
+ QCoreApplication app(argc, argv);
+
+ // get a list of all html files in the current directory
+ QStringList filter;
+ filter << "*.htm";
+ filter << "*.html";
+ QStringList htmlFiles = QDir::current().entryList(filter, QDir::Files);
+
+ QTextStream out(stdout);
+
+ if (htmlFiles.isEmpty()) {
+ out << "No html files available.";
+ return 1;
+ }
+
+ // parse each html file and write the result to file/stream
+ foreach(QString file, htmlFiles)
+ parseHtmlFile(out, file);
+
+ return 0;
+}
diff --git a/examples/xml/htmlinfo/nokia_com.html b/examples/xml/htmlinfo/nokia_com.html
new file mode 100644
index 0000000000..46d4c95ee6
--- /dev/null
+++ b/examples/xml/htmlinfo/nokia_com.html
@@ -0,0 +1,215 @@
+
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+<head>
+
+
+ <!--startindex-->
+ <title>Nokia - Nokia on the Web</title>
+
+
+ <meta name="description" content="Nokia is the world's leading mobile phone supplier and a leading supplier of mobile and fixed telecom networks including related customer services."/>
+ <meta name="keywords" content="Nokia,mobile phones,cellular,telecommunications,wireless networks,datacom,GSM,multimedia terminals,handsets,customer services,press releases,financial information,student exchange,open positions,employment opportunities,career opportunities"/>
+ <meta name="modified" content=""/>
+ <meta name="category" content="Landing Page Global Flash"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="siteid" content="101"/>
+
+ <!--stopindex-->
+ <link href="/css/style_46.css" rel="stylesheet" type="text/css">
+
+ <link href="/NOKIA_COM_1/Home/Landing_page_2007/wayfinder.css" rel="stylesheet" type="text/css"/>
+
+<script type="text/javascript">
+ var useHbx = true;
+</script>
+
+
+<!--WEBSIDESTORY CODE HBX1.0 (Universal)-->
+<!--COPYRIGHT 1997-2005 WEBSIDESTORY,INC. ALL RIGHTS RESERVED. U.S.PATENT No. 6,393,479B1. MORE INFO:http://websidestory.com/privacy-->
+<script language="javascript">
+var _hbEC=0,_hbE=new Array;function _hbEvent(a,b){b=_hbE[_hbEC++]=new Object();b._N=a;b._C=0;return b;}
+var hbx=_hbEvent("pv");hbx.vpc="HBX0100u";hbx.gn="ehg-nokiafin.hitbox.com";
+
+//BEGIN EDITABLE SECTION
+//CONFIGURATION VARIABLES
+hbx.acct="DM550514HPNZ";//ACCOUNT NUMBER(S)
+hbx.pn="Home";//PAGE NAME(S)
+hbx.mlc="/Home";//MULTI-LEVEL CONTENT CATEGORY
+hbx.pndef="title";//DEFAULT PAGE NAME
+hbx.ctdef="full";//DEFAULT CONTENT CATEGORY
+
+//OPTIONAL PAGE VARIABLES
+//ACTION SETTINGS
+hbx.fv="";//FORM VALIDATION MINIMUM ELEMENTS OR SUBMIT FUNCTION NAME
+hbx.lt="none";//LINK TRACKING
+hbx.dlf="n";//DOWNLOAD FILTER
+hbx.dft="n";//DOWNLOAD FILE NAMING
+hbx.elf="n";//EXIT LINK FILTER
+
+//SEGMENTS AND FUNNELS
+hbx.seg="";//VISITOR SEGMENTATION
+hbx.fnl="";//FUNNELS
+
+//CAMPAIGNS
+hbx.cmp="";//CAMPAIGN ID
+hbx.cmpn="";//CAMPAIGN ID IN QUERY
+hbx.dcmp="";//DYNAMIC CAMPAIGN ID
+hbx.dcmpn="";//DYNAMIC CAMPAIGN ID IN QUERY
+hbx.dcmpe="";//DYNAMIC CAMPAIGN EXPIRATION
+hbx.dcmpre="";//DYNAMIC CAMPAIGN RESPONSE EXPIRATION
+hbx.hra="";//RESPONSE ATTRIBUTE
+hbx.hqsr="";//RESPONSE ATTRIBUTE IN REFERRAL QUERY
+hbx.hqsp="";//RESPONSE ATTRIBUTE IN QUERY
+hbx.hlt="";//LEAD TRACKING
+hbx.hla="";//LEAD ATTRIBUTE
+hbx.gp="";//CAMPAIGN GOAL
+hbx.gpn="";//CAMPAIGN GOAL IN QUERY
+hbx.hcn="";//CONVERSION ATTRIBUTE
+hbx.hcv="";//CONVERSION VALUE
+hbx.cp="null";//LEGACY CAMPAIGN
+hbx.cpd="";//CAMPAIGN DOMAIN
+
+//CUSTOM VARIABLES
+hbx.ci="";//CUSTOMER ID
+hbx.hc1="";//CUSTOM 1
+hbx.hc2="";//CUSTOM 2
+hbx.hc3="";//CUSTOM 3
+hbx.hc4="";//CUSTOM 4
+hbx.hrf="";//CUSTOM REFERRER
+hbx.pec="";//ERROR CODES
+
+
+var cookieName = 'MyNokia';
+var nameEQ = cookieName + "=";
+var ca = document.cookie.split(';');
+for(var i=0;i < ca.length;i++) {
+ var c = ca[i];
+ while (c.charAt(0)==' ') c = c.substring(1,c.length);
+ if (c.indexOf(nameEQ) == 0) {
+ hbx.ci = c.substring(nameEQ.length,c.length);
+ }
+}
+
+//INSERT CUSTOM EVENTS
+hbx.acct="DM550514HPNZ";
+hbx.mlc="/Home";
+hbx.pn="Home";
+hbx.lt="auto";
+
+
+//END EDITABLE SECTION
+
+//REQUIRED SECTION. CHANGE "YOURSERVER" TO VALID LOCATION ON YOUR WEB SERVER (HTTPS IF FROM SECURE SERVER)
+</script><script language="javascript1.1" defer src="/Hitbox/hbx_5.js"></script>
+<script language="javascript">if(navigator.appName!='Netscape'&&parseInt(navigator.appVersion)==4)document.write("<\!"+"--")</script><noscript>
+<img src="http://ehg-nokiafin.hitbox.com/HG?hc=we88&cd=1&hv=6&ce=u&hb=DM550514HPNZ&n=Home&vcon=/Home&seg=&cmp=&gp=&fnl=&pec=&dcmp=&ra=&gn=&cv=&ld=&la=&c1=&c2=&c3=&c4=&vpc=090101rn" border="0" width="1" height="1">
+</noscript><!--//-->
+
+<!--END WEBSIDESTORY CODE-->
+
+
+
+
+
+</head>
+<body lang='en'
+ style="margin: 0 0 0 0;" bgcolor="#FFFFFF" link="#0033cc" text="#000000" alink="#0033cc" vlink="#800080">
+ <div class="pagecontainer">
+
+
+<!-- start page template [Generated JSP Servlet: class=jsp_servlet._templates._page.__template6layout] -->
+
+
+
+
+
+
+
+
+
+
+ <!--startindex-->
+
+
+
+<!-- Begin template '/templates/content/plain.jsp' -->
+
+<div id="wayfinderContainer">
+ <div id="branding">
+ <img src="/NOKIA_COM_1/Home/Landing_page_2007/noflash_img/nokia_connecting_people.png" alt="Nokia - Connecting people" />
+
+ </div>
+
+ <div id="flashcontent">
+
+ <!-- main page noflash content -->
+ <div id="mainContentGlobal">
+ <div id="mainHdr"><h1>Welcome to Nokia</h1></div>
+ <div id="selectContainer">
+ <h2>Where would you like to go?</h2>
+ <div id="selectLinks">
+ <ul class="mainpage">
+ <li><a href="/A4176248">Africa</a></li>
+ <li><a href="/A4138125">Asia Pacific</a></li>
+ <li><a href="/A4138121">Europe</a></li>
+ <li><a href="/A4138127">Latin America</a></li>
+ <li><a href="/A4176245">Middle East</a></li>
+ <li><a href="/A4138126">North America</a></li>
+ </ul>
+ </div>
+ </div>
+ <!-- <a id="banner" href="http://www.nokia.com/seasonsgreetings/">Seasons Greetings</a> -->
+ </div>
+ <div id="navi">
+ <ul>
+ <li><a href="http://www.nokiaforbusiness.com/">Nokia for Business</a></li>
+ <li><a href="http://www.nokia.com/aboutnokia">About Nokia</a></li>
+ <li><a href="http://www.nokia.com/developers">Developers</a></li>
+ <li><a href="http://www.nokia.com/press">Press</a></li>
+ <li class="lastitem"><a href="http://www.nokia.com/investors">Investors</a></li>
+ <!-- <li class="lastitem"><a href="http://www.nokia.com/environment">Environment</a></li> -->
+ </ul>
+ </div>
+ <!-- noflash content ends -->
+
+ </div>
+
+ <div id="footer">
+ <ul>
+ <li><a href="http://www.nokia.com/siteterms">Site Terms</a></li>
+ <li class="lastitem"><a href="http://www.nokia.com/privacypolicy">Privacy Policy</a></li>
+ <span>Copyright &copy; 2008 Nokia. All rights reserved</span>
+ </ul>
+ <br /><br />
+ </div>
+</div>
+
+<script type="text/javascript" src="/NOKIA_COM_1/javascript/flash_detection_main.js"></script> <!-- for redirection to mobile site -->
+<script type="text/javascript" src="/EUROPE_NOKIA_COM_3/flash/swfobject.js"></script>
+<script type="text/javascript" src="/NOKIA_COM_1/javascript/cookies.js"></script>
+<script type="text/javascript" >
+ // <![CDATA[
+ var so = new SWFObject("/NOKIA_COM_1/Home/Landing_page_2007/wayfinder_assets.swf", "wayfinder", "736", "560", "7");
+ so.addParam("allowscriptaccess", "always");
+ so.addParam("base", "/NOKIA_COM_1/Home/Landing_page_2007/");
+ so.write("flashcontent");
+ // ]]>
+</script>
+
+<!-- End template '/templates/content/plain.jsp' -->
+ <!--stopindex-->
+
+
+
+
+
+ </div>
+</body>
+
+
+ </html>
+
diff --git a/examples/xml/htmlinfo/simpleexample.html b/examples/xml/htmlinfo/simpleexample.html
new file mode 100644
index 0000000000..83a55cf00a
--- /dev/null
+++ b/examples/xml/htmlinfo/simpleexample.html
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html>
+ <head>
+ <title>Qt is cute! Frans is too!</title>
+ </head>
+ <body>
+ <p>A paragraph.</p>
+ <p>A second paragraph. Check out our <a href="http://labs.qt.nokia.com/">developer blogs</a></p>
+ <p>And the last paragraph. Or our <a href="http://qt.nokia.com/doc/">online documentation</a>.</p>
+ </body>
+</html>
diff --git a/examples/xml/htmlinfo/trolltech_com.html b/examples/xml/htmlinfo/trolltech_com.html
new file mode 100644
index 0000000000..180eb74358
--- /dev/null
+++ b/examples/xml/htmlinfo/trolltech_com.html
@@ -0,0 +1,955 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
+ lang="en">
+
+ <head>
+ <meta http-equiv="Content-Type"
+ content="text/html;charset=utf-8" />
+
+ <title>
+ Code Less. Create More. Deploy Everywhere.
+ &mdash;
+ Trolltech
+ </title>
+
+
+ <!-- ADD ON UPDATE -->
+
+ <meta name="author" content="Trolltech" />
+ <meta name="description"
+ content="Trolltech creates application development platforms for desktop and mobile device innovation." />
+ <meta name="keywords" content="" />
+
+<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"><!-- &nbsp;--></script>
+<script type="text/javascript">
+ <!-- Urchin script
+ _uacct = "UA-4457116-1";
+ urchinTracker();
+ -->
+ </script>
+
+ <base href="http://trolltech.com/homepage" />
+
+
+
+ <meta name="generator" content="Plone - http://plone.org" />
+
+
+ <!-- Plone ECMAScripts -->
+
+
+
+
+ <script type="text/javascript"
+ src="http://trolltech.com/portal_javascripts/TTSkin/ploneScripts2804.js">
+ </script>
+
+
+
+ <script type="text/javascript"
+ src="http://trolltech.com/portal_javascripts/TTSkin/ploneScripts0445.js">
+ </script>
+
+
+
+ <script type="text/javascript"
+ src="http://trolltech.com/portal_javascripts/TTSkin/ploneScripts5940.js">
+ </script>
+
+
+
+ <script type="text/javascript"
+ src="http://trolltech.com/portal_javascripts/TTSkin/linkpopper.js">
+ </script>
+
+
+
+ <script type="text/javascript"
+ src="http://trolltech.com/portal_javascripts/TTSkin/ploneScripts7743.js">
+ </script>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <style type="text/css"><!-- @import url(http://trolltech.com/portal_css/TTSkin/ploneStyles1145.css); --></style>
+
+
+
+
+
+
+
+
+ <style type="text/css"
+ media="screen"><!-- @import url(http://trolltech.com/portal_css/TTSkin/ploneStyles8707.css); --></style>
+
+
+
+
+
+
+
+
+
+
+ <!-- Internet Explorer CSS Fixes -->
+ <!--[if IE]>
+ <style type="text/css" media="all">@import url(http://trolltech.com/IEFixes.css);</style>
+ <![endif]-->
+
+ <link rel="shortcut icon" type="image/x-icon"
+ href="http://trolltech.com/favicon.ico" />
+
+ <link rel="home" href="http://trolltech.com"
+ title="Front page" />
+ <link rel="search"
+ href="http://trolltech.com/search_form"
+ title="Search this site" />
+ <link rel="author"
+ href="http://trolltech.com/author/admin"
+ title="Author information" />
+ <link rel="contents" href="http://trolltech.com/sitemap"
+ title="Site Map" />
+
+
+
+
+
+
+
+
+
+ <!-- Disable IE6 image toolbar -->
+ <meta http-equiv="imagetoolbar" content="no" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </head>
+
+ <body class="section-homepage" dir="ltr">
+ <div id="visual-portal-wrapper">
+ <div id="portal-top">
+
+ <div id="portal-header">
+ <a class="hiddenStructure" accesskey="2"
+ href="http://trolltech.com/#documentContent">Skip to content.</a>
+
+ <a class="hiddenStructure" accesskey="6"
+ href="http://trolltech.com/#portlet-navigation-tree">Skip to navigation</a>
+
+ <div class="middlesex">
+ <ul id="portal-siteactions">
+
+ <li id="siteaction-sitemap"><a
+ href="http://trolltech.com/sitemap" accesskey="3"
+ title="Site Map">Site Map</a></li>
+ <li id="siteaction-accessibility"><a
+ href="http://trolltech.com/accessibility-info"
+ accesskey="0" title="Accessibility">Accessibility</a></li>
+ <li id="siteaction-contact"><a
+ href="http://trolltech.com/contact" accesskey="9"
+ title="Contact">Contact</a></li>
+
+</ul>
+
+ <div id="portal-searchbox">
+ <form name="searchform"
+ action="http://trolltech.com/search"
+ style="white-space:nowrap"
+ onsubmit="return liveSearchSubmit()">
+
+ <label for="searchGadget" class="hiddenStructure">Search Site</label>
+
+ <div class="LSBox">
+ <input id="searchGadget" name="SearchableText"
+ type="text" size="15" title="Search Site"
+ accesskey="4" class="visibility:visible" />
+
+ <input class="searchButton" type="submit"
+ value="Search" />
+
+ <div class="LSResult" id="LSResult" style=""><div class="LSShadow" id="LSShadow"></div></div>
+ </div>
+ </form>
+
+ <div id="portal-advanced-search" class="hiddenStructure">
+ <a href="http://trolltech.com/search_form"
+ accesskey="5">
+ Advanced Search&hellip;
+ </a>
+ </div>
+
+</div>
+
+ <div id="country-flags">
+ <a href="/lang/cn/"><img class="flag"
+ border="0" width="30" height="20" src="chineseflag.png" /></a>
+ <a href="/lang/japanese/"><img
+ class="flag" border="0" width="30" height="20"
+ src="japaneseflag.png" /></a>
+ </div>
+ <h1 id="portal-logo">
+ <a href="http://trolltech.com" accesskey="1">Trolltech</a>
+</h1>
+
+ <div id="portal-skinswitcher">
+
+</div>
+ </div>
+
+
+ <h5 class="hiddenStructure">Sections</h5>
+ <div id="portal-globalnav">
+ <div class="middlesex">
+ <ul>
+ <li id="portaltab-index_html"
+ class="selected indextab"><a
+ href="http://trolltech.com">Home</a></li>
+
+ <li id="portaltab-products"
+ class="plain"><a
+ href="http://trolltech.com/products" title="">Products and Services</a></li>
+
+
+ <li id="portaltab-solutions"
+ class="plain"><a
+ href="http://trolltech.com/solutions" title="">Solutions</a></li>
+
+
+ <li id="portaltab-developer"
+ class="plain"><a
+ href="http://trolltech.com/developer" title="">Developer Resources</a></li>
+
+
+ <li id="portaltab-company" class="plain"><a
+ href="http://trolltech.com/company" title="">Company</a></li>
+
+
+ <li id="portaltab-downloads"
+ class="plain"><a
+ href="http://trolltech.com/downloads" title="">Downloads</a></li>
+
+
+
+
+ </ul>
+ </div>
+ </div>
+
+ </div>
+ <div id="portal-personaltools-wrapper">
+
+<h5 class="hiddenStructure">Personal tools</h5>
+
+
+</div>
+
+ <div class="middlesex">
+ <div id="portal-breadcrumbs">
+
+ <span id="breadcrumbs-you-are-here">You
+are here:</span>
+ <a href="http://trolltech.com">Home</a>
+
+
+</div>
+ </div>
+ </div>
+
+ <div class="visualClear"><!-- --></div>
+
+
+ <table id="portal-columns">
+ <tbody>
+ <tr>
+
+
+
+
+
+ <td id="portal-column-content">
+
+
+ <div id="content" class="">
+
+
+
+ <div class="documentContent" id="region-content">
+
+ <a name="documentContent"></a>
+
+
+
+
+
+
+
+
+
+
+
+ <!-- <table id="frontpagetable" cellpadding="0" cellspacing="0" tal:attributes="width pagew"> --> <!-- tal:on-error="string:replace with error template" Fetch image width here -->
+ <table id="frontpagetable" cellpadding="0"
+ cellspacing="0" width="712">
+ <tr>
+ <td colspan="2">
+
+ <h2>Trolltech provides cross-platform software solutions for:</h2>
+ <table id="fpSolutions" class="solutions" cellpadding="0" cellspacing="6" width="100%">
+ <tbody>
+ <tr>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/managing-development">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Software Development Managers</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/industrial-embedded-development">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Embedded Developers</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+
+ </tr>
+ <tr>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/ce-mobile-vendors">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Consumer Electronics Vendors</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/mobile-application-development">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Mobile Application Developers</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+
+ </tr>
+ <tr>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/application-development">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Cross-Platform Developers</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/solutions-opensource">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Open Source Developers</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+
+ </tr>
+ </tbody>
+ </table>
+
+ </td>
+ </tr>
+
+ <!-- BANNER -->
+
+ <tr class="minspacerow">
+ <td colspan="2">
+
+ <div id="flashcontent">
+
+
+ <!-- In case of no imagemap -->
+ <a
+ href="http://trolltech.com/products/qt/learnmore/whitepapers">
+ <img border="0"
+ src="http://trolltech.com/include/features/frontpage/whitepaper-feature/mainsplash"
+ alt="Code Less. Create More. Deploy Everywhere."
+ height="100" width="700" />
+ </a>
+
+
+ </div>
+
+
+
+ </td>
+ </tr>
+
+ <!-- Product Feature rows -->
+ <tr id="productfeatures" class="minspacerow">
+ <td style="width:350px;">
+ <div class="viewlet productviewlet">
+<p class="discreet"><a title="Downloads" href="downloads/index"><img class="image-right" src="images/frontpage/qt_download_90.png" alt="Download Qt Button: Grey BG" /></a></p>
+<h2>Qt</h2>
+<p>Qt is a cross-platform application framework.&nbsp; It includes:</p>
+<ul><li>An <a title="C++ Class Library" href="products/qt/features/library/index">intuitive class library</a></li><li>Integrated <a title="Development Tools" href="products/qt/features/tools/index">development tools</a></li><li>Support for <a title="C++ and Java Support" href="products/qt/features/language-support/index">C++ and Java development</a></li><li><a title="Cross-Platform Development" href="products/qt/features/platforms/index">Desktop and embedded</a> development support</li></ul>
+<p>&nbsp;</p>
+<p><strong><a title="Qt Cross-Platform Application Framework" href="products/qt/index"><span class="button">Learn More</span></a></strong> <strong><a title="How to order" href="products/qt/orderform"><span class="button">Buy Now</span></a></strong></p>
+<p>&nbsp;</p>
+<p>&nbsp;</p>
+<p>&nbsp;</p>
+</div>
+ </td>
+ <td style="width:350px;">
+ <div class="viewlet productviewlet">
+<p><a title="Qtopia" href="products/qtopia"><img class="image-right" src="images/frontpage/qtopia_learn_more_90.png" alt="Qtopia Learn More button 90px" /></a></p>
+<h2>Qtopia</h2>
+<p><a title="The Qtopia application platform for embedded Linux" href="products/qtopia/index">Qtopia</a> is an application platform and UI for Linux-based <a title="Qtopia Phone Edition" href="products/qtopia/qtopia-product-family/qtopia-phone-edition">mobile</a>, <a title="Qtopia Platform" href="products/qtopia/qtopia-product-family/qtopia-platform">consumer electronics</a> and <a title="Qtopia Platform" href="products/qtopia/qtopia-product-family/qtopia-platform">embedded devices</a>. Qtopia offers:</p>
+<ul><li>Rich <a href="products/qt/features/tools/index">toolkit</a> and intuitive API</li><li>Fully customizable user interface</li><li>Highly efficient development framework</li></ul>
+<p>&nbsp;</p>
+<p><strong><a title="Customer Devices" href="company/customers/customer-devices"><span class="button">Customer Devices</span></a></strong>&nbsp;<strong><a title="Purchasing Qtopia" href="products/qtopia/orderinfo"><span class="button">Buy Now</span></a></strong></p>
+</div>
+ </td>
+ </tr>
+ </table>
+
+
+
+
+
+
+
+
+
+
+
+
+ </div>
+
+ </div>
+
+
+ </td>
+
+
+
+
+ <!-- News/events -->
+ <td id="frontpage-column-two">
+
+ <div class="viewlet">
+ <h3>Quick Links</h3>
+
+
+ <!-- Smart folders -->
+
+ <!-- Links -->
+
+ <p class="smallerExtendedLink">
+ <a href="http://trolltech.com/company/careers"
+ title="Quick Links">Careers at Trolltech</a>
+ </p>
+
+
+ <p class="smallerExtendedLink">
+ <a href="http://trolltech.com/products/qt/learnmore/whitepapers"
+ title="Quick Links">Whitepapers</a>
+ </p>
+
+
+ <p class="smallerExtendedLink">
+ <a href="http://trolltech.com/products/qt/learnmore/webinars-videos"
+ title="Quick Links">Webinars and Videos</a>
+ </p>
+
+ </div>
+
+
+ <div class="viewlet">
+ <h3>Nokia Acquisition</h3>
+
+ <div class="viewletBody">
+<p class="smallerExtendedLink"><a title="Nokia Acquires Trolltech" href="../../../28012008/28012008">Learn more about Nokia's acquisition of Trolltech<br /></a></p>
+</div>
+ <!-- Smart folders -->
+
+ <!-- Links -->
+
+
+
+ </div>
+
+
+ <div class="viewlet">
+ <h3>News</h3>
+
+
+ <!-- Smart folders -->
+
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/announcements/press.2008-06-03.1419977468">Trolltech Releases Qt Jambi 4.3.5</a>
+ <!-- Dates for press release -->
+
+
+ (Jun&nbsp;03)
+ <!--(<tal:date tal:content="item_pressmonth"/>&nbsp;<tal:date tal:content="item_pressday"/>)-->
+
+
+ <!-- Dates for events -->
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/announcements/press.2008-05-28.9662742780">Trolltech releases Qt 4.3.5</a>
+ <!-- Dates for press release -->
+
+
+ (May&nbsp;28)
+ <!--(<tal:date tal:content="item_pressmonth"/>&nbsp;<tal:date tal:content="item_pressday"/>)-->
+
+
+ <!-- Dates for events -->
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/announcements/press.2008-05-14.1108908046">Award From Qt Developers Recognizes Best Open Source Development Tools</a>
+ <!-- Dates for press release -->
+
+
+ (May&nbsp;14)
+ <!--(<tal:date tal:content="item_pressmonth"/>&nbsp;<tal:date tal:content="item_pressday"/>)-->
+
+
+ <!-- Dates for events -->
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/announcements/press.2008-05-08.1819339587">Trolltech Delivered Revenues of NOK 55.6 Million</a>
+ <!-- Dates for press release -->
+
+
+ (May&nbsp;08)
+ <!--(<tal:date tal:content="item_pressmonth"/>&nbsp;<tal:date tal:content="item_pressday"/>)-->
+
+
+ <!-- Dates for events -->
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+
+ <!-- Links -->
+
+
+
+ </div>
+
+
+ <div class="viewlet">
+ <h3>Events</h3>
+
+ <div class="viewletBody">
+<p>&nbsp;</p>
+</div>
+ <!-- Smart folders -->
+
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/events/allevents/event.2008-05-15.0963129132">Qt Open Enrollment Training Class</a>
+ <!-- Dates for press release -->
+
+ <!-- Dates for events -->
+
+
+ (Jun&nbsp;09&nbsp;-&nbsp;Jun&nbsp;13)
+
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/events/allevents/event.2008-02-22.1032431617">Israel Qt User Group</a>
+ <!-- Dates for press release -->
+
+ <!-- Dates for events -->
+
+
+ (Jun&nbsp;16)
+
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/events/allevents/event.2008-05-19.5707721007">Webinar: Building Tomorrow’s Virtual Driver Control Center</a>
+ <!-- Dates for press release -->
+
+ <!-- Dates for events -->
+
+
+ (Jun&nbsp;24)
+
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+
+ <!-- Links -->
+
+ <p class="smallerExtendedLink">
+ <a href="http://trolltech.com/company/newsroom/events"
+ title="Events">More events</a>
+ </p>
+
+
+
+ </div>
+
+ </td>
+
+
+ </tr>
+ </tbody>
+ </table>
+
+
+ <div class="visualClear"><!-- --></div>
+
+
+ <hr class="netscape4" />
+
+
+
+ <div id="portal-footer">
+
+
+<p id="bottom-navigation">
+ Trolltech&reg; - Code Less. Create More. Deploy Everywhere.
+
+ <br />
+
+ <a href="http://trolltech.com/company/contact-us/locations"
+ title="Trolltech ASA">
+ Trolltech ASA
+ </a>
+ <a href="http://trolltech.com/company/contact-us/locations"
+ title="Address: Sandakerveien 116, Oslo">
+ Sandakerveien 116, Oslo
+ </a>
+ <a href="http://trolltech.com/company/contact-us/locations"
+ class="lastNavItem" title="Phone: +47 21 60 48 00">
+ +47 21 60 48 00
+ </a>
+
+ <br />
+
+ <a href="http://trolltech.com/company/contact-us/locations"
+ title="International locations">
+ International locations
+ </a>
+ <a href="/trolltech/privacypolicy" title="Privacy policy">
+ Privacy Policy
+ </a>
+ <a href="/trolltech/copyright" title="Trolltech" class="lastNavItem"><span>2008</span> &copy; Trolltech ASA</a>
+</p>
+
+
+</div>
+
+ <div id="portal-colophon">
+
+
+ <a href="http://plone.org"
+ class="colophonIcon colophonIconPlone"
+ title="This Plone site was built using Plone CMS, the Open Source Content Management System. Click for more information.">
+ Powered by Plone CMS, the Open Source Content Management System
+ </a>
+
+
+
+ <p class="discreet">
+ This site conforms to the following standards:
+ </p>
+
+ <div class="colophonWrapper">
+ <ul>
+ <li>
+ <a href="http://www.section508.gov"
+ class="colophonIcon colophonIcon508"
+ title="This Plone site conforms to the US Government Section 508 Accessibility Guidelines.">
+ Section 508
+ </a>
+ </li>
+ <li>
+ <a href="http://www.w3.org/WAI/WCAG1AA-Conformance"
+ class="colophonIcon colophonIconWAI"
+ title="This Plone site conforms to the W3C-WAI Web Content Accessibility Guidelines.">
+ WCAG
+ </a>
+ </li>
+ <li>
+ <a href="http://validator.w3.org/check/referer"
+ class="colophonIcon colophonIconXHTML"
+ title="This Plone site is valid XHTML.">
+ Valid XHTML
+ </a>
+ </li>
+ <li>
+ <a href="http://jigsaw.w3.org/css-validator/check/referer&amp;warning=no&amp;profile=css3&amp;usermedium=all"
+ class="colophonIcon colophonIconCSS"
+ title="This Plone site was built with valid CSS.">
+ Valid CSS
+ </a>
+ </li>
+ <li>
+ <a href="http://plone.org/browsersupport"
+ class="colophonIcon colophonIconAnyBrowser"
+ title="This Plone site is usable in any web browser.">
+ Usable in any browser
+ </a>
+ </li>
+ </ul>
+ </div>
+
+ </div>
+
+ </div>
+<!-- ProspectXtractor tracker script -->
+<script type="text/javascript"><!--
+function _pxPar()
+{
+var p="";
+p+="&ref="+escape(top.document.referrer);
+p+="&dt="+escape(document.title);
+p+="&sr="+screen.width+"x"+screen.height;
+p+="&sd="+screen.colorDepth;
+p+="&fv="+_pxFV();
+return p;
+}
+function _pxFV()
+{
+var f=0,n=navigator;
+if (n.plugins && n.mimeTypes.length) {
+var x=n.plugins["Shockwave Flash"];
+if(x && x.description) {
+var y=x.description;
+f=y.charAt(y.indexOf('.')-1);
+}
+} else {
+r=false;
+for(var i=15;i>=3&&r!=true;i-=1){
+execScript('on error resume next: r=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript');
+f=i;
+}
+}
+return f;
+}
+document.write('<img src="http://pxreg.onlineservicesas.com/pxreg/?id=50C9FD2F-61D5-4824-B726-50D6B1F89999'+_pxPar()+'" width="1" heigth="1" />');
+//-->
+</script>
+<noscript>
+<div><img src="http://pxreg.onlineservicesas.com/pxreg/?id=50C9FD2F-61D5-4824-B726-50D6B1F89999" width="1" height="1" alt="" /></div>
+</noscript>
+<!-- END ProspectXtractor tracker script -->
+</body>
+</html>
+
diff --git a/examples/xml/htmlinfo/w3c_org.html b/examples/xml/htmlinfo/w3c_org.html
new file mode 100644
index 0000000000..0fcce48e4a
--- /dev/null
+++ b/examples/xml/htmlinfo/w3c_org.html
@@ -0,0 +1,507 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
+<head profile="http://www.w3.org/2000/08/w3c-synd/#"><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="HTML Tidy for Mac OS X (vers 1st March 2004), see www.w3.org" />
+
+<meta name="keywords" content="W3C, World Wide Web, Web, WWW, Consortium, computer, access, accessibility, semantic, worldwide, W3, HTML, XML, standard, language, technology, link, CSS, RDF, XSL, Berners-Lee, Berners, Lee, style sheet, cascading, schema, XHTML, mobile, SVG, PNG, PICS, DOM, SMIL, MathML, markup, Amaya, Jigsaw, free, open source, software" />
+<meta name="description" content="The World Wide Web Consortium (W3C) is an international consortium where Member organizations, a full-time staff, and the public work together to develop Web standards. W3C primarily pursues its mission through the creation of Web standards and guidelines designed to ensure long-term growth for the Web. Over 400 organizations are Members of the Consortium. W3C is jointly run by the MIT Computer Science and Artificial Intelligence Laboratory (MIT CSAIL) in the USA, the European Research Consortium for Informatics and Mathematics (ERCIM) headquartered in France, Keio University in Japan, and has additional Offices worldwide." />
+
+<title>World Wide Web Consortium - Web Standards</title>
+<link rel="meta" href="/Overview-about.rdf" />
+<link rel="stylesheet" type="text/css" href="/StyleSheets/home.css" />
+<link rel="bookmark" href="#technologies" title="Technologies |" />
+<link rel="bookmark" href="#news" title="News |" />
+<link rel="bookmark" href="#search" title="Search |" />
+<link rel="contents" href="#contents" title="Contents |" />
+<link rel="bookmark" href="#Offices" title="Offices |" />
+<link rel="bookmark" href="#systems" title="Systems |" />
+<link rel="bookmark" href="#donors" title="Supporters |" />
+<link rel="bookmark" href="#footnotes" title="Footnotes |" />
+<link rel="alternate" type="application/rss+xml" title="W3C Home Page News RSS Channel" href="http://www.w3.org/2000/08/w3c-synd/home.rss" />
+
+<style type="text/css">
+/**/
+ div.spot-image img {
+ margin-bottom: 20px;
+ }
+/**/
+</style>
+</head>
+
+<body>
+<h1 id="logo"><img alt="The World Wide Web Consortium (W3C)" height="48" width="315" src="/Icons/w3c_main" /></h1>
+
+<h2 id="slogan">Leading the Web to Its Full Potential...</h2>
+
+<div>
+<map name="introLinks" id="introLinks" title="Introductory Links">
+<div class="banner">
+<span class="invisible"><a class="bannerLink" title="Skip introductory links and the mission statement" href="#technologies">Skip to Technologies</a> |</span> <a class="bannerLink" title="W3C Activities" accesskey="A" href="/Consortium/activities">Activities</a> | <a class="bannerLink" title="Technical Reports and Recommendations" accesskey="T" href="/TR/">Technical Reports</a> | <a class="bannerLink" title="Alphabetical Site Index" accesskey="S" href="/Consortium/siteindex">Site Index</a> | <a class="bannerLink" title="Help for new visitors" accesskey="N" href="/Consortium/new-to-w3c">New
+Visitors</a> | <a class="bannerLink" title="About W3C" accesskey="B" href="/Consortium/">About W3C</a> | <a class="bannerLink" title="Join W3C" accesskey="J" href="/Consortium/join">Join W3C</a> |
+<a class="bannerLink" title="Contact W3C" accesskey="C" href="/Consortium/contact">Contact W3C</a>
+</div>
+</map>
+</div>
+
+<p class="small">The World Wide Web Consortium (<acronym title="World Wide Web Consortium">W3C</acronym>) develops interoperable
+technologies (specifications, guidelines, software, and tools) to lead
+the Web to its full potential. W3C is a forum for information,
+commerce, communication, and collective understanding. On this page,
+you'll find <a href="#news">W3C news</a>, links to <a href="#technologies">W3C technologies</a> and ways to <a href="#contents">get involved</a>. New visitors can find help in
+<cite><a href="/Consortium/new-to-w3c">Finding Your Way at
+W3C</a></cite>. We encourage organizations to learn more <a href="/Consortium/">about W3C</a> and <a href="/Consortium/membership">about
+W3C Membership</a>.</p>
+
+<div class="navBlock">
+<h2 class="spot-head">XML10</h2>
+
+<div class="spot">
+<div class="spot-image">
+<a href="/2008/xml10/">
+<img src="/2008/xml10/xml-10.png" width="106" height="48" alt="XML 10" />
+</a>
+</div>
+<p class="spot-block">
+To celebrate
+<a href="/2008/xml10/">ten years of XML</a>,
+W3C invites you to
+<a href="/2008/xml10/card/greeting-form">send a greeting</a>
+and tell us about an XML-related blog or article.
+Many thanks to the FLWOR Foundation for their
+generous sponsorship of XML10.
+</p>
+</div>
+
+<h2 class="spot-head">W3C Supporters</h2>
+<div class="spot">
+<p class="spot-block">Help W3C by making a donation through the
+<a href="/Consortium/sup">W3C Supporters Program</a>.</p>
+</div>
+
+
+
+<h2 class="spot-head">Employment</h2>
+
+<div class="spot">
+<p class="spot-block">Current <a href="/Consortium/Recruitment/">job
+opportunities</a> at W3C: <a href="http://www.ercim.org/jobs/wai_consultant.html">Web Accessibility and Ageing Consultant</a>. Current <a href="/Consortium/Recruitment/Fellows#openings">W3C Fellows Program
+openings</a> are <a href="/2007/01/comm-fellow1">Business and
+Technology Communications Specialist</a>, <a href="/2007/01/comm-fellow2">Web / Graphic Designer</a>, and <a href="/2007/01/SysteamFellowsPosition">Software Engineer</a>.</p>
+</div>
+
+<h2 class="navhead"><a name="technologies" id="technologies">W3C A to
+Z</a></h2>
+
+<ul>
+<li class="invisible"><a class="navlink" title="Skip W3C A-Z" href="#news">Skip to News</a></li>
+
+<li><a href="/WAI/" class="navlink">Accessibility</a></li>
+
+<li><a href="/Amaya/" class="navlink">Amaya</a></li>
+
+<li><a href="/Mobile/CCPP/" class="navlink"><abbr title="Composite Capability/Preference Profiles">CC/PP</abbr></a></li>
+
+<li><a href="/2004/CDF/" class="navlink">Compound Document Formats
+(CDF)</a></li>
+
+<li><a href="/Style/CSS/" class="navlink"><abbr title="Cascading Style Sheets">CSS</abbr></a></li>
+
+<li><a href="http://jigsaw.w3.org/css-validator/" class="navlink"><abbr title="Cascading Style Sheets">CSS</abbr>
+Validator</a></li>
+
+<li><a href="/2002/ws/databinding/" class="navlink">Databinding</a></li>
+
+<li><a href="/DOM/" class="navlink"><acronym title="Document Object Model">DOM</acronym></a></li>
+
+<li><a href="/XML/EXI" class="navlink">Efficient XML
+Interchange</a></li>
+
+<li><a href="/2007/eGov/" class="navlink">eGovernment</a></li>
+
+<li><a href="/2001/sw/grddl-wg/" class="navlink"><acronym title="Gleaning Resource Descriptions from Dialects of Languages">GRDDL</acronym></a></li>
+
+<li><a href="/2001/sw/hcls/" class="navlink">Health Care and Life
+Sciences</a></li>
+
+<li><a href="/html/" class="navlink"><abbr title="HyperText Markup Language">HTML</abbr></a></li>
+
+<li><a href="/People/Raggett/tidy/" class="navlink"><abbr title="HyperText Markup Language">HTML</abbr> Tidy</a></li>
+
+<li><a href="http://validator.w3.org/" class="navlink"><abbr title="HyperText Markup Language">HTML</abbr> Validator</a></li>
+
+<li><a href="/Protocols/" class="navlink"><abbr title="Hypertext Transfer Protocol">HTTP</abbr></a></li>
+
+<li><a href="/2005/Incubator/" class="navlink">Incubator</a></li>
+
+<li><a href="/2002/mmi/ink" class="navlink">InkML</a></li>
+
+<li><a href="/International/" class="navlink">Internationalization</a></li>
+
+<li><a href="/Jigsaw/" class="navlink">Jigsaw</a></li>
+
+<li><a href="/Library/" class="navlink">Libwww</a></li>
+
+<li><a href="/Math/" class="navlink">MathML</a></li>
+
+<li><a href="/Mobile/" class="navlink">Mobile Web Initiative
+(W3C-MWI)</a></li>
+
+<li><a href="/2002/mmi/" class="navlink">Multimodal
+Interaction</a></li>
+
+<li><a href="/2004/OWL/" class="navlink"><acronym title="OWL Web Ontology Language">OWL</acronym></a></li>
+
+<li><a href="/2004/pp/" class="navlink">Patent Policy</a></li>
+
+<li><a href="/PICS/" class="navlink"><acronym title="Platform for Internet Content Selection">PICS</acronym></a></li>
+
+<li><a href="/Graphics/PNG/" class="navlink"><acronym title="Portable Network Graphics">PNG</acronym></a></li>
+
+<li><a href="/2007/powder/" class="navlink"><acronym title="Protocol for Web Description Resources">POWDER</acronym></a></li>
+
+<li><a href="/P3P/" class="navlink">Privacy and <abbr title="Platform for Privacy Preferences">P3P</abbr></a></li>
+
+<li><a href="/RDF/" class="navlink"><abbr title="Resource Description Framework">RDF</abbr></a></li>
+
+<li><a href="/2006/rwc/" class="navlink">Rich Web Clients</a></li>
+
+<li><a href="/2005/rules/" class="navlink">Rules</a></li>
+
+<li><a href="/Security/" class="navlink">Security</a></li>
+
+<li><a href="/2001/sw/" class="navlink">Semantic Web</a></li>
+
+<li><a href="/XML/SML" class="navlink">Service Modeling Language
+(<abbr title="Service Modeling Language">SML</abbr>)</a></li>
+
+<li><a href="/AudioVideo/" class="navlink"><acronym title="Synchronized Multimedia Integration Language">SMIL</acronym></a></li>
+
+<li><a href="/2000/xp/Group/" class="navlink"><acronym title="Soap">SOAP</acronym>/<abbr title="XML Protocol">XMLP</abbr></a></li>
+
+<li><a href="/2002/ws/soapjms/" class="navlink"><acronym title="Soap">SOAP-JMS</acronym></a></li>
+
+<li><a href="/2001/sw/DataAccess/" class="navlink"><acronym title="Simple Protocol and RDF Query Language">SPARQL</acronym></a></li>
+
+<li><a href="/Style/" class="navlink">Style</a></li>
+
+<li><a href="/Graphics/SVG/" class="navlink"><abbr title="Scalable Vector Graphics">SVG</abbr></a></li>
+
+<li><a href="/2001/tag/" class="navlink"><abbr title="Technical Architecture Group">TAG</abbr></a></li>
+
+<li><a href="/AudioVideo/TT/" class="navlink">Timed Text</a></li>
+
+<li><a href="/Addressing/" class="navlink"><abbr title="Uniform Resource Identifiers">URI/URL</abbr></a></li>
+
+<li><a href="/QA/Tools/#validators" class="navlink">Validators</a></li>
+
+<li><a href="/Voice/" class="navlink">Voice</a></li>
+
+<li><a href="/2007/uwa/" class="navlink">Ubiquitous Web
+Applications</a></li>
+
+<li><a href="/WAI/" class="navlink"><acronym title="Web Accessibility Initiative">WAI</acronym></a></li>
+
+<li><a href="/2006/webapi/" class="navlink">Web API</a></li>
+
+<li><a href="/2006/appformats/" class="navlink">Web Application
+Formats</a></li>
+
+<li><a href="/2001/tag/" class="navlink">Web Architecture
+(<acronym title="Technical Architecture Group">TAG</acronym>)</a></li>
+
+<li><a href="/Graphics/WebCGM/WG/" class="navlink"><abbr title="Web Computer Graphics Metafile">WebCGM</abbr></a></li>
+
+<li><a href="/2002/ws/" class="navlink">Web Services</a></li>
+
+<li><a href="/2002/ws/addr/" class="navlink"><abbr title="Web Services">WS</abbr>-Addressing</a></li>
+
+<li><a href="/2002/ws/chor/" class="navlink"><abbr title="Web Services Choreography Description Language">WS-CDL</abbr></a></li>
+
+<li><a href="/2002/ws/desc/" class="navlink"><acronym title="Web Services Description Language">WSDL</acronym></a></li>
+
+<li><a href="/2002/ws/policy/" class="navlink"><abbr title="Web Services">WS</abbr>-Policy</a></li>
+
+<li><a href="/MarkUp/Forms/" class="navlink"><acronym title="Next Generation Web Forms">XForms</acronym></a></li>
+
+<li><a href="/MarkUp/" class="navlink"><abbr title="Extensible HyperText Markup Language">XHTML</abbr></a></li>
+
+<li><a href="/MarkUp/" class="navlink"><abbr title="Extensible HyperText Markup Language">XHTML2</abbr></a></li>
+
+<li><a href="/XML/Linking" class="navlink"><acronym title="XML Link">XLink</acronym></a></li>
+
+<li><a href="/XML/" class="navlink"><abbr title="Extensible Markup Language">XML</abbr></a></li>
+
+<li><a href="/TR/xmlbase/" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Base</a></li>
+
+<li><a href="/2001/XKMS/" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Key Management</a></li>
+
+<li><a href="/XML/Processing/" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Processing</a></li>
+
+<li><a href="/XML/Query" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Query</a></li>
+
+<li><a href="/XML/Schema" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Schema</a></li>
+
+<li><a href="/2008/xmlsec/" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Signature
+and Encryption</a></li>
+
+<li><a href="/Style/XSL/" class="navlink">XPath</a></li>
+
+<li><a href="/XML/Linking" class="navlink">XPointer</a></li>
+
+<li><a href="/Style/XSL/" class="navlink"><acronym title="Extensible Stylesheet Language">XSL</acronym> and <acronym title="XSL Transformations">XSLT</acronym></a></li>
+</ul>
+
+<p><a href="/Consortium/siteindex" class="navlink">More
+topics...</a></p>
+</div>
+
+<div class="newsBlock">
+<h2 class="newsHeading"><a name="news" id="news">News</a></h2>
+
+<p class="invisible"><a title="Skip News" href="#search">Skip to
+Search</a></p>
+
+<div id="item103" class="item"><h3 class="headline">New eGovernment Activity to Help Improve Government through Better Use of the Web</h3>
+<p><a href="/2007/eGov/"><img class="newsImage" width="300" height="75" src="/2008/06/03-egov" alt="Crowd scene" /></a></p>
+<p><span class="date">2008-06-03:</span> W3C launches today a <a href="/2007/eGov/">new forum</a> for governments, citizens, researchers, and other stakeholders to investigate how best to use Web technology for good governance and citizen participation. "Open Standards, and in particular Semantic Web Standards, can help lower the cost of government, make it easier for independent agencies to work together, and increase flexibility in the face of change," said Tim Berners-Lee, W3C Director. W3C invites participation in the new <a href="/2007/eGov/IG/">eGovernment Interest Group</a>, which is open to the public. The group will identify best practices and guidelines in this area, document where current technology does not adequately address stakeholder needs, and suggest improvements via the standards process. Read the <a href="/2007/eGov/IG/faq">W3C eGovernment FAQ</a> and <a href="/2008/06/egov-pressrelease">press release</a>, and learn more about the <a href="/2007/eGov/">W3C eGovernment Activity</a>.<span class="archive"> (<a title="New eGovernment Activity to Help Improve Government through Better Use of the Web" href="/News/2008#item103" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item105" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Two Group Notes Published About Semantic Web and Life Sciences</h3><p><span class="date">2008-06-05:</span> The <a href="/2001/sw/hcls/">Semantic Web Health Care and Life Sciences Interest Group</a> has published two Group Notes: <a href="/TR/2008/NOTE-hcls-kb-20080604/">A Prototype Knowledge Base for the Life Sciences</a> and <a href="/TR/2008/NOTE-hcls-senselab-20080604/">Experiences with the conversion of SenseLab databases to RDF/OWL</a>. The former describes a prototype of a biomedical knowledge base that integrates 15 distinct data sources using currently available Semantic Web technologies including RDF and OWL. The Note outlines which resources were integrated, how the knowledge base was constructed using free and open source triple store technology, how it can be queried using SPARQL, and what resources and inferences are involved in answering complex queries. While the utility of the knowledge base is illustrated by identifying a set of genes involved in Alzheimer's Disease, the approach described here can be applied to any use case that integrates data from multiple domains. The second document describe the experience of converting SenseLab databases into OWL, an important step towards realizing the benefits of Semantic Web in integrative neuroscience research. Learn more about the <a href="/2001/sw/">Semantic Web Activity</a>.<span class="archive"> (<a title="Two Group Notes Published About Semantic Web and Life Sciences" href="/News/2008#item105" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item104" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Offline Web Applications Published as W3C Note</h3><p><span class="date">2008-06-03:</span> The <a href="/html/wg/">HTML Working Group</a> has published the <a href="/TR/2008/NOTE-offline-webapps-20080530/">Offline Web Applications</a> Group Note. <a href="/TR/html5/">HTML 5</a> contains several features that address the challenge of building Web applications that work while offline. This document highlights these features (SQL, offline application caching APIs as well as online/offline events, status, and the localStorage API) from HTML 5 and provides brief tutorials on how these features might be used to create Web applications that work offline. Learn more about the <a href="/MarkUp/Activity">HTML Activity</a>.<span class="archive"> (<a title="Offline Web Applications Published as W3C Note" href="/News/2008#item104" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item102" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />W3C Advisory Committee Elects Advisory Board</h3><p><span class="date">2008-06-02:</span> The W3C Advisory Committee has filled six open seats on the <a href="/2002/ab/">W3C Advisory Board</a>. Created in 1998, the Advisory Board provides guidance to the Team on issues of strategy, management, legal matters, process, and conflict resolution. Beginning 1 July, the nine Advisory Board participants are Jean-François Abramatic (ILOG), Ann Bassetti (The Boeing Company), Jim Bell (HP), Don Deutsch (Oracle), Eduardo Gutentag (Sun Microsystems), Steve Holbrook (IBM), Ken Laskey (MITRE), Ora Lassila (Nokia), and Arun Ranganathan (Mozilla Foundation). Steve Zilles continues as interim Advisory Board Chair. Read more about the <a href="/2002/ab/">Advisory Board</a>.<span class="archive"> (<a title="W3C Advisory Committee Elects Advisory Board" href="/News/2008#item102" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item101" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />W3C Talks in June</h3><p><span class="date">2008-06-02:</span> Browse <a href="/Talks/">W3C presentations and events</a> also available as an <abbr title="RDF Site Summary"><a href="/2004/08/TalkFiles/Talks.rss">RSS channel</a></abbr>. <span class="archive"> (<a title="W3C Talks in June" href="/News/2008#item101" rel="details">Permalink</a>) </span></p><ul><li><span class="talkstart">2 June, Västerås, Sweden: </span><span class="talktitle" lang="sv" xml:lang="sv">Framtidssäkra eFörvaltningen<span class="hide noprint">.</span></span><span class="talkdesc">Olle Olsson participates in a panel at <a href="http://www.offentligarummet.se/" lang="sv" xml:lang="sv">Offentliga Rummet 2008</a>. </span></li><li><span class="talkstart">4 June, Sao Paulo, Brazil: </span><span class="talktitle">Towards eGovernment 2.0 through better use of the Web<span class="hide noprint">.</span></span><span class="talkdesc">José Manuel Alonso presents at <a href="http://www.w3c.br/2008/launch/">W3C Brazil Office Public Launch</a>. </span></li><li><span class="talkstart">4 June, Sao Paolo, Brazil: </span><span class="talktitle">W3C - Web Open Standards<span class="hide noprint">.</span></span><span class="talkdesc">Daniel Dardailler presents at <a href="http://www.w3c.br/2008/lancamento/">W3C Brazil Office Launch event </a>. </span></li><li><span class="talkstart">10 June, Buenos Aires, Argentina: </span><span class="talktitle">Web Accessibility: People with Disabilities and Elderly Citizens<span class="hide noprint">.</span></span><span class="talkdesc">Shadi Abou-Zahra presents at <a href="http://www.isoc.org.ar/accesibilidad.html" lang="es" xml:lang="es">Web Sin Barreras</a>. </span></li><li><span class="talkstart">11 June, Nashville, TN, USA: </span><span class="talktitle">Color for the Global Web<span class="hide noprint">.</span></span><span class="talkdesc">Molly E Holzschlag presents at <a href="http://www.voicesthatmatter.com/webdesign2008/index.aspx">Voices That Matter</a>. </span></li><li><span class="talkstart">12 June, Nashville, TN, USA: </span><span class="talktitle">Designing for Today's Browsers<span class="hide noprint">.</span></span><span class="talkdesc">Molly E Holzschlag presents at <a href="http://www.voicesthatmatter.com/webdesign2008/index.aspx">Voices That Matter</a>. </span></li><li><span class="talkstart">17 June, New York, NY, USA: </span><span class="talktitle">Web of Data<span class="hide noprint">.</span></span><span class="talkdesc">Tim Berners-Lee presents at <a href="http://www.linkeddataplanet.com/index.php">LinkedData Planet Conference: exploring the new web of linked data</a>. </span></li><li><span class="talkstart">19 June, Tokyo, Japan: </span><span class="talktitle">Update on W3C/WAI Guidelines including WCAG 2.0<span class="hide noprint">.</span></span><span class="talkdesc">Judy Brewer presents at <a>Open Seminar of Information Accessibility</a>. </span></li><li><span class="talkstart">19 June, Nancy, France: </span><span class="talktitle" lang="fr" xml:lang="fr">États des lieux du Web sémantique<span class="hide noprint">.</span></span><span class="talkdesc">Ivan Herman gives a keynote at <a href="http://ic2008.loria.fr/" lang="fr" xml:lang="fr">19èmes Journées Francophones d'Ingénierie des Connaissances (IC2008)</a>. </span></li><li><span class="talkstart">19 June, Baltimore, Maryland, USA: </span><span class="talktitle">How New Web Accessibility Standards Impact User Experience Design<span class="hide noprint">.</span></span><span class="talkdesc">Shawn Henry presents at <a href="http://www.usabilityprofessionals.org/conference/2008/">Usability Professionals' Association International Conference 2008</a>. </span></li><li><span class="talkstart">26 June, Frankfurt, Germany: </span><span class="talktitle">Mobile Internet - the Way Forward<span class="hide noprint">.</span></span><span class="talkdesc">Steve Bratt participates in a panel at <a href="http://www.amiando.com/ngmn-2008">2nd NGMN Industry Conference 2008</a>. </span></li><li class="noprint showuris">View <a href="http://www.w3.org/2004/08/W3CTalks?date=Recent+and+upcoming&amp;countryListing=yes&amp;submit=Submit">upcoming talks by country</a></li><li class="noprint showuris"><a href="/Talks/">More talks...</a></li></ul></div>
+
+<div id="item100" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />W3C Launches Group to Help Bridge the Digital Divide</h3><p><a href="/2008/MW4D/"><img class="newsImage" alt="Phone bikes" src="/2008/05/voiturette-sb.png" /></a><span class="date">2008-05-27:</span> As part of the growing set of W3C initiatives related to social development, W3C invites participation in the new <a href="/2008/MW4D/">Mobile Web for Development (MW4D) interest Group</a>, chartered to explore the potential of mobile technology to help bridge the digital divide. "We need to solve important challenges, such as lack of standards in end-user devices, network constraints, service cost, issues of literacy, and an understanding of the real information needs of rural communities," said Ken Banks, kiwanja.net, who Chairs the group. "To do so requires an multidisciplinary approach, a step we take through the creation of this new group." Read more in the <a href="/2008/05/mw4dig-pressrelease">press release</a>. This launch is part of <a href="/Mobile">W3C's Mobile Web Initiative (MWI)</a>, which aims to identify and resolve challenges and issues of accessing the Web when on the move. This work takes place under the auspices of the <a href="http://cordis.europa.eu/fp7/ict/">European Union's 7th Research Framework Programme (FP7)</a>, part of the <a href="http://digitalworld.ercim.org/">Digital World Forum</a> project.<span class="archive"> (Photo credit: Stéphane Boyera. <a title="W3C Launches Group to Help Bridge the Digital Divide" href="/News/2008#item100" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item99" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Last Call: XHTML Access Module</h3><p><span class="date">2008-05-26:</span> The <a href="/MarkUp/">XHTML 2 Working Group</a> has published the Last Call Working Draft of <a href="/TR/2008/WD-xhtml-access-20080526/">XHTML Access Module</a>. This document is intended to help make XHTML-family markup languages more effective at supporting the needs of the accessibility community. It does so by providing a generic mechanism for defining the relationship between document components and well-known accessibility taxonomies. Comments are welcome through 16 June. Learn more about the <a href="/MarkUp/Activity">HTML Activity</a>. <span class="archive"> (<a title="Last Call: XHTML Access Module" href="/News/2008#item99" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item98" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />W3C Invites Implementations of CSS Namespaces Module (Candidate Recommendation)</h3><p><span class="date">2008-05-23:</span> The <a href="/Style/CSS/members">Cascading Style Sheets (CSS) Working Group</a> has published the Candidate Recommendation of <a href="/TR/2008/CR-css3-namespace-20080523/">CSS Namespaces Module</a>. This CSS Namespaces module defines the syntax for using namespaces in CSS. It defines the @namespace rule for declaring the default namespace and binding namespaces to namespace prefixes, and it also defines a syntax that other specifications can adopt for using those prefixes in namespace-qualified names. Learn more about the <a href="/Style/">Style Activity</a>.<span class="archive"> (<a title="W3C Invites Implementations of CSS Namespaces Module (Candidate Recommendation)" href="/News/2008#item98" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item97" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Progress Events 1.0</h3><p><span class="date">2008-05-22:</span> The <a href="/2006/webapi/">Web API Working Group</a> has published a Working Draft of <a href="/TR/2008/WD-progress-events-20080521/">Progress Events 1.0</a>.This document describes event types that can be used for monitoring the progress of an operation. It is primarily intended for contexts such as data transfer operations specified by <a href="/TR/XMLHttpRequest">XMLHTTPRequest</a>, or <a href="/TR/MediaAccessEvents/">Media Access Events</a>. Learn more about the <a href="/2006/rwc/">Rich Web Client Activity</a>.<span class="archive"> (<a title="Progress Events 1.0" href="/News/2008#item97" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item96" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />XML Security Working Group to Take Next Steps on XML Signature, Encryption</h3><p><span class="date">2008-05-21:</span> W3C is pleased to announce the creation of the <a href="/2008/xmlsec/">XML Security Working Group</a>, whose mission is to evaluate and act on <a href="/2007/xmlsec/ws/report">recommendations</a> from the <a href="/2007/xmlsec/ws/agenda.html">September 2007 Workshop on XML Signature and XML Encryption</a> regarding next steps for XML Security specifications. The group's <a href="/2008/02/xmlsec-charter.html#deliverables">deliverables</a> include new work on XML Signature Syntax and Processing and XML Encryption Syntax and Processing, as well as maintenance of related specifications. Frederick Hirsch (Nokia) will Chair the group, with Thomas Roessler (W3C) as Team Contact. Learn more about the <a href="/Security/">W3C Security Activity</a>. <span class="archive"> (<a title="XML Security Working Group to Take Next Steps on XML Signature, Encryption" href="/News/2008#item96" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item94" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Last Call: Cascading Style Sheets (CSS) Snapshot 2007</h3><p><span class="date">2008-05-16:</span> The <a href="/Style/CSS/members">Cascading Style Sheets (CSS) Working Group</a> has published the Last Call Working Draft of <a href="/TR/2008/WD-css-beijing-20080516/">Cascading Style Sheets (CSS) Snapshot 2007</a>. This document collects together into one definition all the specifications that together form the current state of Cascading Style Sheets (CSS). The primary audience is CSS implementors, not CSS authors, as this definition includes modules by specification stability, not Web browser adoption rate. Comments are welcome through 09 June. Learn more about the <a href="/Style/">Style Activity</a>.<span class="archive"> (<a title="Last Call: Cascading Style Sheets (CSS) Snapshot 2007" href="/News/2008#item94" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item93" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />W3C Invites Implementations of XQuery and XPath Full Text 1.0 (Candidate Recommendation); Requirements and Use Cases Drafts Available</h3><p><span class="date">2008-05-16:</span> The W3C <a href="http://www.w3.org/XML/Query/">XML Query Working Group</a> and the W3C <a href="http://www.w3.org/Style/XSL/">XSL Working Group</a> jointly published today a Candidate Recommendation of <a href="/TR/2008/CR-xpath-full-text-10-20080516/">XQuery and XPath Full Text 1.0</a>. This document defines the syntax and formal semantics of XQuery and XPath Full Text 1.0 which is a language that extends XQuery 1.0 [XQuery 1.0: An XML Query Language] and XPath 2.0 [XML Path Language (XPath) 2.0] with full-text search capabilities. Implementors are encouraged to run the groups' <a href="http://dev.w3.org:/cvsweb/2007/xpath-full-text-10-test-suite/">test suite</a> and report their results. The Groups also published Working Drafts of <a href="/TR/2008/WD-xpath-full-text-10-requirements-20080516/">XQuery and XPath Full Text 1.0 Requirements</a> and <a href="/TR/2008/WD-xpath-full-text-10-use-cases-20080516/">Use Cases</a>. Learn more about the <a href="/XML/">XML Activity</a>.<span class="archive"> (<a title="W3C Invites Implementations of XQuery and XPath Full Text 1.0 (Candidate Recommendation); Requirements and Use Cases Drafts Available" href="/News/2008#item93" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item95" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />State Chart XML (SCXML) Working Draft Published</h3><p><span class="date">2008-05-16:</span> The <a href="/Voice/">Voice Browser Working Group</a> has published an updated Working Draft of <a href="/TR/2008/WD-scxml-20080516/">State Chart XML (SCXML): State Machine Notation for Control Abstraction</a>. <abbr title="State Chart eXtensible Markup Language">SCXML</abbr> is an execution environment based on <a href="http://www.uml.org/#UML1.5"><abbr title="Unified Modeling Language">UML</abbr></a> Harel State Tables and <a href="/TR/ccxml/"><abbr title="Call Control eXtensible Markup Language">CCXML</abbr></a>. The main differences from the previous draft are (1) the modularization of the language, (2) the introduction of profiles and (3) a revision of the algorithm for document interpretation; the document as a whole has changed significantly and the group welcomes review. Learn more about the <a href="/Voice/">Voice Browser Activity</a>.<span class="archive"> (<a title="State Chart XML (SCXML) Working Draft Published" href="/News/2008#item95" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item92" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />"Web Accessibility for Older Users: A Literature Review"; Comments Welcome on First Public Draft</h3><p><span class="date">2008-05-14:</span> The Web Accessibility Initiative (WAI) <a href="/WAI/EO/">Education and Outreach Working Group Working Group (EOWG)</a> has published <a href="/TR/2008/WD-wai-age-literature-20080514/">Web Accessibility for Older Users: A Literature Review</a> as a First Public Working Draft. The document includes reviews and analysis of guidelines and articles covering the requirements of people with Web accessibility needs related to ageing. This literature review will inform WAI efforts to promote accessibility solutions for older Web users and potentially to develop profiles or extensions to WAI guidelines. The literature review is a deliverable of the <a href="/WAI/WAI-AGE/">WAI-AGE Project</a> (Ageing Education and Harmonisation). See the <a href="http://lists.w3.org/Archives/Public/w3c-wai-ig/2008AprJun/0083.html">call for review and participation</a> for an introduction to the project and an invitation to contribute to the literature review and other WAI-AGE work; and about the <a href="/WAI/">Web Accessibility Initiative</a>.<span class="archive"> (<a title="Web Accessibility for Older Users: A Literature Review; Comments Welcome on First Public Draft" href="/News/2008#item92" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item91" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Last Call: CURIE Syntax 1.0</h3><p><span class="date">2008-05-08:</span> The <a href="/MarkUp/">XHTML2 Working Group</a> has published the Last Call Working Draft of <a href="/TR/2008/WD-curie-20080506">CURIE Syntax 1.0</a>, which outlines a syntax for expressing URIs in a generic, abbreviated syntax ("Compact URI"). The specification targets language designers who need a mechanism to permit the use of extensible value collections. Any language designer considering the use of QNames in attribute values should consider instead using CURIEs, since CURIEs are designed for this purpose, while QNames are not. Comments are welcome through 10 June. Learn more about the <a href="/MarkUp/Activity">HTML Activity</a>.<span class="archive"> (<a title="Last Call: CURIE Syntax 1.0" href="/News/2008#item91" rel="details">Permalink</a>) </span></p></div>
+
+
+
+<h3 class="pastNews"><a href="/News/2008">Past News</a></h3>
+</div>
+
+<div class="navBlock">
+<h2 class="navhead"><a name="search" id="search">Search</a></h2>
+
+<p class="invisible"><a class="navlink" title="Skip search" href="#contents">Skip to Contents</a></p>
+
+<form method="get" action="http://www.google.com/custom" enctype="application/x-www-form-urlencoded">
+<div>
+<a class="navlink" href="http://www.google.com"><img src="/Icons/Logo_25wht.gif" width="75" height="32" alt="Google" /></a><br />
+<label for="inputField">Search W3C<br />
+<input type="text" size="15" id="inputField" name="q" accesskey="E" maxlength="255" /></label> <input type="submit" value="Go" id="goButton" name="sa" accesskey="G" /><br />
+<input type="hidden" name="cof" value="T:black;LW:72;ALC:#ff3300;L:http://www.w3.org/Icons/w3c_home;LC:#000099;LH:48;BGC:white;AH:left;VLC:#660066;GL:0;AWFID:0b9847e42caf283e;" />
+ <input type="hidden" id="searchW3C" name="sitesearch" checked="checked" value="www.w3.org" /><input type="hidden" name="domains" value="www.w3.org" />
+</div>
+</form>
+
+<p><a class="navlink" href="/Search/Mail/Public/">Search W3C Mailing
+Lists</a></p>
+
+<h2 class="navhead"><a name="contents" id="contents">Testimonials</a></h2>
+
+<div class="hpmt"><div class="hpmt-name">Fraunhofer Gesellschaft</div><div class="hpmt-logo"><a rel="nofollow" href="http://www.fraunhofer.de/"><img alt="Fraunhofer Gesellschaft" src="http://www.w3.org/Consortium/Member/Testimonial/Logo/119" /></a></div><p class="hpmt-testimonial">The Fraunhofer-Gesellschaft undertakes applied contract research in all fields of engineering sciences. Fraunhofer works with W3C to contribute to the development of Web technologies which are the base of many of our research activities. Fraunhofer hosts the W3C Office in Germany and Austria. <a class="hpmt-more" href="http://www.w3.org/Consortium/Member/Testimonial/List">(Member testimonials)</a></p></div>
+
+<h2 class="navhead">Members</h2>
+
+<ul>
+<li><a href="/Member/" class="navlink">Member Home Page</a></li>
+
+<li><a href="/Submission/" class="navlink">Member Submissions</a></li>
+
+<li><a href="/Consortium/Member/List" class="navlink">Current
+Members</a></li>
+
+<li><a href="/Consortium/meetings" class="navlink">Meetings</a></li>
+
+<li><a href="/Consortium/Recruitment/Fellows" class="navlink">Fellows</a> (<a href="/Consortium/Recruitment/Fellows#openings">New Openings</a>)</li>
+</ul>
+
+<h2 class="navhead">Get Involved</h2>
+
+<ul>
+<li><a href="/Consortium/membership-benefits" class="navlink">W3C
+Membership Benefits</a></li>
+
+<li><a href="/Consortium/membership#bizcase" class="navlink">Reasons to
+Join W3C</a></li>
+
+<li><a href="/Mail/" class="navlink">Mailing Lists</a></li>
+
+<li><a href="http://lists.w3.org/Archives/Public/public-new-work/latest">Potential
+New Work</a></li>
+
+<li><a href="/Consortium/Translation/" class="navlink">Translations</a></li>
+
+<li><a href="/2003/08/Workshops/" class="navlink">Workshops</a></li>
+
+<li><a href="/2001/11/StdLiaison" class="navlink">Liaisons</a></li>
+
+<li><a href="/Status" class="navlink">Open Source Software</a></li>
+
+<li><a href="/QA/" class="navlink">Q&amp;A Blog</a></li>
+
+<li><a href="/Consortium/Recruitment/" class="navlink">Employment</a></li>
+
+<li><span class="navText">More ways to</span> <a href="/Consortium/org#public" class="navlink">participate</a></li>
+</ul>
+
+<h2 class="navhead">Introduction</h2>
+
+<ul>
+<li><a href="/Consortium/" class="navlink">About W3C</a></li>
+
+<li><a href="/Consortium/faq" class="navlink">Frequently Asked
+Questions (FAQ)</a></li>
+
+<li><a href="/2003/glossary/" class="navlink">Glossary</a></li>
+
+<li><a href="/Consortium/Process/" class="navlink">Process
+Document</a></li>
+
+<li><a href="/2002/03/tutorials" class="navlink">Tutorials</a></li>
+
+<li><a href="/2002/03/new-to-w3c" class="navlink">More...</a></li>
+</ul>
+
+<h2 class="navhead">W3C Team</h2>
+
+<ul>
+<li><a href="/People/" class="navlink">People</a></li>
+
+<li><a href="/TeamSubmission/" class="navlink">Team
+Submissions</a></li>
+</ul>
+
+<h2 class="navhead">Presentations</h2>
+
+<ul>
+<li><a href="/Talks/" class="navlink">Public Presentations</a></li>
+</ul>
+
+<h2 class="navhead">News Room</h2>
+
+<ul>
+<li><a href="/News/" class="navlink">W3C News Archive</a> <span class="navText">(</span><a href="/2000/08/w3c-synd/home.rss" class="navlink">RSS</a><span class="navText">)</span></li>
+
+<li><a href="/News/Public/" class="navlink">Weekly Public Newsletter</a></li>
+
+<li><a href="/Press/" class="navlink">Press Releases</a></li>
+
+<li><a href="/Press/#rss" class="navlink">Multilingual Press Release
+RSS</a></li>
+
+<li><a href="/Press/Articles" class="navlink">W3C in the Press</a></li>
+</ul>
+
+<h2 class="navhead"><a name="Offices" id="Offices">World
+Offices</a></h2>
+
+<p class="navPara">The <a href="/Consortium/Offices/" class="navlink">W3C Offices</a>, part of the <a href="/2007/IntlRel.html">W3C
+International Relations team</a> translate many W3C home page news
+items. W3C Offices are located in these parts of the world:</p>
+
+<ul>
+<li><a href="http://www.w3c.org.au/" class="navlink" title="Australia">Australia</a></li>
+
+<li><a href="http://www.w3c.nl/index.shtml.nl" class="navlink" hreflang="nl" title="Benelux"><span xml:lang="nl" lang="nl">Benelux</span></a>/<a href="http://www.w3c.nl/index.shtml.fr" class="navlink" title="Benelux" hreflang="fr"><span xml:lang="fr" lang="fr">Bénélux</span></a></li>
+
+<li><a href="http://www.w3c.br/" class="navlink" title="Brazil" hreflang="pt-br"><span xml:lang="pt-br" lang="pt-br">Brasil</span>
+(Brazil)</a></li>
+
+<li><a href="http://www.chinaw3c.org/" class="navlink" title="China" hreflang="zh-hans"><span xml:lang="zh-hans" lang="zh-hans">中国</span>
+(China)</a></li>
+
+<li><a href="http://www.w3c.tut.fi/" class="navlink" title="Finland" hreflang="fi"><span xml:lang="fi" lang="fi">Suomi</span>
+(Finland)</a></li>
+
+<li><a href="http://www.w3c.de/" class="navlink" title="German and Austria" hreflang="de"><span xml:lang="de" lang="de">Deutschland und Österreich</span> (Germany and Austria)</a></li>
+
+<li><a href="http://www.w3c.gr/" class="navlink" title="Greece" hreflang="el"><span xml:lang="el" lang="el">Ελλάδα</span>
+(Greece)</a></li>
+
+<li><a href="http://www.w3c.hu/" class="navlink" title="Hungary" hreflang="hu"><span xml:lang="hu" lang="hu">Magyarország</span>
+(Hungary)</a></li>
+
+<li><a href="http://www.w3cindia.in/" class="navlink" title="India" hreflang="en"><span xml:lang="hi" lang="hi">भारत</span>
+(India)</a></li>
+
+<li><a href="http://www.w3c.org.il/" class="navlink" title="Israel" hreflang="he"><span xml:lang="he" lang="he">ישראל</span>
+(Israel)</a></li>
+
+<li><a href="http://www.w3c.it/" class="navlink" title="Italy" hreflang="it"><span xml:lang="it" lang="it">Italia</span>
+(Italy)</a></li>
+
+<li><a href="http://www.w3c.or.kr/" class="navlink" title="Korea" hreflang="ko"><span xml:lang="ko" lang="ko">한국</span> (Korea)</a></li>
+
+<li><a href="http://www.w3c.org.ma/" class="navlink" title="Morocco" hreflang="ar"><span xml:lang="ar" lang="ar">المغرب</span>
+(Morocco)</a></li>
+
+<li><a href="http://www.w3c.org.za/" class="navlink" title="Southern Africa" hreflang="en">Southern Africa</a></li>
+
+<li><a href="http://www.w3c.es/" class="navlink" title="Spain" hreflang="es"><span xml:lang="es" lang="es">España</span>
+(Spain)</a></li>
+
+<li><a href="http://www.w3c.se" class="navlink" title="Sweden" hreflang="sv"><span xml:lang="sv" lang="sv">Sverige</span>
+(Sweden)</a></li>
+
+<li><a href="http://www.w3c.rl.ac.uk/" class="navlink" title="UK and Ireland" hreflang="en-uk">United Kingdom and Ireland</a></li>
+</ul>
+
+<h2 class="navhead"><a name="systems" id="systems">Systems</a></h2>
+
+<ul>
+<li><a href="/Help/Account/" class="navlink">Get Password</a></li>
+
+<li><a href="/2003/08/system-status" class="navlink">System
+Status</a></li>
+</ul>
+</div>
+<hr class="hide" />
+
+<p class="small">W3C would like to thank the <a name="donors" id="donors" href="/Consortium/sup">Supporters</a> who have contributed
+financially or through a donation of goods to W3C.</p>
+
+<p class="small"><a name="footnotes" id="footnotes">Read</a> <a href="/2002/11/homepage">about the layout</a> and <a href="http://lists.w3.org/Archives/Public/site-comments/">send comments</a>
+about this page. <a href="/2000/08/w3c-synd/home.rss">Syndicate</a>
+this page with <a href="http://purl.org/rss/1.0/">RSS 1.0</a>, an
+<a href="/RDF/">RDF</a> vocabulary used for <a href="/2000/08/w3c-synd/#">site summaries</a>. </p>
+
+<address class="small">
+<a href="/Help/Webmaster">Webmaster</a> · Last modified:
+ $Date: 2008/06/05 17:06:19 $
+ <span class="whiteout">|</span><br />
+<a href="http://validator.w3.org/check?uri=referer"><img src="/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a> <span class="whiteout">|</span> <a href="http://jigsaw.w3.org/css-validator/"><img src="/Icons/valid-css" alt="Valid CSS!" height="31" width="88" /></a> <span class="whiteout">|</span> <a href="/WAI/WCAG1AA-Conformance" title="Explanation of Level Double-A Conformance"><img class="conform" height="31" width="88" src="/WAI/wcag1AA" alt="Level Double-A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0" />
+</a> <span class="whiteout">|</span>
+</address>
+
+<p class="copyright"><a rel="Copyright" href="/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1994-2007
+<a href="/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>, <a href="http://www.ercim.org/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>,
+<a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C
+<a href="/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
+<a href="/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>,
+<a rel="Copyright" href="/Consortium/Legal/copyright-documents">document use</a> and <a rel="Copyright" href="/Consortium/Legal/copyright-software">software
+licensing</a> rules apply. Your interactions with this site are in
+accordance with our <a href="/Consortium/Legal/privacy-statement#Public">public</a> and <a href="/Consortium/Legal/privacy-statement#Members">Member</a> privacy
+statements.</p>
+</body>
+</html>
diff --git a/examples/xml/htmlinfo/youtube_com.html b/examples/xml/htmlinfo/youtube_com.html
new file mode 100644
index 0000000000..1de65a3aa5
--- /dev/null
+++ b/examples/xml/htmlinfo/youtube_com.html
@@ -0,0 +1,1585 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
+
+
+ <html lang="en">
+
+<!-- machid: 519 -->
+<head>
+
+ <title>YouTube - Broadcast Yourself.</title>
+
+ <link rel="stylesheet" href="http://s.ytimg.com/yt/css/base_all-vfl42327.css" type="text/css">
+
+ <link rel="search" type="application/opensearchdescription+xml" href="/opensearch?locale=en_US" title="YouTube Video Search">
+ <link rel="icon" href="http://s.ytimg.com/yt/favicon-vfl1123.ico" type="image/x-icon">
+ <link rel="shortcut icon" href="http://s.ytimg.com/yt/favicon-vfl1123.ico" type="image/x-icon">
+
+
+ <meta name="description" content="Share your videos with friends and family">
+ <meta name="keywords" content="video,sharing,camera phone,video phone,free">
+
+ <link rel="alternate" type="application/rss+xml" title="YouTube - [RSS]" href="/rssls">
+
+ <link rel="alternate" media="handheld" href="http://m.youtube.com/index?desktop_uri=%2F&">
+
+ <script type="text/javascript">
+ window.google={kHL:"en"};
+ </script>
+
+ <script type="text/javascript" src="http://s.ytimg.com/yt/js/base_all_with_bidi-vfl42302.js"></script>
+
+ <script type="text/javascript">
+
+ function _hbLink (a,b) { return false; }
+ function urchinTracker (a,b) { }
+
+
+ var gXSRF_token = '';
+ var gXSRF_field_name = '';
+ var gXSRF_ql_pair = '';
+
+ gXSRF_token = 'fZg-xPKpfj11aUrz_5__moOGiAp8MTIxMjg1OTQ4OA==';
+ gXSRF_field_name = 'session_token';
+ onLoadFunctionList.push(populate_session_token);
+
+ gXSRF_ql_pair = 'session_token=kVjpl8qnfp7RPuqnTrIu6Q8BT5d8MA==';
+
+
+ var gQuickListTooltipText = 'Add Video to QuickList';
+ var gPartnerVideoText = 'Partner Video';
+ var gGoogleSuggest = true;
+ var gPixelGif = 'http://s.ytimg.com/yt/img/pixel-vfl73.gif';
+
+ var gInQuickListText = 'in <a href="/watch_queue?all">QuickList</a>';
+ var gIsResultsPage = false;
+ </script>
+
+
+
+<script type="text/javascript">
+
+function swapVideoList(linkObj)
+{
+ var linkId = linkObj.id;
+ var queryData = '';
+ var newDivId = '';
+ var headlineObj = document.getElementById('hpVideoListHead');
+ var moreLinkObj = document.getElementById('homepage-featured-more-top');
+ var bottomMoreLinkObj = document.getElementById('homepage-featured-more-bottom');
+
+ if (linkId == 'hpMostViewedLink') {
+ queryData = 'videoListType=mostViewed';
+ newDivId = 'hpMostViewed';
+ headlineObj.innerHTML = "Most Viewed Videos";
+ moreLinkObj.innerHTML = "<a href=\"/browse?s=mp\">See More Most Viewed Videos</a>";
+ bottomMoreLinkObj.innerHTML = "<a href=\"/browse?s=mp\">See More Most Viewed Videos</a>";
+ }
+ else if (linkId == 'hpMostDiscussedLink') {
+ queryData = 'videoListType=mostDiscussed';
+ newDivId = 'hpMostDiscussed';
+ headlineObj.innerHTML = "Most Discussed Videos";
+ moreLinkObj.innerHTML = "<a href=\"/browse?s=md\">See More Most Discussed Videos</a>";
+ bottomMoreLinkObj.innerHTML = "<a href=\"/browse?s=md\">See More Most Discussed Videos</a>";
+ }
+ else if (linkId == 'hpTopFavoritesLink') {
+ queryData = 'videoListType=topFavorites';
+ newDivId = 'hpTopFavorites';
+ headlineObj.innerHTML = "Top Favorites";
+ moreLinkObj.innerHTML = "<a href=\"/browse?s=mf\">See More Top Favorites</a>";
+ bottomMoreLinkObj.innerHTML = "<a href=\"/browse?s=mf\">See More Top Favorites</a>";
+ }
+ else if (linkId == 'hpFeaturedLink') {
+ newDivId = 'hpFeatured';
+ headlineObj.innerHTML = "Featured Videos";
+ moreLinkObj.innerHTML = "<a href=\"/browse?s=rf\">See More Featured Videos</a>";
+ bottomMoreLinkObj.innerHTML = "<a href=\"/browse?s=rf\">See More Featured Videos</a>";
+ }
+ self.containerDiv = 'homepage-video-list'
+ self.fillDiv = fillDiv
+ self.linkId = linkId
+ self.newDivId = newDivId
+ addClass(_gel(newDivId + 'Link'), 'hilite');
+ if (newDivId != 'hpMostViewed') {
+ removeClass(_gel('hpMostViewedLink'), 'hilite');
+ }
+ if (newDivId != 'hpMostDiscussed') {
+ removeClass(_gel('hpMostDiscussedLink'), 'hilite');
+ }
+ if (newDivId != 'hpTopFavorites') {
+ removeClass(_gel('hpTopFavoritesLink'), 'hilite');
+ }
+ if (newDivId != 'hpFeatured') {
+ removeClass(_gel('hpFeaturedLink'), 'hilite');
+ }
+ if (document.getElementById(newDivId))
+ {
+ document.getElementById(newDivId).style.display = 'block';
+ if (newDivId != 'hpMostViewed' && document.getElementById('hpMostViewed')) document.getElementById('hpMostViewed').style.display = 'none';
+ if (newDivId != 'hpMostDiscussed' && document.getElementById('hpMostDiscussed')) document.getElementById('hpMostDiscussed').style.display = 'none';
+ if (newDivId != 'hpTopFavorites' && document.getElementById('hpTopFavorites')) document.getElementById('hpTopFavorites').style.display = 'none';
+ if (newDivId != 'hpFeatured' && document.getElementById('hpFeatured')) document.getElementById('hpFeatured').style.display = 'none';
+ }
+ else if (queryData != '') {
+ postUrlXMLResponse('/ajax_video_list',queryData,self.fillDiv);
+ }
+}
+function fillDiv(req)
+{
+ if (document.getElementById('hpMostViewed')) document.getElementById('hpMostViewed').style.display = 'none';
+ if (document.getElementById('hpMostDiscussed')) document.getElementById('hpMostDiscussed').style.display = 'none';
+ if (document.getElementById('hpTopFavorites')) document.getElementById('hpTopFavorites').style.display = 'none';
+ if (document.getElementById('hpFeatured')) document.getElementById('hpFeatured').style.display = 'none';
+ var newContent = getNodeValue(req.responseXML, "html_content");
+ var newdiv = document.createElement('div');
+ newdiv.setAttribute("id",self.newDivId);
+ newdiv.innerHTML = newContent;
+ var container = document.getElementById(self.containerDiv);
+ container.appendChild(newdiv);
+ addQLIcons(container);
+}
+
+function hide_active_sharing() {
+ hideDiv("active_sharing_div");
+}
+</script>
+
+</head>
+
+
+<body onload="performOnLoadFunctions();" class="en_US is-english">
+
+<div id="baseDiv" class="date-20080606">
+
+ <div id="masthead">
+ <a href="/" class="logo"><img src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" width="132" height="63" border="0" alt=""/></a>
+ <div class="user-info">
+
+ <div id="loginBoxZ">
+ <div class="contentBox">
+ <div>
+ <div id="loginBoxZ-signup">
+ <a href="/signup">Sign Up</a>
+ | <a href="http://help.youtube.com/support/youtube/bin/topic.py?topic=10546&amp;hl=en_US">Help</a>
+ </div>
+ <div id="loginBoxZ-login">
+ Login
+ </div>
+ <div class="clear"></div>
+ </div>
+
+ <form method="post" name="loginForm" id="loginFormZ" action="/signup">
+ <input type="hidden" name="next" value="/" id="loginNextZ"/>
+ <input type="hidden" name="current_form" value="loginForm" />
+ <input type="hidden" name="action_login" value="1">
+ <div id="loginBoxZ-container">
+ <div id="loginBoxZ-labels" class="floatL">
+ <label for="loginUserZ" class="nowrap">Username:</label>
+ <label for="loginPassZ" class="nowrap">Password:</label>
+ </div>
+ <div class="floatL">
+ <input id="loginUserZ" class="loginBoxZ-input" type="text" size="16" name="username" value=""><br/>
+ <input id="loginPassZ" class="loginBoxZ-input" type="password" size="16" name="password"><br/>
+ <input type="submit" class="smallText" value="Login">
+ </div>
+ <div class="clearL"></div>
+ </div>
+ </form>
+ <div id="loginBoxZ-forgot">
+ <a href="/forgot_username?next=/">Forgot Username</a>
+ | <wbr><nobr><a href="/forgot?next=/">Forgot Password</a></nobr>
+ </div>
+ <div id="loginBoxZ-gaia">
+ <a href="https://www.google.com/accounts/ServiceLogin?service=youtube&amp;hl=en_US&amp;continue=http%3A//www.youtube.com/signup%3Fhl%3Den_US&amp;passive=true">Login with your Google account</a>&nbsp;
+ <a href="#" onClick="window.open('/t/help_gaia','login_help','width=580,height=480,resizable=yes,scrollbars=yes,status=0').focus();" rel="nofollow"><img src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" border="0" class="alignMid gaiaHelpBtn" alt=""></a>
+ </div>
+ </div>
+ </div>
+
+ <div id="localePickerBox">
+ <div id="flagDiv">
+ <script type="text/javascript">
+ var gLocales = [
+ ['ru_RU','&#x420;&#x43E;&#x441;&#x441;&#x438;&#x44F;'] , ['zh_TW','&#x53F0;&#x7063;'] , ['ja_JP','&#x65E5;&#x672C;'] , ['zh_HK','&#x9999;&#x6E2F;'] , ['ko_KR','&#xD55C;&#xAD6D;'] , ['en_AU','Australia'] , ['pt_BR','Brasil'] , ['en_CA','Canada'] , ['de_DE','Deutschland'] , ['es_ES','Espa&#xF1;a'] , ['fr_FR','France'] , ['en_US','Global'] , ['en_IN','India'] , ['en_IE','Ireland'] , ['it_IT','Italia'] , ['es_MX','M&#xE9;xico'] , ['nl_NL','Nederland'] , ['en_NZ','New Zealand'] , ['pl_PL','Polska'] , ['en_GB','United Kingdom']
+ ];
+ </script>
+ <div id="flagDivInner">
+ </div>
+
+ <div class="alignR smallText"><a href="#" onclick="closeLocalePicker(); return false;">Close</a></div>
+ </div>
+ </div>
+
+
+
+
+
+
+ <div id="util-links" class="normal-utility-links">
+
+ <span class="util-item first"><b><a href="/signup" onclick="_hbLink('SignUp','UtilityLinks');">Sign Up</a></b></span>
+ <span class="util-item"><a href="/watch_queue?all">QuickList</a> (<span id="quicklist-utility">0</span>)</span>
+ <span class="util-item"><a href="http://help.youtube.com/support/youtube/bin/static.py?page=start.cs&amp;hl=en_US">Help</a></span>
+ <span class="util-item"><a href="#" class="loginBoxZ eLink" onclick="return openLoginBox(event);">Log In</a></span>
+ <span class="util-item"><a href="#" class="localePickerLink eLink" onclick="loadFlagImgs();toggleDisplay('localePickerBox');return false;">Site:</a></span>
+ <span class="util-item first">&nbsp;<a href="#" class="localePickerLink" onclick="loadFlagImgs();toggleDisplay('localePickerBox');return false;"><img src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" class="currentFlag globalFlag" alt="Site:"></a></span>
+ </div>
+
+ <form name="logoutForm" method="post" target="_top" action="/index">
+ <input type="hidden" name="action_logout" value="1">
+ </form>
+
+
+ </div>
+ <div class="nav">
+ <div class="nav-item first selected" id="nav-item-home">
+ <span class="leftcap"></span>
+ <a class="content" href="/">Home</a>
+ <span class="rightcap"></span>
+ </div>
+ <div class="nav-item" id="nav-item-videos">
+ <div class="nav-tab">
+ <span class="leftcap"></span>
+ <a class="content" href="/browse?s=mp">Videos</a>
+ <span class="rightcap"></span>
+ </div>
+ </div>
+ <div class="nav-item" id="nav-item-channels">
+ <div class="nav-tab">
+ <span class="leftcap"></span>
+ <a class="content" href="/members">Channels</a>
+ <span class="rightcap"></span>
+ </div>
+ </div>
+ <div class="nav-item" id="nav-item-community">
+ <div class="nav-tab">
+ <span class="leftcap"></span>
+ <a class="content" href="/community">Community</a>
+ <span class="rightcap"></span>
+ </div>
+ </div>
+ </div>
+
+ <form autocomplete="off" action="/results" method="get" name="searchForm" onsubmit="return submitRegularSearchRequest()">
+
+ <div class="bar">
+ <span class="leftcap"></span>
+ <div class="search-bar">
+ <a href="/my_videos_upload" id="upload-button" class="action-button">
+ <span class="action-button-leftcap"></span>
+ <span class="action-button-text">Upload</span>
+ <span class="action-button-rightcap"></span>
+ </a>
+ <div id="search-form">
+ <input id="search-term" name="search_query" type="text" tabindex="1" onkeyup="goog.i18n.bidi.setDirAttribute(event,this)" value="" maxlength="128" />
+ <select class="search-type" name="search_type">
+ <option value="">Videos</option>
+ <option value="search_users" >Channels</option>
+ </select>
+ <input id="search-button" type="submit" value="Search" />
+ </div>
+ <div class="search-settings-link">
+ <a href="#" class="eLink" onClick="return toggleAdvSearch('', '', '', '', '', '')">
+ advanced
+ </a></div>
+ </div>
+ <span class="rightcap"></span>
+ </div>
+
+ </form>
+
+ <div id="search-advanced-form" class="hid">
+ <div class="search-setting-inner alignC">Loading...</div>
+ </div>
+
+ <div class="clear"></div>
+ </div>
+ <div id="search-settings-clr" class="hid"></div>
+
+
+
+
+
+
+<div id="homepage-main-content">
+ <div>
+ <div id="active_sharing_div" name="active_sharing_div" style="display:block"></div>
+ <script type="text/javascript">
+ // <![CDATA[
+ var fo = new SWFObject("active_sharing.swf", "active_sharing", "550", "115", 7, "#FFFFFF");
+ var showstr = "Videos being watched right now...";
+ fo.addParam('wmode', 'opaque');
+ fo.addVariable("t", showstr);
+ fo.write("active_sharing_div");
+ // ]]>
+ </script>
+</div>
+
+ <div class="homepage-content-block" style="margin-left:18px; border:0px #CCC solid;">
+ <div class="homepage-block-heading homepage-block-heading-gray">Promoted Videos</div>
+ <div>
+ <div class="homepage-sponsored-video marB0">
+ <div class="videoIconWrapperOuter">
+ <div class="videoIconWrapperInner">
+ <div class="vstill"><a href="/cthru?key=YSqt3w6VDhuNgxUzVZsryt0JX30ll7tCIrBT--_pvAtRC3KmvsBYFaUNR1qT0d0BnBJYjHz_G7LIr21ufG7W6gJL7zPdHNbcmuIxaafL1yry8cdcqeEOTitWLXkpm2q2QnTAlp4chC1jus7JLVCnCdacl0xUeDk4Vk8e6q9htmGbDZPN9QMnHsrX2RZnvDMx-3Im14C3GKi4jI8ee-jnOQ==" name="&lid=DV+-+BasiaBulatInTheNight+-+beggars&lpos=hp-s0"><img src="http://i.ytimg.com/vi/CebHAvPHyyU/default.jpg" class="vimg120"></a></div>
+ </div>
+ </div>
+
+ <div class="vtitle smallText">
+ <a href="/cthru?key=YSqt3w6VDhuNgxUzVZsryt0JX30ll7tCIrBT--_pvAtRC3KmvsBYFaUNR1qT0d0BnBJYjHz_G7LIr21ufG7W6gJL7zPdHNbcmuIxaafL1yry8cdcqeEOTitWLXkpm2q2QnTAlp4chC1jus7JLVCnCdacl0xUeDk4Vk8e6q9htmGbDZPN9QMnHsrX2RZnvDMx-3Im14C3GKi4jI8ee-jnOQ==" name="&lid=DV+-+BasiaBulatInTheNight+-+beggars&lpos=hp-s0">Basia Bulat - In Th...</a>
+ </div>
+ <div class="vfacets" style="margin-bottom: 0px;">
+ <a href="/user/beggars" class="dg">beggars</a>
+ </div>
+ </div>
+ <div class="homepage-sponsored-video marB0">
+ <div class="videoIconWrapperOuter">
+ <div class="videoIconWrapperInner">
+ <div class="vstill"><a href="/cthru?key=FIUXMxdvOKhDw2_wpR7bE9L-XUsHMZBHRpS_s21B0Kq0RTWlGXSqQ8bjw6tBQOUczUtO8b6_mktukdd5ChseYAl10dE5JQrlpiOQE6HNMOAsszaA0M9qhzFnOkWPrkFGMDW5vvaAOkIwas6ksi4e_R8wkiIhlNYPDiqi2f4LpVzB2jpe0LobjIEF9czWjFx9ymrPg8wx2x6w00jF-BzRfQ==" name="&lid=DV+-+Perfection+-+corporalcadet&lpos=hp-s1"><img src="http://i.ytimg.com/vi/Np4bhsmr3iE/default.jpg" class="vimg120"></a></div>
+ </div>
+ </div>
+
+ <div class="vtitle smallText">
+ <a href="/cthru?key=FIUXMxdvOKhDw2_wpR7bE9L-XUsHMZBHRpS_s21B0Kq0RTWlGXSqQ8bjw6tBQOUczUtO8b6_mktukdd5ChseYAl10dE5JQrlpiOQE6HNMOAsszaA0M9qhzFnOkWPrkFGMDW5vvaAOkIwas6ksi4e_R8wkiIhlNYPDiqi2f4LpVzB2jpe0LobjIEF9czWjFx9ymrPg8wx2x6w00jF-BzRfQ==" name="&lid=DV+-+Perfection+-+corporalcadet&lpos=hp-s1">Perfection</a>
+ </div>
+ <div class="vfacets" style="margin-bottom: 0px;">
+ <a href="/user/corporalcadet" class="dg">corporalcadet</a>
+ </div>
+ </div>
+ <div class="homepage-sponsored-video marB0">
+ <div class="videoIconWrapperOuter">
+ <div class="videoIconWrapperInner">
+ <div class="vstill"><a href="/cthru?key=1W2J508g9g7Bjsvodsvq3GHZo25JkqX7Js5JSHnyP1yZYB96KDh2LTC2pCKjeHc7LEiTUU4uhuwsrTzZfns_IR2dsA7leCUYMtvgq3noBHy-G0jTHmgiQtFUVTDU3jT2EkS39J6Ur2qxtHwAmybMcU83hK1guqpPdryKOfcbHovo-Kbwglzbbl28LrK1iNdz5E6NZ5CZCVZrYxldbWyjEA==" name="&lid=DV+-+WhatmatterstoyoumeVFS+-+Jr0canest&lpos=hp-s2"><img src="http://i.ytimg.com/vi/KExoP97KUnY/default.jpg" class="vimg120"></a></div>
+ </div>
+ </div>
+
+ <div class="vtitle smallText">
+ <a href="/cthru?key=1W2J508g9g7Bjsvodsvq3GHZo25JkqX7Js5JSHnyP1yZYB96KDh2LTC2pCKjeHc7LEiTUU4uhuwsrTzZfns_IR2dsA7leCUYMtvgq3noBHy-G0jTHmgiQtFUVTDU3jT2EkS39J6Ur2qxtHwAmybMcU83hK1guqpPdryKOfcbHovo-Kbwglzbbl28LrK1iNdz5E6NZ5CZCVZrYxldbWyjEA==" name="&lid=DV+-+WhatmatterstoyoumeVFS+-+Jr0canest&lpos=hp-s2">What matters to you...</a>
+ </div>
+ <div class="vfacets" style="margin-bottom: 0px;">
+ <a href="/user/Jr0canest" class="dg">Jr0canest</a>
+ </div>
+ </div>
+ <div class="homepage-sponsored-video marB0">
+ <div class="videoIconWrapperOuter">
+ <div class="videoIconWrapperInner">
+ <div class="vstill"><a href="/cthru?key=idL1slcMKbuzX2MFZaS-nifq5PWrCKLUZMXEPqCthRVET6PQSkxlmKQVMNmQvlYpQlFISkRprfO113rH-ER0ytYh0zSMWI4XbaO74zcrIZiSpB3oISku9zIGUwS5WI03Y0ZiHbGAC9GIYziEcRcgzcEYuizlUwNvTWDgNSvrCJHcyPYokMUjLjcwqD2wEEAe7jfIfcJRNl3sW7ODuiN_MA==" name="&lid=DV+-+LIfeisaMasquerade+-+bananaruthy&lpos=hp-s3"><img src="http://i.ytimg.com/vi/l9gjk5hHiGM/default.jpg" class="vimg120"></a></div>
+ </div>
+ </div>
+
+ <div class="vtitle smallText">
+ <a href="/cthru?key=idL1slcMKbuzX2MFZaS-nifq5PWrCKLUZMXEPqCthRVET6PQSkxlmKQVMNmQvlYpQlFISkRprfO113rH-ER0ytYh0zSMWI4XbaO74zcrIZiSpB3oISku9zIGUwS5WI03Y0ZiHbGAC9GIYziEcRcgzcEYuizlUwNvTWDgNSvrCJHcyPYokMUjLjcwqD2wEEAe7jfIfcJRNl3sW7ODuiN_MA==" name="&lid=DV+-+LIfeisaMasquerade+-+bananaruthy&lpos=hp-s3">LIfe is a Masquerade.</a>
+ </div>
+ <div class="vfacets" style="margin-bottom: 0px;">
+ <a href="/user/bananaruthy" class="dg">bananaruthy</a>
+ </div>
+ </div>
+ <div class="clearL" style="height: 1px;"></div>
+ </div>
+ </div>
+
+
+ <div id="homepage-featured-heading">
+ <div id="homepage-featured-more-top"><a id="hpVideoListMoreLink" href="/browse?s=rf">See More Featured Videos</a></div>
+ <h1 id="hpVideoListHead">Featured Videos</h1>
+ </div>
+
+ <div id="homepage-featured-tabs">
+ <a href="#" id="hpTopFavoritesLink" name="&lid=hpTopFavoritesTab&lpos=hpTabs" onclick="swapVideoList(this); return false;">Top Favorites</a>
+ <a href="#" id="hpMostDiscussedLink" name="&lid=hpMostDiscussedTab&lpos=hpTabs" onclick="swapVideoList(this); return false;">Most Discussed</a>
+ <a href="#" id="hpMostViewedLink" name="&lid=hpMostViewedTab&lpos=hpTabs" onclick="swapVideoList(this); return false;">Most Viewed</a>
+ <a href="#" id="hpFeaturedLink" name="&lid=hpFeaturedTab&lpos=hpTabs" onclick="swapVideoList(this); return false;" class="first hilite">Featured</a>
+ <div class="clear"></div>
+ </div>
+
+
+
+ <div id="homepage-video-list" class="browseListView">
+ <div id="hpFeatured">
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=uu-NTSZ27b0"><img src="http://i.ytimg.com/vi/uu-NTSZ27b0/default.jpg" class="vimg120" title="Caribbean PVC Marimba Children's Orchestra" qliconalt="uu-NTSZ27b0" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=uu-NTSZ27b0" title="Caribbean PVC Marimba Children's Orchestra" onclick="_hbLink('CaribbeanPVCMarimbaChildrensOrchestra','VidVert');">Caribbean PVC Marimba Children's...</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=uu-NTSZ27b0" title="Caribbean PVC Marimba Children's Orchestra" onclick="_hbLink('CaribbeanPVCMarimbaChildrensOrchestra','VidVert');">Caribbean PVC Marimba Children's Orchestra</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescuuNTSZ27b0">
+ Michael Greiner who is a neighbor and good friend of mine asked me to upload several Marim
+ </span>
+
+ <span id="RemainvidDescuuNTSZ27b0" style="display: none">Michael Greiner who is a neighbor and good friend of mine asked me to upload several Marimba videos for him (that's him on the left in the middle row). He currently teaches the music program at Aveson Charter School http://aveson.org/ and constructs musical instruments in classes with students' participation.<br/><br/>Michael Greiner created this set of plastic pipe marimbas. On this clip are three generations of prototypes designed to be low cost for use by childrens' programming. The top one bass version costs around $200 in materials. The mallets are home made using foam flip-flops mounted to sticks. Filmed at Norma Coombs primary school in Altadena CA in 2007.<br/><br/>*** Edited to Add ****<br/>Wow, it looks like this video's hit YouTube's front page. Thank you for all the wonderfully kind and supportive comments!</span>
+ <span id="MorevidDescuuNTSZ27b0" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescuuNTSZ27b0'); hideDiv('MorevidDescuuNTSZ27b0'); hideDiv('BeginvidDescuuNTSZ27b0'); showDiv('LessvidDescuuNTSZ27b0'); return false;">more</a>)</span>
+ <span id="LessvidDescuuNTSZ27b0" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescuuNTSZ27b0'); hideDiv('LessvidDescuuNTSZ27b0'); showDiv('BeginvidDescuuNTSZ27b0'); showDiv('MorevidDescuuNTSZ27b0'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/PlayHanghang">PlayHanghang</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 3,853<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-5.0" alt="4.84814814815" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">01:46</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=24">Entertainment</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=CFJRn7akXeQ"><img src="http://i.ytimg.com/vi/CFJRn7akXeQ/default.jpg" class="vimg120" title="&quot;Sharp Teeth&quot; Excerpt #1" qliconalt="CFJRn7akXeQ" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=CFJRn7akXeQ" title="&quot;Sharp Teeth&quot; Excerpt #1" onclick="_hbLink('SharpTeethExcerpt1','VidVert');">&quot;Sharp Teeth&quot; Excerpt #1</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=CFJRn7akXeQ" title="&quot;Sharp Teeth&quot; Excerpt #1" onclick="_hbLink('SharpTeethExcerpt1','VidVert');">&quot;Sharp Teeth&quot; Excerpt #1</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescCFJRn7akXeQ">
+ Check out the book "Sharp Teeth" on Amazon:<br/>http://www.amazon.com/Sharp-Teeth-Toby-Barlow
+ </span>
+
+ <span id="RemainvidDescCFJRn7akXeQ" style="display: none">Check out the book "Sharp Teeth" on Amazon:<br/>http://www.amazon.com/Sharp-Teeth-Toby-Barlow/dp/0061430226/ ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1212767529&sr=8-1<br/><br/>Animation directed by Limbert Fabian. Produced by Matt Thunell. For more information go to sharpteeththebook.com</span>
+ <span id="MorevidDescCFJRn7akXeQ" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescCFJRn7akXeQ'); hideDiv('MorevidDescCFJRn7akXeQ'); hideDiv('BeginvidDescCFJRn7akXeQ'); showDiv('LessvidDescCFJRn7akXeQ'); return false;">more</a>)</span>
+ <span id="LessvidDescCFJRn7akXeQ" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescCFJRn7akXeQ'); hideDiv('LessvidDescCFJRn7akXeQ'); showDiv('BeginvidDescCFJRn7akXeQ'); showDiv('MorevidDescCFJRn7akXeQ'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/tobybarlowny">tobybarlowny</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 67,438<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.39928057554" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">01:33</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=1">Film & Animation</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=sNROaXA6OSI"><img src="http://i.ytimg.com/vi/sNROaXA6OSI/default.jpg" class="vimg120" title="Touring to Alaska on Vegetable Oil!" qliconalt="sNROaXA6OSI" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=sNROaXA6OSI" title="Touring to Alaska on Vegetable Oil!" onclick="_hbLink('TouringtoAlaskaonVegetableOil','VidVert');">Touring to Alaska on Vegetable Oil!</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=sNROaXA6OSI" title="Touring to Alaska on Vegetable Oil!" onclick="_hbLink('TouringtoAlaskaonVegetableOil','VidVert');">Touring to Alaska on Vegetable Oil!</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescsNROaXA6OSI">
+ This video is for Mrs. Aderman's 1st Period Environmental Science Class.<br/><br/>We are Mose Gi
+ </span>
+
+ <span id="RemainvidDescsNROaXA6OSI" style="display: none">This video is for Mrs. Aderman's 1st Period Environmental Science Class.<br/><br/>We are Mose Giganticus and The Emotron and this year we are touring to Alaska on Vegetable Oil.</span>
+ <span id="MorevidDescsNROaXA6OSI" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescsNROaXA6OSI'); hideDiv('MorevidDescsNROaXA6OSI'); hideDiv('BeginvidDescsNROaXA6OSI'); showDiv('LessvidDescsNROaXA6OSI'); return false;">more</a>)</span>
+ <span id="LessvidDescsNROaXA6OSI" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescsNROaXA6OSI'); hideDiv('LessvidDescsNROaXA6OSI'); showDiv('BeginvidDescsNROaXA6OSI'); showDiv('MorevidDescsNROaXA6OSI'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/kylemotron">kylemotron</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 122,748<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.44329896907" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">04:02</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=27">Education</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=6iC3b5JnSIE"><img src="http://i.ytimg.com/vi/6iC3b5JnSIE/default.jpg" class="vimg120" title="JCJC" qliconalt="6iC3b5JnSIE" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=6iC3b5JnSIE" title="JCJC" onclick="_hbLink('JCJC','VidVert');">JCJC</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=6iC3b5JnSIE" title="JCJC" onclick="_hbLink('JCJC','VidVert');">JCJC</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDesc6iC3b5JnSIE">
+ His name is Okotanpe. <br/>His mail addless is fuseloopa@hotmail.com <br/><br/>The name of this son
+ </span>
+
+ <span id="RemainvidDesc6iC3b5JnSIE" style="display: none">His name is Okotanpe. <br/>His mail addless is fuseloopa@hotmail.com <br/><br/>The name of this song is 300ml(milk).<br/>An artist name is Rei harakami. <br/>Check it out!</span>
+ <span id="MorevidDesc6iC3b5JnSIE" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDesc6iC3b5JnSIE'); hideDiv('MorevidDesc6iC3b5JnSIE'); hideDiv('BeginvidDesc6iC3b5JnSIE'); showDiv('LessvidDesc6iC3b5JnSIE'); return false;">more</a>)</span>
+ <span id="LessvidDesc6iC3b5JnSIE" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDesc6iC3b5JnSIE'); hideDiv('LessvidDesc6iC3b5JnSIE'); showDiv('BeginvidDesc6iC3b5JnSIE'); showDiv('MorevidDesc6iC3b5JnSIE'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/YoneyaYu">YoneyaYu</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 532,447<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-5.0" alt="4.83995523223" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">05:26</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=24">Entertainment</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=L9Wu1V1JAHw"><img src="http://i.ytimg.com/vi/L9Wu1V1JAHw/default.jpg" class="vimg120" title="Certainty In Freedom ~ A Song for Burma (Original Song)" qliconalt="L9Wu1V1JAHw" partner="true" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=L9Wu1V1JAHw" title="Certainty In Freedom ~ A Song for Burma (Original Song)" onclick="_hbLink('CertaintyInFreedomASongforBurmaOriginalSong','VidVert');">Certainty In Freedom ~ A Song fo...</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=L9Wu1V1JAHw" title="Certainty In Freedom ~ A Song for Burma (Original Song)" onclick="_hbLink('CertaintyInFreedomASongforBurmaOriginalSong','VidVert');">Certainty In Freedom ~ A Song for Burma (Original Song)</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescL9Wu1V1JAHw">
+ I'm not a particularly political person, by which I mean I'd sooner just not get involved
+ </span>
+
+ <span id="RemainvidDescL9Wu1V1JAHw" style="display: none">I'm not a particularly political person, by which I mean I'd sooner just not get involved in conflict, but I realise that, at times, things happen outside your control which will you to say something or do something.<br/><br/>I got a comment on my last song from 'gersing' asking me if I'd sing a song for the monks and people of Burma. At first I misunderstood the comment but then it clicked and I felt compelled to offer something.. anything. <br/><br/>I know this song is going to change nothing; and I'm cautious calling it a protest song as I don't understand the situation fully (and I wouldn't want to upset anyone), but this is a tune I wrote in response to being repressed (I'm whatever guise) and how beautiful 'freedom' really is. I don't think anyone will ever understand that term fully but by singing and writing and thinking and speaking we can come somewhere close I'm sure. <br/><br/>As a disclaimer, I'd say that, personally, the chords and melody are arbitrary; merely the carrier of the sentiment...<br/><br/>Changing the subject ever so slightly I just wanted to say a big thank you to everyone that's shown support; it's overwhelming. An apology to anyone I've not yet responded to.. I've never been very good at juggling my time but I will be in touch.<br/><br/>Thanks again...<br/><br/>_________________<br/>Certainty In Freedom<br/><br/>If I had the will to talk<br/>I wonder if you'd give a thought <br/>To what I had to say - help make it go away<br/><br/>Cos there's certainty in freedom<br/>And in that we must believe in<br/>Cos I saw on the news today<br/><br/>If I saw you in the street now<br/>Would I look the other way?<br/>I hope I'm strong enough to say - help make it go away<br/><br/>When all you see is hatred<br/>Spirits crushed and souls deflated<br/>Easy to leave it for another day<br/><br/>Peace is pushing for love<br/>Love is leading the way<br/>You should follow its path<br/>Darkness leads you astray<br/>Peace is pushing for love<br/>Love is leading the way<br/><br/>So this, my only voice to speak<br/>My message strong, my tone is weak<br/>I find it hard to say - help make it go away<br/><br/>And if I come across obtuse<br/>I urge you now to cut the noose<br/>Don't leave it for another day<br/><br/>Peace is pushing for love<br/>Love is leading the way<br/>You should follow its path<br/>Darkness leads you astray<br/>Peace is pushing for love<br/>Love is leading the way<br/><br/>If I had the will to talk<br/>I wonder if you'd give a thought <br/>To what I had to say - help make it go away<br/><br/>Cos there's certainty in freedom<br/>And in that we must believe in<br/>Cos I saw on the news today<br/><br/>Peace is pushing for love<br/>Love is leading the way<br/>You should follow its path<br/>Darkness leads you astray<br/>Peace is pushing for love<br/>Love is leading the way<br/><br/>_____________________<br/>Peace<br/><br/>Available on the 'Unequal Measures', available through http://www.krisrowley.com<br/>© Kris Rowley 2007</span>
+ <span id="MorevidDescL9Wu1V1JAHw" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescL9Wu1V1JAHw'); hideDiv('MorevidDescL9Wu1V1JAHw'); hideDiv('BeginvidDescL9Wu1V1JAHw'); showDiv('LessvidDescL9Wu1V1JAHw'); return false;">more</a>)</span>
+ <span id="LessvidDescL9Wu1V1JAHw" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescL9Wu1V1JAHw'); hideDiv('LessvidDescL9Wu1V1JAHw'); showDiv('BeginvidDescL9Wu1V1JAHw'); showDiv('MorevidDescL9Wu1V1JAHw'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/zzzzzzzzap">zzzzzzzzap</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 136,222<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.65044814341" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">03:55</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=10">Music</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=gQNY7Sti8FY"><img src="http://s4.ytimg.com/vi/gQNY7Sti8FY/default.jpg" class="vimg120" title="the world is at your fingertips" qliconalt="gQNY7Sti8FY" partner="true" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=gQNY7Sti8FY" title="the world is at your fingertips" onclick="_hbLink('theworldisatyourfingertips','VidVert');">the world is at your fingertips</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=gQNY7Sti8FY" title="the world is at your fingertips" onclick="_hbLink('theworldisatyourfingertips','VidVert');">the world is at your fingertips</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescgQNY7Sti8FY">
+ for the taking.
+ </span>
+
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/SupaDupaFlyGirl">SupaDupaFlyGirl</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 509,825<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.0" alt="3.91057134971" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">05:15</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=28">Science & Technology</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=rGUt7ropzNA"><img src="http://i.ytimg.com/vi/rGUt7ropzNA/default.jpg" class="vimg120" title="Aimee Mann Freeway Video Contest" qliconalt="rGUt7ropzNA" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=rGUt7ropzNA" title="Aimee Mann Freeway Video Contest" onclick="_hbLink('AimeeMannFreewayVideoContest','VidVert');">Aimee Mann Freeway Video Contest</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=rGUt7ropzNA" title="Aimee Mann Freeway Video Contest" onclick="_hbLink('AimeeMannFreewayVideoContest','VidVert');">Aimee Mann Freeway Video Contest</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescrGUt7ropzNA">
+ Want a chance to sing with Aimee Mann live? Go to http://www.youtube.com/group/aimeemannco
+ </span>
+
+ <span id="RemainvidDescrGUt7ropzNA" style="display: none">Want a chance to sing with Aimee Mann live? Go to http://www.youtube.com/group/aimeemanncontest and upload a video of yourself singing Aimee Mann's new song "Freeway."<br/><br/>Aimee Mann and SuperEgo Records will pick their favorite entry to be featured on YouTube and www.aimeemann.com. The winner will have an opportunity to sing live with Aimee at one of her upcoming shows. Ten runners-up will receive an autographed copy of Aimee's new CD, @#%&*! Smilers.<br/><br/>Entrants can get the lyrics, the instrumental version of "Freeway" and contest details at: http://www.aimeemann.com/freewaycontest/<br/>Submissions must be received by July 7th 2008</span>
+ <span id="MorevidDescrGUt7ropzNA" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescrGUt7ropzNA'); hideDiv('MorevidDescrGUt7ropzNA'); hideDiv('BeginvidDescrGUt7ropzNA'); showDiv('LessvidDescrGUt7ropzNA'); return false;">more</a>)</span>
+ <span id="LessvidDescrGUt7ropzNA" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescrGUt7ropzNA'); hideDiv('LessvidDescrGUt7ropzNA'); showDiv('BeginvidDescrGUt7ropzNA'); showDiv('MorevidDescrGUt7ropzNA'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/aimeemann">aimeemann</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 283,776<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.0" alt="3.79036827195" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">02:22</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=10">Music</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=tbEei0I3kMQ"><img src="http://i.ytimg.com/vi/tbEei0I3kMQ/default.jpg" class="vimg120" title="Interactive card trick" qliconalt="tbEei0I3kMQ" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=tbEei0I3kMQ" title="Interactive card trick" onclick="_hbLink('Interactivecardtrick','VidVert');">Interactive card trick</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=tbEei0I3kMQ" title="Interactive card trick" onclick="_hbLink('Interactivecardtrick','VidVert');">Interactive card trick</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDesctbEei0I3kMQ">
+ This is the first interactive video on YouTube!<br/>Have fun and enjoy the show<br/>you can see
+ </span>
+
+ <span id="RemainvidDesctbEei0I3kMQ" style="display: none">This is the first interactive video on YouTube!<br/>Have fun and enjoy the show<br/>you can see our magician site:<br/>orenshalom.co.il</span>
+ <span id="MorevidDesctbEei0I3kMQ" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDesctbEei0I3kMQ'); hideDiv('MorevidDesctbEei0I3kMQ'); hideDiv('BeginvidDesctbEei0I3kMQ'); showDiv('LessvidDesctbEei0I3kMQ'); return false;">more</a>)</span>
+ <span id="LessvidDesctbEei0I3kMQ" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDesctbEei0I3kMQ'); hideDiv('LessvidDesctbEei0I3kMQ'); showDiv('BeginvidDesctbEei0I3kMQ'); showDiv('MorevidDesctbEei0I3kMQ'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/werneroi">werneroi</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 3,155,063<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-3.5" alt="3.41263230956" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">01:10</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=22">People & Blogs</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=irDEzQovftM"><img src="http://i.ytimg.com/vi/irDEzQovftM/default.jpg" class="vimg120" title="Biggest drawing in the world" qliconalt="irDEzQovftM" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=irDEzQovftM" title="Biggest drawing in the world" onclick="_hbLink('Biggestdrawingintheworld','VidVert');">Biggest drawing in the world</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=irDEzQovftM" title="Biggest drawing in the world" onclick="_hbLink('Biggestdrawingintheworld','VidVert');">Biggest drawing in the world</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescirDEzQovftM">
+ making the biggest drawing in the world
+ </span>
+
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/erikbjgn">erikbjgn</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 971,773<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.54770783066" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">04:04</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=1">Film & Animation</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=iAKJKBCyPUY"><img src="http://i.ytimg.com/vi/iAKJKBCyPUY/default.jpg" class="vimg120" title="Checkmate" qliconalt="iAKJKBCyPUY" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=iAKJKBCyPUY" title="Checkmate" onclick="_hbLink('Checkmate','VidVert');">Checkmate</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=iAKJKBCyPUY" title="Checkmate" onclick="_hbLink('Checkmate','VidVert');">Checkmate</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDesciAKJKBCyPUY">
+ The Internets Celebrities Dallas Penn and Rafi Kam go in for an investigative report on Ch
+ </span>
+
+ <span id="RemainvidDesciAKJKBCyPUY" style="display: none">The Internets Celebrities Dallas Penn and Rafi Kam go in for an investigative report on Check-Cashing. Themes explored include usury, economic instability, commercial banks and their profit line, and the cycle of poverty. <br/><br/>Oh yeah, it's a comedy.<br/><br/>The video is shot on location in Bushwick and Carroll Gardens in Brooklyn, New York. Also stars special guest Internets Celebrity Ben Popken of Consumerist.com.<br/><br/>Directed by Casimir Nozkowski<br/>Shot by Ian Savage, Josh Weisbrot<br/>Music by El Keter; instrumental from song "The Bottom Line" off Sankofa's album The Tortoise Hustle. Used with full permission.<br/><br/>http://www.internetscelebrities.com</span>
+ <span id="MorevidDesciAKJKBCyPUY" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDesciAKJKBCyPUY'); hideDiv('MorevidDesciAKJKBCyPUY'); hideDiv('BeginvidDesciAKJKBCyPUY'); showDiv('LessvidDesciAKJKBCyPUY'); return false;">more</a>)</span>
+ <span id="LessvidDesciAKJKBCyPUY" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDesciAKJKBCyPUY'); hideDiv('LessvidDesciAKJKBCyPUY'); showDiv('BeginvidDesciAKJKBCyPUY'); showDiv('MorevidDesciAKJKBCyPUY'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/InternetsCelebrities">InternetsCel...</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 412,830<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.52936962751" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">09:45</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=25">News & Politics</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=yLCl0xIg5-0"><img src="http://i.ytimg.com/vi/yLCl0xIg5-0/default.jpg" class="vimg120" title="Stories from the Front lines, Part 1" qliconalt="yLCl0xIg5-0" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=yLCl0xIg5-0" title="Stories from the Front lines, Part 1" onclick="_hbLink('StoriesfromtheFrontlinesPart1','VidVert');">Stories from the Front lines, Pa...</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=yLCl0xIg5-0" title="Stories from the Front lines, Part 1" onclick="_hbLink('StoriesfromtheFrontlinesPart1','VidVert');">Stories from the Front lines, Part 1</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescyLCl0xIg50">
+ Stories from the men and women of the miltary, stationed in the Al Anbar Province. Right f
+ </span>
+
+ <span id="RemainvidDescyLCl0xIg50" style="display: none">Stories from the men and women of the miltary, stationed in the Al Anbar Province. Right from the mouths of the troops themselves. Part 1 of 4</span>
+ <span id="MorevidDescyLCl0xIg50" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescyLCl0xIg50'); hideDiv('MorevidDescyLCl0xIg50'); hideDiv('BeginvidDescyLCl0xIg50'); showDiv('LessvidDescyLCl0xIg50'); return false;">more</a>)</span>
+ <span id="LessvidDescyLCl0xIg50" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescyLCl0xIg50'); hideDiv('LessvidDescyLCl0xIg50'); showDiv('BeginvidDescyLCl0xIg50'); showDiv('MorevidDescyLCl0xIg50'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/3rdID8487">3rdID8487</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 367,189<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.0" alt="4.2188365651" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">10:35</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=25">News & Politics</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=rFItE14EeSU"><img src="http://i.ytimg.com/vi/rFItE14EeSU/default.jpg" class="vimg120" title="Amazing video of multiple tornadoes in Northwest Kansas" qliconalt="rFItE14EeSU" partner="true" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=rFItE14EeSU" title="Amazing video of multiple tornadoes in Northwest Kansas" onclick="_hbLink('AmazingvideoofmultipletornadoesinNorthwestKansas','VidVert');">Amazing video of multiple tornad...</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=rFItE14EeSU" title="Amazing video of multiple tornadoes in Northwest Kansas" onclick="_hbLink('AmazingvideoofmultipletornadoesinNorthwestKansas','VidVert');">Amazing video of multiple tornadoes in Northwest Kansas</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescrFItE14EeSU">
+ Video from TornadoVideos.net Live Stream Unit 3 of several tornadoes from close range.. In
+ </span>
+
+ <span id="RemainvidDescrFItE14EeSU" style="display: none">Video from TornadoVideos.net Live Stream Unit 3 of several tornadoes from close range.. Including one beautiful but strong rope and a large wedge tornado from within 1/2 mile. Check out TornadoVdeos.net for live streaming video, breaking weather news, and more extreme tornado footage.</span>
+ <span id="MorevidDescrFItE14EeSU" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescrFItE14EeSU'); hideDiv('MorevidDescrFItE14EeSU'); hideDiv('BeginvidDescrFItE14EeSU'); showDiv('LessvidDescrFItE14EeSU'); return false;">more</a>)</span>
+ <span id="LessvidDescrFItE14EeSU" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescrFItE14EeSU'); hideDiv('LessvidDescrFItE14EeSU'); showDiv('BeginvidDescrFItE14EeSU'); showDiv('MorevidDescrFItE14EeSU'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/TornadoVideosdotnet">TornadoVideo...</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 797,370<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.28912552436" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">07:10</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=25">News & Politics</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+ </div>
+ </div> <!-- end Video List -->
+ <div id="homepage-featured-more-bottom">
+ <div class="floatR"><a href="/browse?s=rf">See More Featured Videos</a></div>
+ <div class="clear"></div>
+ </div>
+</div>
+
+
+<div id="homepage-side-content" style="white-space: normal;">
+ <div>
+
+
+
+
+ <!-- Begin ad tag -->
+
+ <input type="hidden" id="pvaHl" value="en"/>
+ <input type="hidden" id="pvaTag" value="http://n4061ad.doubleclick.net/adj/com.ythome/_default;sz=399x299;kl=N;kga=-1;kgg=-1;tile=1;dcopt=ist;"/>
+ <input type="hidden" id="burl" value="http://www.youtube.com/pva/"/>
+ <input type="hidden" id="canv" value="False"/>
+ <div id="myAd_banner" style="visibility:hidden;height:35px;"></div>
+ <div id="myAd_pva">
+
+
+
+
+ <script type="text/javascript">
+ ord=Math.random()*10000000000000000 + 3;
+ if (false) {
+ ord = 1234567890;
+ }
+ document.write('<script language="JavaScript" src="http://n4061ad.doubleclick.net/adj/com.ythome/_default;sz=399x299;kl=N;kga=-1;kgg=-1;tile=1;dcopt=ist;ord=' + ord + '?" type="text/javascript"><\/script>');
+ </script>
+ <noscript><a
+ href="http://n4061ad.doubleclick.net/jump/_default;sz=399x299;ord=123456789?" target="_blank"><img
+ src="http://n4061ad.doubleclick.net/ad/_default;sz=399x299;ord=123456789?" width="399" height="299" border="0" alt=""></a>
+ </noscript>
+
+ </div>
+
+
+ <!-- End ad tag -->
+
+ </div>
+
+ <div class="homepage-content-block">
+ <div class="contentBox">
+ <div>
+ <div class="floatR"><span class="smallText"><b><a href="/signup">Sign Up</a> | <a href="http://help.youtube.com/support/youtube/bin/topic.py?topic=10546&amp;hl=en_US">Help</a></b></div>
+ <div class="floatL">
+ <span class="headerTitle homepage-block-heading-gray"> Login </span>
+ </div>
+ <div class="clear"></div>
+ </div>
+
+ <form method="post" name="loginForm" id="loginForm" action="signup">
+ <input type="hidden" name="action_login" value="1">
+ <table width="270">
+ <tr>
+ <td align="right"><label for="homeUsername"><span class="smallText"><b>Username:</b></span></label></td>
+ <td align="left"><input id="homeUsername" tabindex="101" class="smallText" type="text" size="16" name="username" value=""></td>
+ </tr>
+ <tr>
+ <td align="right"><label for="homePassword"><span class="smallText"><b>Password:</b></span></label></td>
+ <td align="left"><input id="homePassword" tabindex="102" class="smallText" type="password" size="16" name="password">
+ </tr>
+ <tr>
+ <td></td>
+ <td align="left">
+ <span><input type="submit" class="smallText" value="Login"></span>
+ </td>
+ </tr>
+ </table>
+ </form>
+ <div class="padT10 smallText">
+ <p align="center" class="marT0 marB0"><a href="/forgot_username?next=/">Forgot Username</a> | <a href="/forgot?next=/">Forgot Password</a></p>
+ </div>
+ <div class="homepage-border-dotted"></div>
+ <div class="alignC"><span class="smallText"><b><a href="
+https://www.google.com/accounts/ServiceLogin?service=youtube&hl=en_US&continue=http%3A//www.youtube.com/signup%3Fhl%3Den_US&passive=true">Login with your Google account</a>&nbsp; <a href="#" onClick="window.open('/t/help_gaia','login_help','width=580,height=480,resizable=yes,scrollbars=yes,status=0').focus();" rel="nofollow"><img src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" border="0" class="alignMid gaiaHelpBtn" alt=""></a></b></span></div>
+ </div>
+ </div> <!-- end homepage-content-block -->
+
+
+ <div class="homepage-content-block padT10">
+
+
+
+
+ <!-- Begin ad tag -->
+
+
+
+ <script type="text/javascript">
+ ord=Math.random()*10000000000000000 + 6;
+ if (false) {
+ ord = 1234567890;
+ }
+ document.write('<script language="JavaScript" src="http://n4061ad.doubleclick.net/adj/com.ythome/promo1;sz=300x50;kl=N;kga=-1;kgg=-1;tile=2;ord=' + ord + '?" type="text/javascript"><\/script>');
+ </script>
+ <noscript><a
+ href="http://n4061ad.doubleclick.net/jump/promo1;sz=300x50;ord=123456789?" target="_blank"><img
+ src="http://n4061ad.doubleclick.net/ad/promo1;sz=300x50;ord=123456789?" width="300" height="50" border="0" alt=""></a>
+ </noscript>
+
+
+ <!-- End ad tag -->
+
+ </div>
+
+ <div class="homepage-content-block padT10">
+
+
+
+
+ <!-- Begin ad tag -->
+
+
+
+ <script type="text/javascript">
+ ord=Math.random()*10000000000000000 + 6;
+ if (false) {
+ ord = 1234567890;
+ }
+ document.write('<script language="JavaScript" src="http://n4061ad.doubleclick.net/adj/com.ythome/promo3;sz=300x50;kl=N;kga=-1;kgg=-1;tile=4;ord=' + ord + '?" type="text/javascript"><\/script>');
+ </script>
+ <noscript><a
+ href="http://n4061ad.doubleclick.net/jump/promo3;sz=300x50;ord=123456789?" target="_blank"><img
+ src="http://n4061ad.doubleclick.net/ad/promo3;sz=300x50;ord=123456789?" width="300" height="50" border="0" alt=""></a>
+ </noscript>
+
+
+ <!-- End ad tag -->
+
+ </div>
+
+ <div class="homepage-side-block padT10">
+ <div class="homepage-yellow-block">
+ <div class="homepage-block-heading" style="color:#CC6600">What's New</div>
+
+ <div class="homepage-whatsnew-entry">
+ <div class="homepage-whatsnew-image"><a href="/t/annotations_about"><img src="http://s.ytimg.com/yt/img/whats_new/annotation-vfl42087.gif" border="0" width="30" height="37"/></a></div>
+ <div class="homepage-whatsnew-desc">
+ <b><a href="/t/annotations_about">Video Annotations</a></b><br/>Add interactive commentary and links to your videos
+ </div>
+ </div><div class="clear"></div>
+
+ <div class="homepage-whatsnew-entry">
+ <div class="homepage-whatsnew-image"><a href="/address_book"><img src="http://s.ytimg.com/yt/img/whats_new/addybook-vfl39351.gif" border="0" width="30" height="37"/></a></div>
+ <div class="homepage-whatsnew-desc">
+ <b><a href="/address_book">New Address Book</a></b><br/>Organizing your YouTube friends and contacts just got a lot simpler
+ </div>
+ </div><div class="clear"></div>
+
+ <div class="homepage-whatsnew-entry">
+ <div class="homepage-whatsnew-image"><a href="/inbox"><img src="http://s.ytimg.com/yt/img/whats_new/inbox-vfl39351.gif" border="0" width="30" height="37"/></a></div>
+ <div class="homepage-whatsnew-desc">
+ <b><a href="/inbox">Updated Inbox</a></b><br/>Manage your messages and invites with ease
+ </div>
+ </div><div class="clear"></div>
+
+
+ <div class="homepage-whatsnew-entry">
+ <div class="homepage-whatsnew-image"><a href="/mobile"><img src="http://s.ytimg.com/yt/img/whats_new/pic_home_mobile_30x37-vfl37458.gif" border="0" width="30" height="37"/></a></div>
+ <div class="homepage-whatsnew-desc">
+ <b><a href="/mobile">YouTube Mobile</a></b><br/> Watch and upload YouTube videos on your mobile device.
+ </div>
+ </div><div class="clear"></div>
+
+ <div class="bottomBorderDotted"></div>
+ <b><a href="/blog" style="color:#CC6600">Hear Ye, Hear Ye: Calling all Reporters</a></b><br>
+ Today we announce the launch of a new type of YouTube account: the Reporter. Reporter channels are just like the other YouTube channel types, but are specifically intended for citizens and profess...
+ <div class="alignR padT5">
+ <a href="/blog" style="color:#CC6600">Read more in our Blog</a>
+ </div>
+ <div style="font-size: 1px; height: 1px;"><br/></div>
+ </div><img class="homepage-yellow-block-bot" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+</div>
+
+
+ <div class="homepage-side-block">
+
+
+
+
+ <!-- Begin ad tag -->
+
+
+
+ <script type="text/javascript">
+ ord=Math.random()*10000000000000000 + 6;
+ if (false) {
+ ord = 1234567890;
+ }
+ document.write('<script language="JavaScript" src="http://n4061ad.doubleclick.net/adj/com.ythome/promo2;sz=300x50;kl=N;kga=-1;kgg=-1;tile=3;ord=' + ord + '?" type="text/javascript"><\/script>');
+ </script>
+ <noscript><a
+ href="http://n4061ad.doubleclick.net/jump/promo2;sz=300x50;ord=123456789?" target="_blank"><img
+ src="http://n4061ad.doubleclick.net/ad/promo2;sz=300x50;ord=123456789?" width="300" height="50" border="0" alt=""></a>
+ </noscript>
+
+
+ <!-- End ad tag -->
+
+ </div>
+
+
+</div> <!-- end homepage-side-content -->
+
+<div class="clear"></div>
+
+
+
+ <div class="clear"></div>
+ <div id="footer">
+ <div class="search">
+ <div class="promo">
+ <a href="/youchoose" onclick="_hbLink('FooterPromo','Footer');"><img id="debates_footer_img" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" alt="footer-promo" /></a>
+ <a href="/youchoose" onclick="_hbLink('FooterPromo','Footer');">Face The Candidates</a>
+ </div>
+ <form autocomplete="off" name="footer-search-form" method="get" action="/results" style="width: 73.5%;">
+ <a href="http://www.google.com/webmasters/igoogle/youtube.html"><img id="igoogle_footer_img" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" alt=""/> <em id="igoogle_footer_text">Add to iGoogle</em></a>
+ <input type="text" name="search_query" maxlength="128" class="query" onkeyup="goog.i18n.bidi.setDirAttribute(event,this)" value="" id="footer-search-term">
+ <select class="search-type" name="search_type">
+ <option value="">Videos</option>
+ <option value="search_users" >Channels</option>
+ </select>
+ <input type="submit" name="search" value="Search" class="submit-button">
+ </form>
+ </div>
+ <div class="links">
+ <table cellpadding="0" cellspacing="0">
+ <tr>
+ <th colspan="2">Your Account</th>
+ <th class="separator" colspan="2">Help &amp; Info</th>
+ <th class="separator" colspan="2">YouTube</th>
+ </tr>
+ <tr>
+ <td><a href="/my_videos">Videos</a></td>
+ <td><a href="/inbox">Inbox</a></td>
+ <td class="separator"><a href="http://help.youtube.com/support/youtube/bin/static.py?page=start.cs&amp;hl=en_US">Help Resources</a></td>
+ <td><a href="/t/safety">Safety Tips</a></td>
+ <td class="separator"><a href="/t/about">Company Info</a></td>
+ <td><a href="/press_room">Press</a></td>
+ </tr>
+ <tr>
+ <td><a href="/my_favorites">Favorites</a></td>
+ <td><a href="/subscription_center">Subscriptions</a></td>
+ <td class="separator"><a href="/t/video_toolbox">Video Toolbox</a></td>
+ <td><a href="/t/dmca_policy">Copyright Notices</a></td>
+ <td class="separator"><a href="/testtube">TestTube</a></td>
+ <td><a href="/t/contact_us">Contact</a></td>
+ </tr>
+ <tr>
+ <td><a href="/my_playlists">Playlists</a></td>
+ <td><a href="/my_account">more...</a></td>
+ <td class="separator"><a href="/dev">Developer APIs</a></td>
+ <td><a href="/t/community_guidelines">Community Guidelines</a></td>
+ <td class="separator"><a href="/t/terms">Terms of Use</a></td>
+ <td>
+ <a href="/blog">Blog</a>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">&nbsp;</td>
+ <td class="separator"><a href="/advertise">Advertising</a></td>
+ <td><a href="/youtubeonyoursite">YouTube On Your Site</a></td>
+ <td class="separator"><a href="/t/privacy">Privacy Policy</a></td>
+ <td>
+ <a href="http://www.google.com/jobs/youtube">Jobs</a><br/>
+ </td>
+ </tr>
+
+
+
+ </table>
+ </div>
+ </div>
+ <div id="copyright">
+ &copy; 2008 YouTube, LLC
+ </div>
+
+
+</div> <!-- end baseDiv -->
+
+</body>
+<script type="text/javascript">
+ window.setTimeout('window.google.ac.install(document.searchForm,document.searchForm.search_query,"yt",true,"close",true,"Suggestions")',100);
+</script>
+
+
+
+</html> \ No newline at end of file
diff --git a/examples/xml/rsslisting/main.cpp b/examples/xml/rsslisting/main.cpp
new file mode 100644
index 0000000000..011569f2b6
--- /dev/null
+++ b/examples/xml/rsslisting/main.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*
+main.cpp
+
+Provides the main function for the RSS news reader example.
+*/
+
+#include <QtGui>
+
+#include "rsslisting.h"
+
+/*!
+ Create an application and a main widget. Open the main widget for
+ user input, and exit with an appropriate return value when it is
+ closed.
+*/
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+ RSSListing *rsslisting = new RSSListing;
+ rsslisting->show();
+ return app.exec();
+}
diff --git a/examples/xml/rsslisting/rsslisting.cpp b/examples/xml/rsslisting/rsslisting.cpp
new file mode 100644
index 0000000000..5840f08d09
--- /dev/null
+++ b/examples/xml/rsslisting/rsslisting.cpp
@@ -0,0 +1,247 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*
+rsslisting.cpp
+
+Provides a widget for displaying news items from RDF news sources.
+RDF is an XML-based format for storing items of information (see
+http://www.w3.org/RDF/ for details).
+
+The widget itself provides a simple user interface for specifying
+the URL of a news source, and controlling the downloading of news.
+
+The widget downloads and parses the XML asynchronously, feeding the
+data to an XML reader in pieces. This allows the user to interrupt
+its operation, and also allows very large data sources to be read.
+*/
+
+
+#include <QtCore>
+#include <QtGui>
+#include <QtNetwork>
+
+#include "rsslisting.h"
+
+
+/*
+ Constructs an RSSListing widget with a simple user interface, and sets
+ up the XML reader to use a custom handler class.
+
+ The user interface consists of a line edit, a push button, and a
+ list view widget. The line edit is used for entering the URLs of news
+ sources; the push button starts the process of reading the
+ news.
+*/
+
+RSSListing::RSSListing(QWidget *parent)
+ : QWidget(parent), currentReply(0)
+{
+ lineEdit = new QLineEdit(this);
+ lineEdit->setText("http://labs.qt.nokia.com/blogs/feed");
+
+ fetchButton = new QPushButton(tr("Fetch"), this);
+
+ treeWidget = new QTreeWidget(this);
+ connect(treeWidget, SIGNAL(itemActivated(QTreeWidgetItem*,int)),
+ this, SLOT(itemActivated(QTreeWidgetItem*)));
+ QStringList headerLabels;
+ headerLabels << tr("Title") << tr("Link");
+ treeWidget->setHeaderLabels(headerLabels);
+ treeWidget->header()->setResizeMode(QHeaderView::ResizeToContents);
+
+ connect(&manager, SIGNAL(finished(QNetworkReply*)),
+ this, SLOT(finished(QNetworkReply*)));
+
+ connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(fetch()));
+ connect(fetchButton, SIGNAL(clicked()), this, SLOT(fetch()));
+
+ QVBoxLayout *layout = new QVBoxLayout(this);
+
+ QHBoxLayout *hboxLayout = new QHBoxLayout;
+
+ hboxLayout->addWidget(lineEdit);
+ hboxLayout->addWidget(fetchButton);
+
+ layout->addLayout(hboxLayout);
+ layout->addWidget(treeWidget);
+
+ setWindowTitle(tr("RSS listing example"));
+ resize(640,480);
+}
+
+/*
+ Starts the network request and connects the needed signals
+*/
+void RSSListing::get(const QUrl &url)
+{
+ QNetworkRequest request(url);
+ if (currentReply) {
+ currentReply->disconnect(this);
+ currentReply->deleteLater();
+ }
+ currentReply = manager.get(request);
+ connect(currentReply, SIGNAL(readyRead()), this, SLOT(readyRead()));
+ connect(currentReply, SIGNAL(metaDataChanged()), this, SLOT(metaDataChanged()));
+ connect(currentReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(error(QNetworkReply::NetworkError)));
+}
+
+/*
+ Starts fetching data from a news source specified in the line
+ edit widget.
+
+ The line edit is made read only to prevent the user from modifying its
+ contents during the fetch; this is only for cosmetic purposes.
+ The fetch button is disabled, the list view is cleared, and we
+ define the last list view item to be 0, meaning that there are no
+ existing items in the list.
+
+ A URL is created with the raw contents of the line edit and
+ a get is initiated.
+*/
+
+void RSSListing::fetch()
+{
+ lineEdit->setReadOnly(true);
+ fetchButton->setEnabled(false);
+ treeWidget->clear();
+
+ xml.clear();
+
+ QUrl url(lineEdit->text());
+ get(url);
+}
+
+void RSSListing::metaDataChanged()
+{
+ QUrl redirectionTarget = currentReply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl();
+ if (redirectionTarget.isValid()) {
+ get(redirectionTarget);
+ }
+}
+
+/*
+ Reads data received from the RDF source.
+
+ We read all the available data, and pass it to the XML
+ stream reader. Then we call the XML parsing function.
+*/
+
+void RSSListing::readyRead()
+{
+ int statusCode = currentReply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
+ if (statusCode >= 200 && statusCode < 300) {
+ QByteArray data = currentReply->readAll();
+ xml.addData(data);
+ parseXml();
+ }
+}
+
+/*
+ Finishes processing an HTTP request.
+
+ The default behavior is to keep the text edit read only.
+
+ If an error has occurred, the user interface is made available
+ to the user for further input, allowing a new fetch to be
+ started.
+
+ If the HTTP get request has finished, we make the
+ user interface available to the user for further input.
+*/
+
+void RSSListing::finished(QNetworkReply *reply)
+{
+ Q_UNUSED(reply);
+ lineEdit->setReadOnly(false);
+ fetchButton->setEnabled(true);
+}
+
+
+/*
+ Parses the XML data and creates treeWidget items accordingly.
+*/
+void RSSListing::parseXml()
+{
+ while (!xml.atEnd()) {
+ xml.readNext();
+ if (xml.isStartElement()) {
+ if (xml.name() == "item")
+ linkString = xml.attributes().value("rss:about").toString();
+ currentTag = xml.name().toString();
+ } else if (xml.isEndElement()) {
+ if (xml.name() == "item") {
+
+ QTreeWidgetItem *item = new QTreeWidgetItem;
+ item->setText(0, titleString);
+ item->setText(1, linkString);
+ treeWidget->addTopLevelItem(item);
+
+ titleString.clear();
+ linkString.clear();
+ }
+
+ } else if (xml.isCharacters() && !xml.isWhitespace()) {
+ if (currentTag == "title")
+ titleString += xml.text().toString();
+ else if (currentTag == "link")
+ linkString += xml.text().toString();
+ }
+ }
+ if (xml.error() && xml.error() != QXmlStreamReader::PrematureEndOfDocumentError) {
+ qWarning() << "XML ERROR:" << xml.lineNumber() << ": " << xml.errorString();
+ }
+}
+
+/*
+ Open the link in the browser
+*/
+void RSSListing::itemActivated(QTreeWidgetItem * item)
+{
+ QDesktopServices::openUrl(QUrl(item->text(1)));
+}
+
+void RSSListing::error(QNetworkReply::NetworkError)
+{
+ qWarning("error retrieving RSS feed");
+ currentReply->disconnect(this);
+ currentReply->deleteLater();
+ currentReply = 0;
+}
diff --git a/examples/xml/rsslisting/rsslisting.h b/examples/xml/rsslisting/rsslisting.h
new file mode 100644
index 0000000000..98254f839b
--- /dev/null
+++ b/examples/xml/rsslisting/rsslisting.h
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef RSSLISTING_H
+#define RSSLISTING_H
+
+#include <QNetworkAccessManager>
+#include <QNetworkReply>
+#include <QWidget>
+#include <QBuffer>
+#include <QXmlStreamReader>
+#include <QUrl>
+
+QT_BEGIN_NAMESPACE
+class QLineEdit;
+class QTreeWidget;
+class QTreeWidgetItem;
+class QPushButton;
+QT_END_NAMESPACE
+
+class RSSListing : public QWidget
+{
+ Q_OBJECT
+public:
+ RSSListing(QWidget *widget = 0);
+
+public slots:
+ void fetch();
+ void finished(QNetworkReply *reply);
+ void readyRead();
+ void metaDataChanged();
+ void itemActivated(QTreeWidgetItem * item);
+ void error(QNetworkReply::NetworkError);
+
+private:
+ void parseXml();
+ void get(const QUrl &url);
+
+ QXmlStreamReader xml;
+ QString currentTag;
+ QString linkString;
+ QString titleString;
+
+ QNetworkAccessManager manager;
+ QNetworkReply *currentReply;
+
+ QLineEdit *lineEdit;
+ QTreeWidget *treeWidget;
+ QPushButton *fetchButton;
+};
+
+#endif
+
diff --git a/examples/xml/rsslisting/rsslisting.pro b/examples/xml/rsslisting/rsslisting.pro
new file mode 100644
index 0000000000..01bc9e2ad6
--- /dev/null
+++ b/examples/xml/rsslisting/rsslisting.pro
@@ -0,0 +1,12 @@
+HEADERS += rsslisting.h
+SOURCES += main.cpp rsslisting.cpp
+QT += network xml
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml/rsslisting
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS rsslisting.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml/rsslisting
+INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+
diff --git a/examples/xml/saxbookmarks/frank.xbel b/examples/xml/saxbookmarks/frank.xbel
new file mode 100644
index 0000000000..6bd63b8b07
--- /dev/null
+++ b/examples/xml/saxbookmarks/frank.xbel
@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xbel>
+<xbel version="1.0">
+ <folder folded="yes">
+ <title>Literate Programming</title>
+ <bookmark href="http://www.vivtek.com/litprog.html">
+ <title>Synopsis of Literate Programming</title>
+ </bookmark>
+ <bookmark href="http://vasc.ri.cmu.edu/old_help/Programming/Literate/literate.html">
+ <title>Literate Programming: Propaganda and Tools</title>
+ </bookmark>
+ <bookmark href="http://www.isy.liu.se/%7Eturbell/litprog/">
+ <title>Literate Programming by Henrik Turbell</title>
+ </bookmark>
+ <bookmark href="http://www.desy.de/user/projects/LitProg.html">
+ <title>Literate Programming Library</title>
+ </bookmark>
+ <bookmark href="http://www.loria.fr/services/tex/english/litte.html">
+ <title>Literate Programming Basics</title>
+ </bookmark>
+ <bookmark href="http://ei.cs.vt.edu/%7Ecs5014/courseNotes/4.LiterateProgramming/literate_prog.html">
+ <title>Literate Programming Overview</title>
+ </bookmark>
+ <bookmark href="http://www.perl.com/pub/a/tchrist/litprog.html">
+ <title>POD is not Literate Programming</title>
+ </bookmark>
+ <bookmark href="http://www.cornellcollege.edu/%7Eltabak/publications/articles/swsafety.html">
+ <title>Computers That We Can Count On</title>
+ </bookmark>
+ <bookmark href="http://www.cs.auc.dk/%7Enormark/litpro/issues-and-problems.html">
+ <title>Literate Programming - Issues and Problems</title>
+ </bookmark>
+ <bookmark href="http://c2.com/cgi/wiki?LiterateProgramming">
+ <title>Literate Programming - Wiki Pages</title>
+ </bookmark>
+ <bookmark href="http://developers.slashdot.org/developers/02/05/19/2216233.shtml">
+ <title>What is well-commented code?</title>
+ </bookmark>
+ <bookmark href="http://liinwww.ira.uka.de/bibliography/SE/litprog.html">
+ <title>Bibliography on literate programming - A searchable bibliography</title>
+ </bookmark>
+ <bookmark href="http://www2.umassd.edu/SWPI/ProcessBibliography/bib-codereading.html">
+ <title>Program comprehension and code reading bibliography</title>
+ </bookmark>
+ <bookmark href="http://www.cs.auc.dk/%7Enormark/elucidative-programming/">
+ <title>Elucidative Programming</title>
+ </bookmark>
+ <bookmark href="http://www.msu.edu/%7Epfaffben/avl/index.html">
+ <title>AVL Trees (TexiWeb)</title>
+ </bookmark>
+ <bookmark href="http://literate-programming.wikiverse.org/">
+ <title>Literate Programming on Wikiverse</title>
+ </bookmark>
+ <bookmark href="http://www.pbrt.org/">
+ <title>Physically Based Rendering: From Theory to Implementation</title>
+ </bookmark>
+ </folder>
+ <folder folded="no">
+ <title>Useful C++ Links</title>
+ <folder folded="no">
+ <title>STL</title>
+ <bookmark href="http://www.sgi.com/tech/stl/table_of_contents.html">
+ <title>STL Reference Documentation</title>
+ </bookmark>
+ <bookmark href="http://www.yrl.co.uk/~phil/stl/stl.htmlx">
+ <title>STL Tutorial</title>
+ </bookmark>
+ <bookmark href="http://www.cppreference.com/cpp_stl.html">
+ <title>STL Reference</title>
+ </bookmark>
+ </folder>
+ <folder folded="no">
+ <title>Qt</title>
+ <bookmark href="http://qt.nokia.com/doc/2.3/">
+ <title>Qt 2.3 Reference</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/doc/3.3/">
+ <title>Qt 3.3 Reference</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/doc/4.0/">
+ <title>Qt 4.0 Reference</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/">
+ <title>Qt Home Page</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>IOStreams</title>
+ <bookmark href="http://www.cplusplus.com/ref/iostream/index.html">
+ <title>IO Stream Library</title>
+ </bookmark>
+ <bookmark href="http://courses.cs.vt.edu/~cs2604/fall01/binio.html">
+ <title>Binary I/O</title>
+ </bookmark>
+ <bookmark href="http://www.parashift.com/c++-faq-lite/input-output.html">
+ <title>I/O Stream FAQ</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>gdb</title>
+ <bookmark href="http://www.cs.princeton.edu/~benjasik/gdb/gdbtut.html">
+ <title>GDB Tutorial</title>
+ </bookmark>
+ <bookmark href="http://www.gnu.org/manual/gdb-4.17/html_mono/gdb.html">
+ <title>Debugging with GDB</title>
+ </bookmark>
+ <bookmark href="http://www.cs.washington.edu/orgs/acm/tutorials/dev-in-unix/gdb-refcard.pdf">
+ <title>GDB Quick Reference Page (PDF) (Handy)</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>Classes and Constructors</title>
+ <bookmark href="http://www.parashift.com/c++-faq-lite/ctors.html">
+ <title>Constructor FAQ</title>
+ </bookmark>
+ <bookmark href="http://www.juicystudio.com/tutorial/cpp/index.html">
+ <title>Organizing Classes</title>
+ </bookmark>
+ </folder>
+ </folder>
+ <folder folded="yes">
+ <title>Software Documentation or System Documentation</title>
+ <bookmark href="http://www.martinfowler.com/distributedComputing/thud.html">
+ <title>The Almighty Thud</title>
+ </bookmark>
+ <bookmark href="http://msdn.microsoft.com/library/techart/cfr.htm">
+ <title>Microsoft Coding Techniques and Programming Practices</title>
+ </bookmark>
+ <bookmark href="http://www.bearcave.com/software/prog_docs.html">
+ <title>Software and Documentation</title>
+ </bookmark>
+ <bookmark href="http://c2.com/cgi/wiki?TheSourceCodeIsTheDesign">
+ <title>The Source Code is the Design</title>
+ </bookmark>
+ <bookmark href="http://www.bleading-edge.com/Publications/C++Journal/Cpjour2.htm">
+ <title>What is Software Design?</title>
+ </bookmark>
+ <bookmark href="http://www.mindprod.com/unmain.html">
+ <title>How To Write Unmaintainable Code</title>
+ </bookmark>
+ <bookmark href="http://www.idinews.com/selfDoc.html">
+ <title>Self Documenting Program Code Remains a Distant Goal</title>
+ </bookmark>
+ <bookmark href="http://www.sdmagazine.com/documents/s=730/sdm0106m/0106m.htm">
+ <title>Place Tab A in Slot B</title>
+ </bookmark>
+ <bookmark href="http://www.holub.com/class/uml/uml.html">
+ <title>UML Reference Card</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>TeX Resources</title>
+ <bookmark href="http://www.tug.org/">
+ <title>The TeX User's Group</title>
+ </bookmark>
+ <bookmark href="http://www.miktex.org/">
+ <title>MikTeX website</title>
+ </bookmark>
+ <bookmark href="http://cm.bell-labs.com/who/hobby/MetaPost.html">
+ <title>MetaPost website</title>
+ </bookmark>
+ <bookmark href="http://pauillac.inria.fr/%7Emaranget/hevea/">
+ <title>HEVEA is a quite complete and fast LATEX to HTML translator</title>
+ </bookmark>
+ </folder>
+ <folder folded="no">
+ <title>Portable Document Format (PDF)</title>
+ <bookmark href="http://www.adobe.com/">
+ <title>Adobe - The postscript and PDF standards</title>
+ </bookmark>
+ <bookmark href="http://partners.adobe.com/asn/developer/technotes/acrobatpdf.html">
+ <title>Reference Manual Portable Document Format</title>
+ </bookmark>
+ <bookmark href="http://partners.adobe.com/asn/developer/acrosdk/main.html">
+ <title>Adobe Acrobat Software Development Kit</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>Literature Sites</title>
+ <bookmark href="http://www.cc.columbia.edu/cu/libraries/subjects/speccol.html">
+ <title>Guide to Special Collections (Columbia University)</title>
+ </bookmark>
+ <bookmark href="http://www.ipl.org/ref/litcrit/">
+ <title>Literary Criticism on the Web from the Internet Public Library</title>
+ </bookmark>
+ <bookmark href="http://www.victorianweb.org/">
+ <title>Victorian Web.</title>
+ </bookmark>
+ <bookmark href="http://vos.ucsb.edu/">
+ <title>Voice of the Shuttle.</title>
+ </bookmark>
+ <bookmark href="http://www.modjourn.brown.edu/">
+ <title>Modernist Journals Project</title>
+ </bookmark>
+ <bookmark href="http://www.poetspath.com">
+ <title>Museum of American Poetics</title>
+ </bookmark>
+ <bookmark href="http://www.english.uiuc.edu/maps/">
+ <title>Modern American Poetry</title>
+ </bookmark>
+ <bookmark href="http://www.findarticles.com/">
+ <title>FindArticles.com</title>
+ </bookmark>
+ <bookmark href="http://www.literaryhistory.com">
+ <title>Literary History</title>
+ </bookmark>
+ <bookmark href="http://www.litencyc.com/LitEncycFrame.htm">
+ <title>Literary Encyclopedia</title>
+ </bookmark>
+ <separator/>
+ <bookmark href="http://texts.cdlib.org/ucpress/">
+ <title>The University of California Press</title>
+ </bookmark>
+ <bookmark href="http://www.letrs.indiana.edu/web/w/wright2/">
+ <title>Wright American Fiction, 1851-1875</title>
+ </bookmark>
+ <bookmark href="http://docsouth.unc.edu/">
+ <title>Documenting the American South: Beginnings to 1920</title>
+ </bookmark>
+ <bookmark href="http://etext.lib.virginia.edu/eng-on.html">
+ <title>Electronic Text Center at the University of Virginia</title>
+ </bookmark>
+ <bookmark href="http://digital.nypl.org/schomburg/writers_aa19/">
+ <title>The Schomburg Center for Research in Black Culture</title>
+ </bookmark>
+ <bookmark href="http://www.infomotions.com/alex2/">
+ <title>Alex Catalogue of Electronic Texts.</title>
+ </bookmark>
+ </folder>
+</xbel>
diff --git a/examples/xml/saxbookmarks/jennifer.xbel b/examples/xml/saxbookmarks/jennifer.xbel
new file mode 100644
index 0000000000..d6a5b41d05
--- /dev/null
+++ b/examples/xml/saxbookmarks/jennifer.xbel
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xbel>
+<xbel version="1.0">
+ <folder folded="no">
+ <title>Qt Resources</title>
+ <folder folded="yes">
+ <title>Qt Partners</title>
+ <bookmark href="http://partners.trolltech.com/partners/training.html">
+ <title>Training Partners</title>
+ </bookmark>
+ <bookmark href="http://partners.trolltech.com/partners/service.html">
+ <title>Consultants and System Integrators</title>
+ </bookmark>
+ <bookmark href="http://partners.trolltech.com/partners/tech.html">
+ <title>Technology Partners</title>
+ </bookmark>
+ <bookmark href="http://partners.trolltech.com/partners/resellers.html">
+ <title>Value Added Resellers (VARs)</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>Community Resources</title>
+ <bookmark href="http://www.qtforum.org/">
+ <title>QtForum.org</title>
+ </bookmark>
+ <bookmark href="http://www.digitalfanatics.org/projects/qt_tutorial/">
+ <title>The Independent Qt Tutorial</title>
+ </bookmark>
+ <bookmark href="http://prog.qt.free.fr/">
+ <title>French PROG.Qt</title>
+ </bookmark>
+ <bookmark href="http://www.qtforum.de/">
+ <title>German Qt Forum</title>
+ </bookmark>
+ <bookmark href="http://www.korone.net/">
+ <title>Korean Qt Community Site</title>
+ </bookmark>
+ <bookmark href="http://prog.org.ru/forum/forum_14.html">
+ <title>Russian Qt Forum</title>
+ </bookmark>
+ <bookmark href="http://qt4.digitalfanatics.org/">
+ <title>Digitalfanatics: The QT 4 Resource Center</title>
+ </bookmark>
+ <bookmark href="http://www.qtquestions.org/">
+ <title>QtQuestions</title>
+ </bookmark>
+ </folder>
+ <bookmark href="http://qt.nokia.com/doc/qq/">
+ <title>Qt Quarterly</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/">
+ <title>qt home page</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/doc/4.0/">
+ <title>Qt 4.0 documentation</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/developer/faqs/">
+ <title>Frequently Asked Questions</title>
+ </bookmark>
+ </folder>
+ <folder folded="no">
+ <title>Online Dictionaries</title>
+ <bookmark href="http://www.dictionary.com/">
+ <title>Dictionary.com</title>
+ </bookmark>
+ <bookmark href="http://www.m-w.com/">
+ <title>Merriam-Webster Online</title>
+ </bookmark>
+ <bookmark href="http://dictionary.cambridge.org/">
+ <title>Cambridge Dictionaries Online</title>
+ </bookmark>
+ <bookmark href="http://www.onelook.com/">
+ <title>OneLook Dictionary Search</title>
+ </bookmark>
+ <separator/>
+ <bookmark href="www.iee.et.tu-dresden.de/">
+ <title>The New English-German Dictionary</title>
+ </bookmark>
+ <bookmark href="http://dict.tu-chemnitz.de/">
+ <title>TU Chemnitz German-English Dictionary</title>
+ </bookmark>
+ <separator/>
+ <bookmark href="http://atilf.atilf.fr/tlf.htm">
+ <title>Trésor de la Langue Française informatisé</title>
+ </bookmark>
+ <bookmark href="http://dictionnaires.atilf.fr/dictionnaires/ACADEMIE/">
+ <title>Dictionnaire de l'Académie Française</title>
+ </bookmark>
+ <bookmark href="http://elsap1.unicaen.fr/cgi-bin/cherches.cgi">
+ <title>Dictionnaire des synonymes</title>
+ </bookmark>
+ </folder>
+</xbel>
diff --git a/examples/xml/saxbookmarks/main.cpp b/examples/xml/saxbookmarks/main.cpp
new file mode 100644
index 0000000000..5d70ec89a5
--- /dev/null
+++ b/examples/xml/saxbookmarks/main.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ MainWindow mainWin;
+#if defined(Q_OS_SYMBIAN)
+ mainWin.showFullScreen();
+#else
+ mainWin.show();
+#endif
+ mainWin.open();
+ return app.exec();
+}
diff --git a/examples/xml/saxbookmarks/mainwindow.cpp b/examples/xml/saxbookmarks/mainwindow.cpp
new file mode 100644
index 0000000000..e5300121e5
--- /dev/null
+++ b/examples/xml/saxbookmarks/mainwindow.cpp
@@ -0,0 +1,169 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "mainwindow.h"
+#include "xbelgenerator.h"
+#include "xbelhandler.h"
+
+MainWindow::MainWindow()
+{
+ QStringList labels;
+ labels << tr("Title") << tr("Location");
+
+ treeWidget = new QTreeWidget;
+ treeWidget->header()->setResizeMode(QHeaderView::Stretch);
+ treeWidget->setHeaderLabels(labels);
+ setCentralWidget(treeWidget);
+
+ createActions();
+ createMenus();
+
+ statusBar()->showMessage(tr("Ready"));
+
+ setWindowTitle(tr("SAX Bookmarks"));
+ resize(480, 320);
+}
+
+void MainWindow::open()
+{
+#if defined(Q_OS_SYMBIAN)
+ // Look for bookmarks on the same drive where the application is installed to,
+ // if drive is not read only. QDesktopServices::DataLocation does this check,
+ // and returns writable drive.
+ QString bookmarksFolder =
+ QDesktopServices::storageLocation(QDesktopServices::DataLocation).left(1);
+ bookmarksFolder.append(":/Data/qt/saxbookmarks");
+ QDir::setCurrent(bookmarksFolder);
+#endif
+ QString fileName =
+ QFileDialog::getOpenFileName(this, tr("Open Bookmark File"),
+ QDir::currentPath(),
+ tr("XBEL Files (*.xbel *.xml)"));
+ if (fileName.isEmpty())
+ return;
+
+ treeWidget->clear();
+
+ XbelHandler handler(treeWidget);
+ QXmlSimpleReader reader;
+ reader.setContentHandler(&handler);
+ reader.setErrorHandler(&handler);
+
+ QFile file(fileName);
+ if (!file.open(QFile::ReadOnly | QFile::Text)) {
+ QMessageBox::warning(this, tr("SAX Bookmarks"),
+ tr("Cannot read file %1:\n%2.")
+ .arg(fileName)
+ .arg(file.errorString()));
+ return;
+ }
+
+ QXmlInputSource xmlInputSource(&file);
+ if (reader.parse(xmlInputSource))
+ statusBar()->showMessage(tr("File loaded"), 2000);
+}
+
+void MainWindow::saveAs()
+{
+ QString fileName =
+ QFileDialog::getSaveFileName(this, tr("Save Bookmark File"),
+ QDir::currentPath(),
+ tr("XBEL Files (*.xbel *.xml)"));
+ if (fileName.isEmpty())
+ return;
+
+ QFile file(fileName);
+ if (!file.open(QFile::WriteOnly | QFile::Text)) {
+ QMessageBox::warning(this, tr("SAX Bookmarks"),
+ tr("Cannot write file %1:\n%2.")
+ .arg(fileName)
+ .arg(file.errorString()));
+ return;
+ }
+
+ XbelGenerator generator(treeWidget);
+ if (generator.write(&file))
+ statusBar()->showMessage(tr("File saved"), 2000);
+}
+
+void MainWindow::about()
+{
+ QMessageBox::about(this, tr("About SAX Bookmarks"),
+ tr("The <b>SAX Bookmarks</b> example demonstrates how to use Qt's "
+ "SAX classes to read XML documents and how to generate XML by "
+ "hand."));
+}
+
+void MainWindow::createActions()
+{
+ openAct = new QAction(tr("&Open..."), this);
+ openAct->setShortcuts(QKeySequence::Open);
+ connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
+
+ saveAsAct = new QAction(tr("&Save As..."), this);
+ saveAsAct->setShortcuts(QKeySequence::SaveAs);
+ connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));
+
+ exitAct = new QAction(tr("E&xit"), this);
+ exitAct->setShortcuts(QKeySequence::Quit);
+ connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
+
+ aboutAct = new QAction(tr("&About"), this);
+ connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
+
+ aboutQtAct = new QAction(tr("About &Qt"), this);
+ connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
+}
+
+void MainWindow::createMenus()
+{
+ fileMenu = menuBar()->addMenu(tr("&File"));
+ fileMenu->addAction(openAct);
+ fileMenu->addAction(saveAsAct);
+ fileMenu->addAction(exitAct);
+
+ menuBar()->addSeparator();
+
+ helpMenu = menuBar()->addMenu(tr("&Help"));
+ helpMenu->addAction(aboutAct);
+ helpMenu->addAction(aboutQtAct);
+}
diff --git a/examples/xml/saxbookmarks/mainwindow.h b/examples/xml/saxbookmarks/mainwindow.h
new file mode 100644
index 0000000000..3313d8f574
--- /dev/null
+++ b/examples/xml/saxbookmarks/mainwindow.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+
+QT_BEGIN_NAMESPACE
+class QTreeWidget;
+QT_END_NAMESPACE
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void open();
+ void saveAs();
+ void about();
+
+private:
+ void createActions();
+ void createMenus();
+
+ QTreeWidget *treeWidget;
+
+ QMenu *fileMenu;
+ QMenu *helpMenu;
+ QAction *openAct;
+ QAction *saveAsAct;
+ QAction *exitAct;
+ QAction *aboutAct;
+ QAction *aboutQtAct;
+};
+
+#endif
diff --git a/examples/xml/saxbookmarks/saxbookmarks.pro b/examples/xml/saxbookmarks/saxbookmarks.pro
new file mode 100644
index 0000000000..3091947afc
--- /dev/null
+++ b/examples/xml/saxbookmarks/saxbookmarks.pro
@@ -0,0 +1,28 @@
+HEADERS = mainwindow.h \
+ xbelgenerator.h \
+ xbelhandler.h
+SOURCES = main.cpp \
+ mainwindow.cpp \
+ xbelgenerator.cpp \
+ xbelhandler.cpp
+QT += xml
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml/saxbookmarks
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS saxbookmarks.pro *.xbel
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml/saxbookmarks
+INSTALLS += target sources
+
+wince*: {
+ addFiles.files = frank.xbel jennifer.xbel
+ addFiles.path = "\\My Documents"
+ DEPLOYMENT += addFiles
+}
+
+symbian: {
+ TARGET.UID3 = 0xA000C60A
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+ addFiles.files = frank.xbel jennifer.xbel
+ addFiles.path = /data/qt/saxbookmarks
+ DEPLOYMENT += addFiles
+}
diff --git a/examples/xml/saxbookmarks/xbelgenerator.cpp b/examples/xml/saxbookmarks/xbelgenerator.cpp
new file mode 100644
index 0000000000..a0bfe67f69
--- /dev/null
+++ b/examples/xml/saxbookmarks/xbelgenerator.cpp
@@ -0,0 +1,114 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "xbelgenerator.h"
+
+XbelGenerator::XbelGenerator(QTreeWidget *treeWidget)
+ : treeWidget(treeWidget)
+{
+}
+
+bool XbelGenerator::write(QIODevice *device)
+{
+ out.setDevice(device);
+ out.setCodec("UTF-8");
+ out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ << "<!DOCTYPE xbel>\n"
+ << "<xbel version=\"1.0\">\n";
+
+ for (int i = 0; i < treeWidget->topLevelItemCount(); ++i)
+ generateItem(treeWidget->topLevelItem(i), 1);
+
+ out << "</xbel>\n";
+ return true;
+}
+
+QString XbelGenerator::indent(int depth)
+{
+ const int IndentSize = 4;
+ return QString(IndentSize * depth, ' ');
+}
+
+QString XbelGenerator::escapedText(const QString &str)
+{
+ QString result = str;
+ result.replace("&", "&amp;");
+ result.replace("<", "&lt;");
+ result.replace(">", "&gt;");
+ return result;
+}
+
+QString XbelGenerator::escapedAttribute(const QString &str)
+{
+ QString result = escapedText(str);
+ result.replace("\"", "&quot;");
+ result.prepend("\"");
+ result.append("\"");
+ return result;
+}
+
+void XbelGenerator::generateItem(QTreeWidgetItem *item, int depth)
+{
+ QString tagName = item->data(0, Qt::UserRole).toString();
+ if (tagName == "folder") {
+ bool folded = !treeWidget->isItemExpanded(item);
+ out << indent(depth) << "<folder folded=\"" << (folded ? "yes" : "no")
+ << "\">\n"
+ << indent(depth + 1) << "<title>" << escapedText(item->text(0))
+ << "</title>\n";
+
+ for (int i = 0; i < item->childCount(); ++i)
+ generateItem(item->child(i), depth + 1);
+
+ out << indent(depth) << "</folder>\n";
+ } else if (tagName == "bookmark") {
+ out << indent(depth) << "<bookmark";
+ if (!item->text(1).isEmpty())
+ out << " href=" << escapedAttribute(item->text(1));
+ out << ">\n"
+ << indent(depth + 1) << "<title>" << escapedText(item->text(0))
+ << "</title>\n"
+ << indent(depth) << "</bookmark>\n";
+ } else if (tagName == "separator") {
+ out << indent(depth) << "<separator/>\n";
+ }
+}
diff --git a/examples/xml/saxbookmarks/xbelgenerator.h b/examples/xml/saxbookmarks/xbelgenerator.h
new file mode 100644
index 0000000000..84011a262f
--- /dev/null
+++ b/examples/xml/saxbookmarks/xbelgenerator.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef XBELGENERATOR_H
+#define XBELGENERATOR_H
+
+#include <QTextStream>
+
+QT_BEGIN_NAMESPACE
+class QTreeWidget;
+class QTreeWidgetItem;
+QT_END_NAMESPACE
+
+class XbelGenerator
+{
+public:
+ XbelGenerator(QTreeWidget *treeWidget);
+
+ bool write(QIODevice *device);
+
+private:
+ static QString indent(int indentLevel);
+ static QString escapedText(const QString &str);
+ static QString escapedAttribute(const QString &str);
+ void generateItem(QTreeWidgetItem *item, int depth);
+
+ QTreeWidget *treeWidget;
+ QTextStream out;
+};
+
+#endif
diff --git a/examples/xml/saxbookmarks/xbelhandler.cpp b/examples/xml/saxbookmarks/xbelhandler.cpp
new file mode 100644
index 0000000000..09874c9edc
--- /dev/null
+++ b/examples/xml/saxbookmarks/xbelhandler.cpp
@@ -0,0 +1,146 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "xbelhandler.h"
+
+XbelHandler::XbelHandler(QTreeWidget *treeWidget)
+ : treeWidget(treeWidget)
+{
+ item = 0;
+ metXbelTag = false;
+
+ QStyle *style = treeWidget->style();
+
+ folderIcon.addPixmap(style->standardPixmap(QStyle::SP_DirClosedIcon),
+ QIcon::Normal, QIcon::Off);
+ folderIcon.addPixmap(style->standardPixmap(QStyle::SP_DirOpenIcon),
+ QIcon::Normal, QIcon::On);
+ bookmarkIcon.addPixmap(style->standardPixmap(QStyle::SP_FileIcon));
+}
+
+bool XbelHandler::startElement(const QString & /* namespaceURI */,
+ const QString & /* localName */,
+ const QString &qName,
+ const QXmlAttributes &attributes)
+{
+ if (!metXbelTag && qName != "xbel") {
+ errorStr = QObject::tr("The file is not an XBEL file.");
+ return false;
+ }
+
+ if (qName == "xbel") {
+ QString version = attributes.value("version");
+ if (!version.isEmpty() && version != "1.0") {
+ errorStr = QObject::tr("The file is not an XBEL version 1.0 file.");
+ return false;
+ }
+ metXbelTag = true;
+ } else if (qName == "folder") {
+ item = createChildItem(qName);
+ item->setFlags(item->flags() | Qt::ItemIsEditable);
+ item->setIcon(0, folderIcon);
+ item->setText(0, QObject::tr("Folder"));
+ bool folded = (attributes.value("folded") != "no");
+ treeWidget->setItemExpanded(item, !folded);
+ } else if (qName == "bookmark") {
+ item = createChildItem(qName);
+ item->setFlags(item->flags() | Qt::ItemIsEditable);
+ item->setIcon(0, bookmarkIcon);
+ item->setText(0, QObject::tr("Unknown title"));
+ item->setText(1, attributes.value("href"));
+ } else if (qName == "separator") {
+ item = createChildItem(qName);
+ item->setFlags(item->flags() & ~Qt::ItemIsSelectable);
+ item->setText(0, QString(30, 0xB7));
+ }
+
+ currentText.clear();
+ return true;
+}
+
+bool XbelHandler::endElement(const QString & /* namespaceURI */,
+ const QString & /* localName */,
+ const QString &qName)
+{
+ if (qName == "title") {
+ if (item)
+ item->setText(0, currentText);
+ } else if (qName == "folder" || qName == "bookmark"
+ || qName == "separator") {
+ item = item->parent();
+ }
+ return true;
+}
+
+bool XbelHandler::characters(const QString &str)
+{
+ currentText += str;
+ return true;
+}
+
+bool XbelHandler::fatalError(const QXmlParseException &exception)
+{
+ QMessageBox::information(treeWidget->window(), QObject::tr("SAX Bookmarks"),
+ QObject::tr("Parse error at line %1, column %2:\n"
+ "%3")
+ .arg(exception.lineNumber())
+ .arg(exception.columnNumber())
+ .arg(exception.message()));
+ return false;
+}
+
+QString XbelHandler::errorString() const
+{
+ return errorStr;
+}
+
+QTreeWidgetItem *XbelHandler::createChildItem(const QString &tagName)
+{
+ QTreeWidgetItem *childItem;
+ if (item) {
+ childItem = new QTreeWidgetItem(item);
+ } else {
+ childItem = new QTreeWidgetItem(treeWidget);
+ }
+ childItem->setData(0, Qt::UserRole, tagName);
+ return childItem;
+}
diff --git a/examples/xml/saxbookmarks/xbelhandler.h b/examples/xml/saxbookmarks/xbelhandler.h
new file mode 100644
index 0000000000..cee1bafe48
--- /dev/null
+++ b/examples/xml/saxbookmarks/xbelhandler.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef XBELHANDLER_H
+#define XBELHANDLER_H
+
+#include <QIcon>
+#include <QXmlDefaultHandler>
+
+QT_BEGIN_NAMESPACE
+class QTreeWidget;
+class QTreeWidgetItem;
+QT_END_NAMESPACE
+
+class XbelHandler : public QXmlDefaultHandler
+{
+public:
+ XbelHandler(QTreeWidget *treeWidget);
+
+ bool startElement(const QString &namespaceURI, const QString &localName,
+ const QString &qName, const QXmlAttributes &attributes);
+ bool endElement(const QString &namespaceURI, const QString &localName,
+ const QString &qName);
+ bool characters(const QString &str);
+ bool fatalError(const QXmlParseException &exception);
+ QString errorString() const;
+
+private:
+ QTreeWidgetItem *createChildItem(const QString &tagName);
+
+ QTreeWidget *treeWidget;
+ QTreeWidgetItem *item;
+ QString currentText;
+ QString errorStr;
+ bool metXbelTag;
+
+ QIcon folderIcon;
+ QIcon bookmarkIcon;
+};
+
+#endif
diff --git a/examples/xml/streambookmarks/frank.xbel b/examples/xml/streambookmarks/frank.xbel
new file mode 100644
index 0000000000..6bd63b8b07
--- /dev/null
+++ b/examples/xml/streambookmarks/frank.xbel
@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xbel>
+<xbel version="1.0">
+ <folder folded="yes">
+ <title>Literate Programming</title>
+ <bookmark href="http://www.vivtek.com/litprog.html">
+ <title>Synopsis of Literate Programming</title>
+ </bookmark>
+ <bookmark href="http://vasc.ri.cmu.edu/old_help/Programming/Literate/literate.html">
+ <title>Literate Programming: Propaganda and Tools</title>
+ </bookmark>
+ <bookmark href="http://www.isy.liu.se/%7Eturbell/litprog/">
+ <title>Literate Programming by Henrik Turbell</title>
+ </bookmark>
+ <bookmark href="http://www.desy.de/user/projects/LitProg.html">
+ <title>Literate Programming Library</title>
+ </bookmark>
+ <bookmark href="http://www.loria.fr/services/tex/english/litte.html">
+ <title>Literate Programming Basics</title>
+ </bookmark>
+ <bookmark href="http://ei.cs.vt.edu/%7Ecs5014/courseNotes/4.LiterateProgramming/literate_prog.html">
+ <title>Literate Programming Overview</title>
+ </bookmark>
+ <bookmark href="http://www.perl.com/pub/a/tchrist/litprog.html">
+ <title>POD is not Literate Programming</title>
+ </bookmark>
+ <bookmark href="http://www.cornellcollege.edu/%7Eltabak/publications/articles/swsafety.html">
+ <title>Computers That We Can Count On</title>
+ </bookmark>
+ <bookmark href="http://www.cs.auc.dk/%7Enormark/litpro/issues-and-problems.html">
+ <title>Literate Programming - Issues and Problems</title>
+ </bookmark>
+ <bookmark href="http://c2.com/cgi/wiki?LiterateProgramming">
+ <title>Literate Programming - Wiki Pages</title>
+ </bookmark>
+ <bookmark href="http://developers.slashdot.org/developers/02/05/19/2216233.shtml">
+ <title>What is well-commented code?</title>
+ </bookmark>
+ <bookmark href="http://liinwww.ira.uka.de/bibliography/SE/litprog.html">
+ <title>Bibliography on literate programming - A searchable bibliography</title>
+ </bookmark>
+ <bookmark href="http://www2.umassd.edu/SWPI/ProcessBibliography/bib-codereading.html">
+ <title>Program comprehension and code reading bibliography</title>
+ </bookmark>
+ <bookmark href="http://www.cs.auc.dk/%7Enormark/elucidative-programming/">
+ <title>Elucidative Programming</title>
+ </bookmark>
+ <bookmark href="http://www.msu.edu/%7Epfaffben/avl/index.html">
+ <title>AVL Trees (TexiWeb)</title>
+ </bookmark>
+ <bookmark href="http://literate-programming.wikiverse.org/">
+ <title>Literate Programming on Wikiverse</title>
+ </bookmark>
+ <bookmark href="http://www.pbrt.org/">
+ <title>Physically Based Rendering: From Theory to Implementation</title>
+ </bookmark>
+ </folder>
+ <folder folded="no">
+ <title>Useful C++ Links</title>
+ <folder folded="no">
+ <title>STL</title>
+ <bookmark href="http://www.sgi.com/tech/stl/table_of_contents.html">
+ <title>STL Reference Documentation</title>
+ </bookmark>
+ <bookmark href="http://www.yrl.co.uk/~phil/stl/stl.htmlx">
+ <title>STL Tutorial</title>
+ </bookmark>
+ <bookmark href="http://www.cppreference.com/cpp_stl.html">
+ <title>STL Reference</title>
+ </bookmark>
+ </folder>
+ <folder folded="no">
+ <title>Qt</title>
+ <bookmark href="http://qt.nokia.com/doc/2.3/">
+ <title>Qt 2.3 Reference</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/doc/3.3/">
+ <title>Qt 3.3 Reference</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/doc/4.0/">
+ <title>Qt 4.0 Reference</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/">
+ <title>Qt Home Page</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>IOStreams</title>
+ <bookmark href="http://www.cplusplus.com/ref/iostream/index.html">
+ <title>IO Stream Library</title>
+ </bookmark>
+ <bookmark href="http://courses.cs.vt.edu/~cs2604/fall01/binio.html">
+ <title>Binary I/O</title>
+ </bookmark>
+ <bookmark href="http://www.parashift.com/c++-faq-lite/input-output.html">
+ <title>I/O Stream FAQ</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>gdb</title>
+ <bookmark href="http://www.cs.princeton.edu/~benjasik/gdb/gdbtut.html">
+ <title>GDB Tutorial</title>
+ </bookmark>
+ <bookmark href="http://www.gnu.org/manual/gdb-4.17/html_mono/gdb.html">
+ <title>Debugging with GDB</title>
+ </bookmark>
+ <bookmark href="http://www.cs.washington.edu/orgs/acm/tutorials/dev-in-unix/gdb-refcard.pdf">
+ <title>GDB Quick Reference Page (PDF) (Handy)</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>Classes and Constructors</title>
+ <bookmark href="http://www.parashift.com/c++-faq-lite/ctors.html">
+ <title>Constructor FAQ</title>
+ </bookmark>
+ <bookmark href="http://www.juicystudio.com/tutorial/cpp/index.html">
+ <title>Organizing Classes</title>
+ </bookmark>
+ </folder>
+ </folder>
+ <folder folded="yes">
+ <title>Software Documentation or System Documentation</title>
+ <bookmark href="http://www.martinfowler.com/distributedComputing/thud.html">
+ <title>The Almighty Thud</title>
+ </bookmark>
+ <bookmark href="http://msdn.microsoft.com/library/techart/cfr.htm">
+ <title>Microsoft Coding Techniques and Programming Practices</title>
+ </bookmark>
+ <bookmark href="http://www.bearcave.com/software/prog_docs.html">
+ <title>Software and Documentation</title>
+ </bookmark>
+ <bookmark href="http://c2.com/cgi/wiki?TheSourceCodeIsTheDesign">
+ <title>The Source Code is the Design</title>
+ </bookmark>
+ <bookmark href="http://www.bleading-edge.com/Publications/C++Journal/Cpjour2.htm">
+ <title>What is Software Design?</title>
+ </bookmark>
+ <bookmark href="http://www.mindprod.com/unmain.html">
+ <title>How To Write Unmaintainable Code</title>
+ </bookmark>
+ <bookmark href="http://www.idinews.com/selfDoc.html">
+ <title>Self Documenting Program Code Remains a Distant Goal</title>
+ </bookmark>
+ <bookmark href="http://www.sdmagazine.com/documents/s=730/sdm0106m/0106m.htm">
+ <title>Place Tab A in Slot B</title>
+ </bookmark>
+ <bookmark href="http://www.holub.com/class/uml/uml.html">
+ <title>UML Reference Card</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>TeX Resources</title>
+ <bookmark href="http://www.tug.org/">
+ <title>The TeX User's Group</title>
+ </bookmark>
+ <bookmark href="http://www.miktex.org/">
+ <title>MikTeX website</title>
+ </bookmark>
+ <bookmark href="http://cm.bell-labs.com/who/hobby/MetaPost.html">
+ <title>MetaPost website</title>
+ </bookmark>
+ <bookmark href="http://pauillac.inria.fr/%7Emaranget/hevea/">
+ <title>HEVEA is a quite complete and fast LATEX to HTML translator</title>
+ </bookmark>
+ </folder>
+ <folder folded="no">
+ <title>Portable Document Format (PDF)</title>
+ <bookmark href="http://www.adobe.com/">
+ <title>Adobe - The postscript and PDF standards</title>
+ </bookmark>
+ <bookmark href="http://partners.adobe.com/asn/developer/technotes/acrobatpdf.html">
+ <title>Reference Manual Portable Document Format</title>
+ </bookmark>
+ <bookmark href="http://partners.adobe.com/asn/developer/acrosdk/main.html">
+ <title>Adobe Acrobat Software Development Kit</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>Literature Sites</title>
+ <bookmark href="http://www.cc.columbia.edu/cu/libraries/subjects/speccol.html">
+ <title>Guide to Special Collections (Columbia University)</title>
+ </bookmark>
+ <bookmark href="http://www.ipl.org/ref/litcrit/">
+ <title>Literary Criticism on the Web from the Internet Public Library</title>
+ </bookmark>
+ <bookmark href="http://www.victorianweb.org/">
+ <title>Victorian Web.</title>
+ </bookmark>
+ <bookmark href="http://vos.ucsb.edu/">
+ <title>Voice of the Shuttle.</title>
+ </bookmark>
+ <bookmark href="http://www.modjourn.brown.edu/">
+ <title>Modernist Journals Project</title>
+ </bookmark>
+ <bookmark href="http://www.poetspath.com">
+ <title>Museum of American Poetics</title>
+ </bookmark>
+ <bookmark href="http://www.english.uiuc.edu/maps/">
+ <title>Modern American Poetry</title>
+ </bookmark>
+ <bookmark href="http://www.findarticles.com/">
+ <title>FindArticles.com</title>
+ </bookmark>
+ <bookmark href="http://www.literaryhistory.com">
+ <title>Literary History</title>
+ </bookmark>
+ <bookmark href="http://www.litencyc.com/LitEncycFrame.htm">
+ <title>Literary Encyclopedia</title>
+ </bookmark>
+ <separator/>
+ <bookmark href="http://texts.cdlib.org/ucpress/">
+ <title>The University of California Press</title>
+ </bookmark>
+ <bookmark href="http://www.letrs.indiana.edu/web/w/wright2/">
+ <title>Wright American Fiction, 1851-1875</title>
+ </bookmark>
+ <bookmark href="http://docsouth.unc.edu/">
+ <title>Documenting the American South: Beginnings to 1920</title>
+ </bookmark>
+ <bookmark href="http://etext.lib.virginia.edu/eng-on.html">
+ <title>Electronic Text Center at the University of Virginia</title>
+ </bookmark>
+ <bookmark href="http://digital.nypl.org/schomburg/writers_aa19/">
+ <title>The Schomburg Center for Research in Black Culture</title>
+ </bookmark>
+ <bookmark href="http://www.infomotions.com/alex2/">
+ <title>Alex Catalogue of Electronic Texts.</title>
+ </bookmark>
+ </folder>
+</xbel>
diff --git a/examples/xml/streambookmarks/jennifer.xbel b/examples/xml/streambookmarks/jennifer.xbel
new file mode 100644
index 0000000000..36256fda0a
--- /dev/null
+++ b/examples/xml/streambookmarks/jennifer.xbel
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xbel>
+<xbel version="1.0">
+ <folder folded="no">
+ <title>Qt Resources</title>
+ <folder folded="yes">
+ <title>Qt Partners</title>
+ <bookmark href="http://partners.trolltech.com/partners/training.html">
+ <title>Training Partners</title>
+ </bookmark>
+ <bookmark href="http://partners.trolltech.com/partners/service.html">
+ <title>Consultants and System Integrators</title>
+ </bookmark>
+ <bookmark href="http://partners.trolltech.com/partners/tech.html">
+ <title>Technology Partners</title>
+ </bookmark>
+ <bookmark href="http://partners.trolltech.com/partners/resellers.html">
+ <title>Value Added Resellers (VARs)</title>
+ </bookmark>
+ </folder>
+ <folder folded="yes">
+ <title>Community Resources</title>
+ <bookmark href="http://www.qtforum.org/">
+ <title>QtForum.org</title>
+ </bookmark>
+ <bookmark href="http://www.digitalfanatics.org/projects/qt_tutorial/">
+ <title>The Independent Qt Tutorial</title>
+ </bookmark>
+ <bookmark href="http://prog.qt.free.fr/">
+ <title>French PROG.Qt</title>
+ </bookmark>
+ <bookmark href="http://www.qtforum.de/">
+ <title>German Qt Forum</title>
+ </bookmark>
+ <bookmark href="http://www.korone.net/">
+ <title>Korean Qt Community Site</title>
+ </bookmark>
+ <bookmark href="http://prog.org.ru/forum/forum_14.html">
+ <title>Russian Qt Forum</title>
+ </bookmark>
+ <bookmark href="http://qt4.digitalfanatics.org/">
+ <title>Digitalfanatics: The QT 4 Resource Center</title>
+ </bookmark>
+ <bookmark href="http://www.qtquestions.org/">
+ <title>QtQuestions</title>
+ </bookmark>
+ </folder>
+ <bookmark href="http://qt.nokia.com/doc/qq/">
+ <title>Qt Quarterly</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/">
+ <title>Qt home page</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/doc/4.0/">
+ <title>Qt 4.0 documentation</title>
+ </bookmark>
+ <bookmark href="http://qt.nokia.com/developer/faqs/">
+ <title>Frequently Asked Questions</title>
+ </bookmark>
+ </folder>
+ <folder folded="no">
+ <title>Online Dictionaries</title>
+ <bookmark href="http://www.dictionary.com/">
+ <title>Dictionary.com</title>
+ </bookmark>
+ <bookmark href="http://www.m-w.com/">
+ <title>Merriam-Webster Online</title>
+ </bookmark>
+ <bookmark href="http://dictionary.cambridge.org/">
+ <title>Cambridge Dictionaries Online</title>
+ </bookmark>
+ <bookmark href="http://www.onelook.com/">
+ <title>OneLook Dictionary Search</title>
+ </bookmark>
+ <separator/>
+ <bookmark href="www.iee.et.tu-dresden.de/">
+ <title>The New English-German Dictionary</title>
+ </bookmark>
+ <bookmark href="http://dict.tu-chemnitz.de/">
+ <title>TU Chemnitz German-English Dictionary</title>
+ </bookmark>
+ <separator/>
+ <bookmark href="http://atilf.atilf.fr/tlf.htm">
+ <title>Trésor de la Langue Française informatisé</title>
+ </bookmark>
+ <bookmark href="http://dictionnaires.atilf.fr/dictionnaires/ACADEMIE/">
+ <title>Dictionnaire de l'Académie Française</title>
+ </bookmark>
+ <bookmark href="http://elsap1.unicaen.fr/cgi-bin/cherches.cgi">
+ <title>Dictionnaire des synonymes</title>
+ </bookmark>
+ </folder>
+</xbel>
diff --git a/examples/xml/streambookmarks/main.cpp b/examples/xml/streambookmarks/main.cpp
new file mode 100644
index 0000000000..c44e921e82
--- /dev/null
+++ b/examples/xml/streambookmarks/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+
+#include "mainwindow.h"
+
+//! [0]
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ MainWindow mainWin;
+ mainWin.show();
+ mainWin.open();
+ return app.exec();
+}
+//! [0]
diff --git a/examples/xml/streambookmarks/mainwindow.cpp b/examples/xml/streambookmarks/mainwindow.cpp
new file mode 100644
index 0000000000..e9236e93e6
--- /dev/null
+++ b/examples/xml/streambookmarks/mainwindow.cpp
@@ -0,0 +1,174 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "mainwindow.h"
+#include "xbelreader.h"
+#include "xbelwriter.h"
+
+//! [0]
+MainWindow::MainWindow()
+{
+ QStringList labels;
+ labels << tr("Title") << tr("Location");
+
+ treeWidget = new QTreeWidget;
+ treeWidget->header()->setResizeMode(QHeaderView::Stretch);
+ treeWidget->setHeaderLabels(labels);
+ setCentralWidget(treeWidget);
+
+ createActions();
+ createMenus();
+
+ statusBar()->showMessage(tr("Ready"));
+
+ setWindowTitle(tr("QXmlStream Bookmarks"));
+ resize(480, 320);
+}
+//! [0]
+
+//! [1]
+void MainWindow::open()
+{
+ QString fileName =
+ QFileDialog::getOpenFileName(this, tr("Open Bookmark File"),
+ QDir::currentPath(),
+ tr("XBEL Files (*.xbel *.xml)"));
+ if (fileName.isEmpty())
+ return;
+
+ treeWidget->clear();
+
+
+ QFile file(fileName);
+ if (!file.open(QFile::ReadOnly | QFile::Text)) {
+ QMessageBox::warning(this, tr("QXmlStream Bookmarks"),
+ tr("Cannot read file %1:\n%2.")
+ .arg(fileName)
+ .arg(file.errorString()));
+ return;
+ }
+
+ XbelReader reader(treeWidget);
+ if (!reader.read(&file)) {
+ QMessageBox::warning(this, tr("QXmlStream Bookmarks"),
+ tr("Parse error in file %1:\n\n%2")
+ .arg(fileName)
+ .arg(reader.errorString()));
+ } else {
+ statusBar()->showMessage(tr("File loaded"), 2000);
+ }
+
+}
+//! [1]
+
+//! [2]
+void MainWindow::saveAs()
+{
+ QString fileName =
+ QFileDialog::getSaveFileName(this, tr("Save Bookmark File"),
+ QDir::currentPath(),
+ tr("XBEL Files (*.xbel *.xml)"));
+ if (fileName.isEmpty())
+ return;
+
+ QFile file(fileName);
+ if (!file.open(QFile::WriteOnly | QFile::Text)) {
+ QMessageBox::warning(this, tr("QXmlStream Bookmarks"),
+ tr("Cannot write file %1:\n%2.")
+ .arg(fileName)
+ .arg(file.errorString()));
+ return;
+ }
+
+ XbelWriter writer(treeWidget);
+ if (writer.writeFile(&file))
+ statusBar()->showMessage(tr("File saved"), 2000);
+}
+//! [2]
+
+//! [3]
+void MainWindow::about()
+{
+ QMessageBox::about(this, tr("About QXmlStream Bookmarks"),
+ tr("The <b>QXmlStream Bookmarks</b> example demonstrates how to use Qt's "
+ "QXmlStream classes to read and write XML documents."));
+}
+//! [3]
+
+//! [4]
+void MainWindow::createActions()
+{
+ openAct = new QAction(tr("&Open..."), this);
+ openAct->setShortcuts(QKeySequence::Open);
+ connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
+
+ saveAsAct = new QAction(tr("&Save As..."), this);
+ saveAsAct->setShortcuts(QKeySequence::SaveAs);
+ connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));
+
+ exitAct = new QAction(tr("E&xit"), this);
+ exitAct->setShortcuts(QKeySequence::Quit);
+ connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
+
+ aboutAct = new QAction(tr("&About"), this);
+ connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
+
+ aboutQtAct = new QAction(tr("About &Qt"), this);
+ connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
+}
+//! [4]
+
+//! [5]
+void MainWindow::createMenus()
+{
+ fileMenu = menuBar()->addMenu(tr("&File"));
+ fileMenu->addAction(openAct);
+ fileMenu->addAction(saveAsAct);
+ fileMenu->addAction(exitAct);
+
+ menuBar()->addSeparator();
+
+ helpMenu = menuBar()->addMenu(tr("&Help"));
+ helpMenu->addAction(aboutAct);
+ helpMenu->addAction(aboutQtAct);
+}
+//! [5]
diff --git a/examples/xml/streambookmarks/mainwindow.h b/examples/xml/streambookmarks/mainwindow.h
new file mode 100644
index 0000000000..f27c4088bc
--- /dev/null
+++ b/examples/xml/streambookmarks/mainwindow.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+
+QT_BEGIN_NAMESPACE
+class QTreeWidget;
+QT_END_NAMESPACE
+
+//! [0]
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void open();
+ void saveAs();
+ void about();
+
+private:
+ void createActions();
+ void createMenus();
+
+ QTreeWidget *treeWidget;
+
+ QMenu *fileMenu;
+ QMenu *helpMenu;
+ QAction *openAct;
+ QAction *saveAsAct;
+ QAction *exitAct;
+ QAction *aboutAct;
+ QAction *aboutQtAct;
+};
+//! [0]
+
+#endif
diff --git a/examples/xml/streambookmarks/streambookmarks.pro b/examples/xml/streambookmarks/streambookmarks.pro
new file mode 100644
index 0000000000..febd3cd85f
--- /dev/null
+++ b/examples/xml/streambookmarks/streambookmarks.pro
@@ -0,0 +1,16 @@
+HEADERS = mainwindow.h \
+ xbelreader.h \
+ xbelwriter.h
+SOURCES = main.cpp \
+ mainwindow.cpp \
+ xbelreader.cpp \
+ xbelwriter.cpp
+QT += xml
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml/streambookmarks
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS streambookmarks.pro *.xbel
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml/streambookmarks
+INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/xml/streambookmarks/xbelreader.cpp b/examples/xml/streambookmarks/xbelreader.cpp
new file mode 100644
index 0000000000..e6d1c64e64
--- /dev/null
+++ b/examples/xml/streambookmarks/xbelreader.cpp
@@ -0,0 +1,175 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "xbelreader.h"
+
+//! [0]
+XbelReader::XbelReader(QTreeWidget *treeWidget)
+ : treeWidget(treeWidget)
+{
+ QStyle *style = treeWidget->style();
+
+ folderIcon.addPixmap(style->standardPixmap(QStyle::SP_DirClosedIcon),
+ QIcon::Normal, QIcon::Off);
+ folderIcon.addPixmap(style->standardPixmap(QStyle::SP_DirOpenIcon),
+ QIcon::Normal, QIcon::On);
+ bookmarkIcon.addPixmap(style->standardPixmap(QStyle::SP_FileIcon));
+}
+//! [0]
+
+//! [1]
+bool XbelReader::read(QIODevice *device)
+{
+ xml.setDevice(device);
+
+ if (xml.readNextStartElement()) {
+ if (xml.name() == "xbel" && xml.attributes().value("version") == "1.0")
+ readXBEL();
+ else
+ xml.raiseError(QObject::tr("The file is not an XBEL version 1.0 file."));
+ }
+
+ return !xml.error();
+}
+//! [1]
+
+//! [2]
+QString XbelReader::errorString() const
+{
+ return QObject::tr("%1\nLine %2, column %3")
+ .arg(xml.errorString())
+ .arg(xml.lineNumber())
+ .arg(xml.columnNumber());
+}
+//! [2]
+
+//! [3]
+void XbelReader::readXBEL()
+{
+ Q_ASSERT(xml.isStartElement() && xml.name() == "xbel");
+
+ while (xml.readNextStartElement()) {
+ if (xml.name() == "folder")
+ readFolder(0);
+ else if (xml.name() == "bookmark")
+ readBookmark(0);
+ else if (xml.name() == "separator")
+ readSeparator(0);
+ else
+ xml.skipCurrentElement();
+ }
+}
+//! [3]
+
+//! [4]
+void XbelReader::readTitle(QTreeWidgetItem *item)
+{
+ Q_ASSERT(xml.isStartElement() && xml.name() == "title");
+
+ QString title = xml.readElementText();
+ item->setText(0, title);
+}
+//! [4]
+
+//! [5]
+void XbelReader::readSeparator(QTreeWidgetItem *item)
+{
+ Q_ASSERT(xml.isStartElement() && xml.name() == "separator");
+
+ QTreeWidgetItem *separator = createChildItem(item);
+ separator->setFlags(item->flags() & ~Qt::ItemIsSelectable);
+ separator->setText(0, QString(30, 0xB7));
+ xml.skipCurrentElement();
+}
+//! [5]
+
+void XbelReader::readFolder(QTreeWidgetItem *item)
+{
+ Q_ASSERT(xml.isStartElement() && xml.name() == "folder");
+
+ QTreeWidgetItem *folder = createChildItem(item);
+ bool folded = (xml.attributes().value("folded") != "no");
+ treeWidget->setItemExpanded(folder, !folded);
+
+ while (xml.readNextStartElement()) {
+ if (xml.name() == "title")
+ readTitle(folder);
+ else if (xml.name() == "folder")
+ readFolder(folder);
+ else if (xml.name() == "bookmark")
+ readBookmark(folder);
+ else if (xml.name() == "separator")
+ readSeparator(folder);
+ else
+ xml.skipCurrentElement();
+ }
+}
+
+void XbelReader::readBookmark(QTreeWidgetItem *item)
+{
+ Q_ASSERT(xml.isStartElement() && xml.name() == "bookmark");
+
+ QTreeWidgetItem *bookmark = createChildItem(item);
+ bookmark->setFlags(bookmark->flags() | Qt::ItemIsEditable);
+ bookmark->setIcon(0, bookmarkIcon);
+ bookmark->setText(0, QObject::tr("Unknown title"));
+ bookmark->setText(1, xml.attributes().value("href").toString());
+
+ while (xml.readNextStartElement()) {
+ if (xml.name() == "title")
+ readTitle(bookmark);
+ else
+ xml.skipCurrentElement();
+ }
+}
+
+QTreeWidgetItem *XbelReader::createChildItem(QTreeWidgetItem *item)
+{
+ QTreeWidgetItem *childItem;
+ if (item) {
+ childItem = new QTreeWidgetItem(item);
+ } else {
+ childItem = new QTreeWidgetItem(treeWidget);
+ }
+ childItem->setData(0, Qt::UserRole, xml.name().toString());
+ return childItem;
+}
diff --git a/examples/xml/streambookmarks/xbelreader.h b/examples/xml/streambookmarks/xbelreader.h
new file mode 100644
index 0000000000..1ca1190235
--- /dev/null
+++ b/examples/xml/streambookmarks/xbelreader.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef XBELREADER_H
+#define XBELREADER_H
+
+#include <QIcon>
+#include <QXmlStreamReader>
+
+QT_BEGIN_NAMESPACE
+class QTreeWidget;
+class QTreeWidgetItem;
+QT_END_NAMESPACE
+
+//! [0]
+class XbelReader
+{
+public:
+//! [1]
+ XbelReader(QTreeWidget *treeWidget);
+//! [1]
+
+ bool read(QIODevice *device);
+
+ QString errorString() const;
+
+private:
+//! [2]
+ void readXBEL();
+ void readTitle(QTreeWidgetItem *item);
+ void readSeparator(QTreeWidgetItem *item);
+ void readFolder(QTreeWidgetItem *item);
+ void readBookmark(QTreeWidgetItem *item);
+
+ QTreeWidgetItem *createChildItem(QTreeWidgetItem *item);
+
+ QXmlStreamReader xml;
+ QTreeWidget *treeWidget;
+//! [2]
+
+ QIcon folderIcon;
+ QIcon bookmarkIcon;
+};
+//! [0]
+
+#endif
diff --git a/examples/xml/streambookmarks/xbelwriter.cpp b/examples/xml/streambookmarks/xbelwriter.cpp
new file mode 100644
index 0000000000..bd5454c941
--- /dev/null
+++ b/examples/xml/streambookmarks/xbelwriter.cpp
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "xbelwriter.h"
+
+//! [0]
+XbelWriter::XbelWriter(QTreeWidget *treeWidget)
+ : treeWidget(treeWidget)
+{
+ xml.setAutoFormatting(true);
+}
+//! [0]
+
+//! [1]
+bool XbelWriter::writeFile(QIODevice *device)
+{
+ xml.setDevice(device);
+
+ xml.writeStartDocument();
+ xml.writeDTD("<!DOCTYPE xbel>");
+ xml.writeStartElement("xbel");
+ xml.writeAttribute("version", "1.0");
+ for (int i = 0; i < treeWidget->topLevelItemCount(); ++i)
+ writeItem(treeWidget->topLevelItem(i));
+
+ xml.writeEndDocument();
+ return true;
+}
+//! [1]
+
+//! [2]
+void XbelWriter::writeItem(QTreeWidgetItem *item)
+{
+ QString tagName = item->data(0, Qt::UserRole).toString();
+ if (tagName == "folder") {
+ bool folded = !treeWidget->isItemExpanded(item);
+ xml.writeStartElement(tagName);
+ xml.writeAttribute("folded", folded ? "yes" : "no");
+ xml.writeTextElement("title", item->text(0));
+ for (int i = 0; i < item->childCount(); ++i)
+ writeItem(item->child(i));
+ xml.writeEndElement();
+ } else if (tagName == "bookmark") {
+ xml.writeStartElement(tagName);
+ if (!item->text(1).isEmpty())
+ xml.writeAttribute("href", item->text(1));
+ xml.writeTextElement("title", item->text(0));
+ xml.writeEndElement();
+ } else if (tagName == "separator") {
+ xml.writeEmptyElement(tagName);
+ }
+}
+//! [2]
diff --git a/examples/xml/streambookmarks/xbelwriter.h b/examples/xml/streambookmarks/xbelwriter.h
new file mode 100644
index 0000000000..8160a87b52
--- /dev/null
+++ b/examples/xml/streambookmarks/xbelwriter.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef XBELWRITER_H
+#define XBELWRITER_H
+
+#include <QXmlStreamWriter>
+
+QT_BEGIN_NAMESPACE
+class QTreeWidget;
+class QTreeWidgetItem;
+QT_END_NAMESPACE
+
+//! [0]
+class XbelWriter
+{
+public:
+ XbelWriter(QTreeWidget *treeWidget);
+ bool writeFile(QIODevice *device);
+
+private:
+ void writeItem(QTreeWidgetItem *item);
+ QXmlStreamWriter xml;
+ QTreeWidget *treeWidget;
+};
+//! [0]
+
+#endif
diff --git a/examples/xml/xml.pro b/examples/xml/xml.pro
new file mode 100644
index 0000000000..a6c8aa18b4
--- /dev/null
+++ b/examples/xml/xml.pro
@@ -0,0 +1,20 @@
+TEMPLATE = subdirs
+SUBDIRS = htmlinfo \
+ xmlstreamlint
+
+!contains(QT_CONFIG, no-gui) {
+ SUBDIRS += dombookmarks \
+ rsslisting \
+ saxbookmarks \
+ streambookmarks
+}
+
+symbian: SUBDIRS = htmlinfo saxbookmarks
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS xml.pro README
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml
+INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/xml/xmlstreamlint/main.cpp b/examples/xml/xmlstreamlint/main.cpp
new file mode 100644
index 0000000000..78f40f64fa
--- /dev/null
+++ b/examples/xml/xmlstreamlint/main.cpp
@@ -0,0 +1,127 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QCoreApplication>
+#include <QFile>
+#include <QStringList>
+#include <QTextStream>
+#include <QXmlStreamReader>
+
+/*
+ This class exists for the sole purpose of creating a translation context.
+*/
+class XmlStreamLint
+{
+public:
+ Q_DECLARE_TR_FUNCTIONS(XmlStreamLint)
+};
+
+int main(int argc, char *argv[])
+{
+ enum ExitCode
+ {
+ Success,
+ ParseFailure,
+ ArgumentError,
+ WriteError,
+ FileFailure
+ };
+
+ QCoreApplication app(argc, argv);
+
+ QTextStream errorStream(stderr);
+
+ if (argc != 2)
+ {
+ errorStream << XmlStreamLint::tr(
+ "Usage: xmlstreamlint <path to XML file>\n");
+ return ArgumentError;
+ }
+
+ QString inputFilePath(QCoreApplication::arguments().at(1));
+ QFile inputFile(inputFilePath);
+
+ if (!QFile::exists(inputFilePath))
+ {
+ errorStream << XmlStreamLint::tr(
+ "File %1 does not exist.\n").arg(inputFilePath);
+ return FileFailure;
+
+ } else if (!inputFile.open(QIODevice::ReadOnly)) {
+ errorStream << XmlStreamLint::tr(
+ "Failed to open file %1.\n").arg(inputFilePath);
+ return FileFailure;
+ }
+
+ QFile outputFile;
+ if (!outputFile.open(stdout, QIODevice::WriteOnly))
+ {
+ errorStream << XmlStreamLint::tr("Failed to open stdout.");
+ return WriteError;
+ }
+
+//! [0]
+ QXmlStreamReader reader(&inputFile);
+ QXmlStreamWriter writer(&outputFile);
+//! [0]
+
+//! [1]
+ while (!reader.atEnd())
+ {
+ reader.readNext();
+
+ if (reader.error())
+ {
+ errorStream << XmlStreamLint::tr(
+ "Error: %1 in file %2 at line %3, column %4.\n").arg(
+ reader.errorString(), inputFilePath,
+ QString::number(reader.lineNumber()),
+ QString::number(reader.columnNumber()));
+ return ParseFailure;
+//! [1]
+
+//! [2]
+ } else
+ writer.writeCurrentToken(reader);
+ }
+//! [2]
+
+ return Success;
+}
diff --git a/examples/xml/xmlstreamlint/xmlstreamlint.pro b/examples/xml/xmlstreamlint/xmlstreamlint.pro
new file mode 100644
index 0000000000..838ef042ab
--- /dev/null
+++ b/examples/xml/xmlstreamlint/xmlstreamlint.pro
@@ -0,0 +1,12 @@
+CONFIG += console
+QT -= gui
+QT += xml
+SOURCES += main.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml/xmlstreamlint
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS xmlstreamlint.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml/xmlstreamlint
+INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)