YaST Commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
July 2008
- 26 participants
- 870 discussions
[yast-commit] r49474 - in /trunk/devtools: VERSION package/yast2-devtools.changes
by mvidner@svn.opensuse.org 29 Jul '08
by mvidner@svn.opensuse.org 29 Jul '08
29 Jul '08
Author: mvidner
Date: Tue Jul 29 09:41:02 2008
New Revision: 49474
URL: http://svn.opensuse.org/viewcvs/yast?rev=49474&view=rev
Log:
Recommend libtool for svn builds of binary packages.
YDoxygen:
- Updated template Doxyfile to doxygen 1.5.5, enabled built in STL
support.
- Made it easier to troubleshoot by using a real config file instead
of a pipe, pointed out the log (bnc#412465).
Stylesheets for documentation of builtins (and WFM, Pkg):
- Assist a straightforward mapping between source code
usage and reference docs URLs: list::reduce should be
.../ycp/list/reduce.html, not .../YCPListBuiltins_reduce.html.
- Enabled processing multiple chapters at once to make overload
disambiguation possible.
- Minor Docbook validity fixes.
Modified:
trunk/devtools/VERSION
trunk/devtools/package/yast2-devtools.changes
Modified: trunk/devtools/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/devtools/VERSION?rev=49474&r1=49…
==============================================================================
--- trunk/devtools/VERSION (original)
+++ trunk/devtools/VERSION Tue Jul 29 09:41:02 2008
@@ -1 +1 @@
-2.17.3
+2.17.4
Modified: trunk/devtools/package/yast2-devtools.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/devtools/package/yast2-devtools.…
==============================================================================
--- trunk/devtools/package/yast2-devtools.changes (original)
+++ trunk/devtools/package/yast2-devtools.changes Tue Jul 29 09:41:02 2008
@@ -1,4 +1,22 @@
-------------------------------------------------------------------
+Tue Jul 29 09:38:52 CEST 2008 - mvidner(a)suse.cz
+
+- Recommend libtool for svn builds of binary packages.
+- YDoxygen:
+ - Updated template Doxyfile to doxygen 1.5.5, enabled built in STL
+ support.
+ - Made it easier to troubleshoot by using a real config file instead
+ of a pipe, pointed out the log (bnc#412465).
+- Stylesheets for documentation of builtins (and WFM, Pkg):
+ - Assist a straightforward mapping between source code
+ usage and reference docs URLs: list::reduce should be
+ .../ycp/list/reduce.html, not .../YCPListBuiltins_reduce.html.
+ - Enabled processing multiple chapters at once to make overload
+ disambiguation possible.
+ - Minor Docbook validity fixes.
+- 2.17.4
+
+-------------------------------------------------------------------
Fri Jul 18 11:15:53 CEST 2008 - mvidner(a)suse.cz
- The previous change broke the few packages that do not need
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
29 Jul '08
Author: mvidner
Date: Tue Jul 29 09:29:33 2008
New Revision: 49473
URL: http://svn.opensuse.org/viewcvs/yast?rev=49473&view=rev
Log:
install also in subdirs of html
Modified:
trunk/core/libycp/doc/Makefile.am
Modified: trunk/core/libycp/doc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/doc/Makefile.am?rev=…
==============================================================================
--- trunk/core/libycp/doc/Makefile.am (original)
+++ trunk/core/libycp/doc/Makefile.am Tue Jul 29 09:29:33 2008
@@ -6,7 +6,7 @@
htmldir = $(docdir)/libycp
builtin = $(wildcard $(srcdir)/../src/YCPBuiltin*.cc)
xmlfiles = combined.xml
-htmlfiles = $(wildcard html/*.html)
+htmlfiles = $(wildcard html/*.html html/*/*.html)
html_DATA = \
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r49472 - in /trunk/core/libycp/doc: ./ Makefile.am builtins.xml
by mvidner@svn.opensuse.org 29 Jul '08
by mvidner@svn.opensuse.org 29 Jul '08
29 Jul '08
Author: mvidner
Date: Tue Jul 29 09:23:45 2008
New Revision: 49472
URL: http://svn.opensuse.org/viewcvs/yast?rev=49472&view=rev
Log:
Process the docs in one run to be able to disambiguate overloaded
builtins.
Modified:
trunk/core/libycp/doc/ (props changed)
trunk/core/libycp/doc/Makefile.am
trunk/core/libycp/doc/builtins.xml
Modified: trunk/core/libycp/doc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/doc/Makefile.am?rev=…
==============================================================================
--- trunk/core/libycp/doc/Makefile.am (original)
+++ trunk/core/libycp/doc/Makefile.am Tue Jul 29 09:23:45 2008
@@ -5,8 +5,7 @@
htmldir = $(docdir)/libycp
builtin = $(wildcard $(srcdir)/../src/YCPBuiltin*.cc)
-builtinxml := $(builtin:%.cc=%.xml)
-xmlfiles := $(foreach xml,$(builtinxml),$(notdir $(xml)))
+xmlfiles = combined.xml
htmlfiles = $(wildcard html/*.html)
@@ -21,7 +20,7 @@
YDOC := $(shell pkg-config --variable=ybindir yast2-devtools)/ydoc2
RENT := $(shell pkg-config --variable=ybindir yast2-devtools)/replace_entities
$(xmlfiles) : $(builtin)
- $(YDOC) -o $@.tmp ../src/$(subst xml,cc,$@)
+ $(YDOC) -o $@.tmp $^
$(XSLTPROC) $(XSLTPROC_FLAGS) @STYLESHEET_YDOC@ $@.tmp > $@
$(RENT) $@
rm $@.tmp
@@ -40,3 +39,6 @@
install-data-local:
mkdir -p $(DESTDIR)$(htmldir)
cp -a $(srcdir)/html/images $(DESTDIR)$(htmldir)
+
+check-manual:
+ xmllint --noout --valid builtins.xml
Modified: trunk/core/libycp/doc/builtins.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/doc/builtins.xml?rev…
==============================================================================
--- trunk/core/libycp/doc/builtins.xml (original)
+++ trunk/core/libycp/doc/builtins.xml Tue Jul 29 09:23:45 2008
@@ -1,17 +1,8 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"/usr/share/xml/docbook/schema/dtd/4.2/docbookx.dtd"[
-<!ENTITY YCPBuiltinInteger SYSTEM "YCPBuiltinInteger.xml">
-<!ENTITY YCPBuiltinString SYSTEM "YCPBuiltinString.xml">
-<!ENTITY YCPBuiltinMap SYSTEM "YCPBuiltinMap.xml">
-<!ENTITY YCPBuiltinList SYSTEM "YCPBuiltinList.xml">
-<!ENTITY YCPBuiltinPath SYSTEM "YCPBuiltinPath.xml">
-<!ENTITY YCPBuiltinTerm SYSTEM "YCPBuiltinTerm.xml">
-<!ENTITY YCPBuiltinMisc SYSTEM "YCPBuiltinMisc.xml">
-<!ENTITY YCPBuiltinFloat SYSTEM "YCPBuiltinFloat.xml">
-<!ENTITY YCPBuiltinByteblock SYSTEM "YCPBuiltinByteblock.xml">
-
+<!ENTITY combined SYSTEM "combined.xml">
]>
<book>
@@ -37,14 +28,7 @@
<toc>
</toc>
- &YCPBuiltinInteger;
- &YCPBuiltinString;
- &YCPBuiltinMap;
- &YCPBuiltinList;
- &YCPBuiltinPath;
- &YCPBuiltinTerm;
- &YCPBuiltinMisc;
- &YCPBuiltinFloat;
- &YCPBuiltinByteblock;
+
+ &combined;
</book>
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r49471 - /trunk/devtools/docbook/stylesheets/ydoc.xsl
by mvidner@svn.opensuse.org 29 Jul '08
by mvidner@svn.opensuse.org 29 Jul '08
29 Jul '08
Author: mvidner
Date: Tue Jul 29 09:10:38 2008
New Revision: 49471
URL: http://svn.opensuse.org/viewcvs/yast?rev=49471&view=rev
Log:
Changes to assist a straightforward mapping between source code
usage and reference docs URLs: list::reduce should be
.../ycp/list/reduce.html, not .../YCPListBuiltins_reduce.html
- Added a disambiguation chapter to provide links from add.html to
add-list.html and add-map.html
- This requires processing the entire document at once, not
chapter-wise, so adjusted for that too.
- In a @builtin @id, dot "." is used instead of quad "::" to delimit
namespaces. They are output as subdirectories.
Modified:
trunk/devtools/docbook/stylesheets/ydoc.xsl
Modified: trunk/devtools/docbook/stylesheets/ydoc.xsl
URL: http://svn.opensuse.org/viewcvs/yast/trunk/devtools/docbook/stylesheets/ydo…
==============================================================================
--- trunk/devtools/docbook/stylesheets/ydoc.xsl (original)
+++ trunk/devtools/docbook/stylesheets/ydoc.xsl Tue Jul 29 09:10:38 2008
@@ -1,53 +1,93 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
-<!ENTITY undocumented "[DOCS MISSING]">
+<!ENTITY undocumented "">
+<!ENTITY undocumented2 "[DOCS MISSING]">
]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="xml" indent="yes" encoding="ISO-8859-1"/>
+ <xsl:output method="xml" indent="yes" encoding="UTF-8" />
<xsl:template match="/">
<xsl:apply-templates/>
+ <xsl:call-template name="disambiguate" />
</xsl:template>
- <xsl:template match="entries">
- <reference>
- <xsl:attribute name="id">
- <xsl:value-of select="entries_item/filename"/>
- </xsl:attribute>
- <title>
- <xsl:value-of select="entries_item/file_summary"/>
- </title>
- <xsl:for-each select="entries_item">
- <xsl:sort order="ascending" select="./names/names_item"/>
- <xsl:apply-templates select="."/>
- </xsl:for-each>
+
+ <!-- googled "xslt grouping":
+ http://www.jenitennison.com/xslt/grouping/muenchian.html -->
+ <xsl:key name="entries-by-file" match="entries_item" use="filename" />
+ <xsl:key name="entries-by-name" match="entries_item" use="names/names_item" />
+
+ <xsl:template match="yast2doc/entries">
+ <xsl:for-each select="entries_item [
+ count(. | key('entries-by-file', filename)[1]) = 1
+ ]">
+ <xsl:sort select="filename" />
+
+ <reference id="{filename}">
+ <title>
+ <xsl:value-of select="file_summary"/>
+ </title>
+ <xsl:for-each select="key('entries-by-file', filename)">
+ <xsl:sort select="names/names_item"/>
+ <xsl:apply-templates select="."/>
+ </xsl:for-each>
</reference>
+
+ </xsl:for-each>
</xsl:template>
+ <xsl:template name="refentry-id-chunk-meta">
+ <xsl:param name="use-id" select="/.." />
- <xsl:template match="entries_item">
- <refentry>
- <xsl:attribute name="id">
- <xsl:if test="type != 'widget'">
- <xsl:value-of select="filename"/>
- <xsl:text>_</xsl:text>
- </xsl:if>
+ <!-- dirsep must be allowed in IDs -->
+ <xsl:variable name="dirsep">.</xsl:variable>
+ <xsl:variable name="id">
<xsl:choose>
- <xsl:when test="id != ''">
- <xsl:value-of select="id"/>
+ <xsl:when test="$use-id != ''">
+ <xsl:value-of select="$use-id"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="replace-substring">
<xsl:with-param name="from" select="'::'" />
- <xsl:with-param name="to" select="'_'" />
+ <xsl:with-param name="to" select="$dirsep" />
<xsl:with-param name="value" select="names/names_item"/>
</xsl:call-template>
</xsl:otherwise>
- </xsl:choose>
- <xsl:if test="type = 'widget'">
- <xsl:text>_widget</xsl:text>
- </xsl:if>
- </xsl:attribute>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="dir">
+ <xsl:if test="contains($id, $dirsep)">
+ <xsl:value-of select="substring-before($id, $dirsep)" />
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="filename">
+ <xsl:choose>
+ <xsl:when test="contains($id, $dirsep)">
+ <xsl:value-of select="substring-after($id, $dirsep)" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$id" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:attribute name="id">
+ <xsl:value-of select="$id" />
+ </xsl:attribute>
+
+ <!-- produce file names according to yastdoc rules -->
+ <xsl:if test="$dir != ''">
+ <xsl:processing-instruction name="dbhtml">
+ <xsl:text>dir="</xsl:text>
+ <xsl:value-of select="$dir" />
+ <xsl:text>"</xsl:text>
+ </xsl:processing-instruction>
+ </xsl:if>
+ <xsl:processing-instruction name="dbhtml">
+ <xsl:text>filename="</xsl:text>
+ <xsl:value-of select="$filename" />
+ <xsl:text>.html"</xsl:text>
+ </xsl:processing-instruction>
<refmeta>
<refentrytitle>
<xsl:if test="namespace != ''">
@@ -56,8 +96,21 @@
</xsl:if>
<xsl:value-of select="names/names_item"/>
</refentrytitle>
- <manvolnum>3</manvolnum>
+ <manvolnum>
+ <xsl:value-of select="file_summary"/>
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="$filename" />
+ </manvolnum>
</refmeta>
+ </xsl:template>
+
+ <xsl:template match="entries_item">
+
+ <refentry>
+ <xsl:call-template name="refentry-id-chunk-meta">
+ <xsl:with-param name="use-id" select="id" />
+ </xsl:call-template>
+
<refnamediv>
<xsl:for-each select="names/names_item">
<refname>
@@ -378,6 +431,45 @@
</xsl:if>
</xsl:template>
+ <!-- create add.html for add-list.html and add-map.html -->
+ <xsl:template name="disambiguate">
+ <reference id="Disambiguation">
+ <title>Disambiguation</title>
+
+ <!-- id!='' assumes all duplicates have id defined. -->
+ <xsl:for-each select="yast2doc/entries/entries_item [
+ id != '' and
+ count(. | key('entries-by-name', names/names_item)[1]) = 1]">
+ <xsl:sort select="names/names_item" />
+
+ <refentry>
+ <xsl:call-template name="refentry-id-chunk-meta" />
+
+ <refnamediv>
+ <refname>
+ <xsl:value-of select="names/names_item"/>
+ </refname>
+ <refpurpose>disambiguation</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Variants</title>
+ <simplelist>
+ <xsl:for-each select="key('entries-by-name', names/names_item)">
+ <xsl:sort select="id" />
+ <member>
+ <xref linkend="{id}" />
+ </member>
+ </xsl:for-each>
+ </simplelist>
+ </refsect1>
+
+ </refentry>
+
+ </xsl:for-each>
+ </reference>
+ </xsl:template>
+
<xsl:template name="html-replace-entities">
<xsl:param name="text" />
<xsl:param name="attrs" />
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r49470 - in /branches/SuSE-Linux-11_0-Branch/qt-pkg: package/yast2-qt-pkg.changes src/YQPkgObjList.cc
by tgoettlicher@svn.opensuse.org 29 Jul '08
by tgoettlicher@svn.opensuse.org 29 Jul '08
29 Jul '08
Author: tgoettlicher
Date: Tue Jul 29 09:02:50 2008
New Revision: 49470
URL: http://svn.opensuse.org/viewcvs/yast?rev=49470&view=rev
Log:
Fixed bnc #389174: changing packages with keyboard is broken
Modified:
branches/SuSE-Linux-11_0-Branch/qt-pkg/package/yast2-qt-pkg.changes
branches/SuSE-Linux-11_0-Branch/qt-pkg/src/YQPkgObjList.cc
Modified: branches/SuSE-Linux-11_0-Branch/qt-pkg/package/yast2-qt-pkg.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/qt-pkg…
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/qt-pkg/package/yast2-qt-pkg.changes (original)
+++ branches/SuSE-Linux-11_0-Branch/qt-pkg/package/yast2-qt-pkg.changes Tue Jul 29 09:02:50 2008
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Tue Jul 29 08:45:11 CEST 2008 - tgoettlicher(a)suse.de
+
+- Fixed bnc #389174: changing packages with keyboard is broken
+
+-------------------------------------------------------------------
Wed Jun 4 11:46:58 CEST 2008 - sh(a)suse.de
- Added translation marker for "File" menu (bnc #396419)
Modified: branches/SuSE-Linux-11_0-Branch/qt-pkg/src/YQPkgObjList.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/qt-pkg…
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/qt-pkg/src/YQPkgObjList.cc (original)
+++ branches/SuSE-Linux-11_0-Branch/qt-pkg/src/YQPkgObjList.cc Tue Jul 29 09:02:50 2008
@@ -627,13 +627,11 @@
}
else
setCurrentStatus( S_Install );
- selectNextItem();
event->accept();
return;
case Qt::Key_Minus: // Get rid of everything - don't install or delete
setCurrentStatus( installed ? S_Del : S_NoInst );
- selectNextItem();
event->accept();
return;
@@ -641,7 +639,6 @@
if ( ! installed )
setCurrentStatus( S_Taboo );
- selectNextItem();
event->accept();
return;
@@ -649,7 +646,6 @@
if ( installed )
setCurrentStatus( S_Protected );
- selectNextItem();
event->accept();
return;
@@ -657,7 +653,6 @@
if ( installed && item->candidateIsNewer() )
setCurrentStatus( S_Update );
- selectNextItem();
event->accept();
return;
@@ -668,7 +663,6 @@
{
setCurrentStatus( S_KeepInstalled );
}
- selectNextItem();
event->accept();
return;
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r49469 - in /trunk/qt-pkg: package/yast2-qt-pkg.changes src/YQPkgObjList.cc
by tgoettlicher@svn.opensuse.org 29 Jul '08
by tgoettlicher@svn.opensuse.org 29 Jul '08
29 Jul '08
Author: tgoettlicher
Date: Tue Jul 29 08:51:19 2008
New Revision: 49469
URL: http://svn.opensuse.org/viewcvs/yast?rev=49469&view=rev
Log:
Fixed bnc #389174: changing packages with keyboard is broken
Modified:
trunk/qt-pkg/package/yast2-qt-pkg.changes
trunk/qt-pkg/src/YQPkgObjList.cc
Modified: trunk/qt-pkg/package/yast2-qt-pkg.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/package/yast2-qt-pkg.chan…
==============================================================================
--- trunk/qt-pkg/package/yast2-qt-pkg.changes (original)
+++ trunk/qt-pkg/package/yast2-qt-pkg.changes Tue Jul 29 08:51:19 2008
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Tue Jul 29 08:38:41 CEST 2008 - tgoettlicher(a)suse.de
+
+- Fixed bnc #389174: changing packages with keyboard is broken
+
+-------------------------------------------------------------------
Wed Jul 23 16:12:56 CEST 2008 ma(a)suse.de
- Remove references to obsolete freshens dependencies.
Modified: trunk/qt-pkg/src/YQPkgObjList.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQPkgObjList.cc?rev=4…
==============================================================================
--- trunk/qt-pkg/src/YQPkgObjList.cc (original)
+++ trunk/qt-pkg/src/YQPkgObjList.cc Tue Jul 29 08:51:19 2008
@@ -659,13 +659,11 @@
}
else
setCurrentStatus( S_Install );
- selectNextItem();
event->accept();
return;
case Qt::Key_Minus: // Get rid of everything - don't install or delete
setCurrentStatus( installed ? S_Del : S_NoInst );
- selectNextItem();
event->accept();
return;
@@ -673,7 +671,6 @@
if ( ! installed )
setCurrentStatus( S_Taboo );
- selectNextItem();
event->accept();
return;
@@ -681,7 +678,6 @@
if ( installed )
setCurrentStatus( S_Protected );
- selectNextItem();
event->accept();
return;
@@ -689,7 +685,6 @@
if ( installed && item->candidateIsNewer() )
setCurrentStatus( S_Update );
- selectNextItem();
event->accept();
return;
@@ -700,7 +695,6 @@
{
setCurrentStatus( S_KeepInstalled );
}
- selectNextItem();
event->accept();
return;
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
29 Jul '08
Author: lslezak
Date: Tue Jul 29 07:47:48 2008
New Revision: 49468
URL: http://svn.opensuse.org/viewcvs/yast?rev=49468&view=rev
Log:
Created tag stable-2_17_4 for packager
Added:
tags/stable-2_17_4/packager/
- copied from r49467, trunk/packager/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r49467 - in /trunk/packager: VERSION package/yast2-packager.changes yast2-packager.spec.in
by lslezak@svn.opensuse.org 29 Jul '08
by lslezak@svn.opensuse.org 29 Jul '08
29 Jul '08
Author: lslezak
Date: Tue Jul 29 07:47:42 2008
New Revision: 49467
URL: http://svn.opensuse.org/viewcvs/yast?rev=49467&view=rev
Log:
- added yast2-transfer to BuildRequires
- 2.17.4
Modified:
trunk/packager/VERSION
trunk/packager/package/yast2-packager.changes
trunk/packager/yast2-packager.spec.in
Modified: trunk/packager/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/VERSION?rev=49467&r1=49…
==============================================================================
--- trunk/packager/VERSION (original)
+++ trunk/packager/VERSION Tue Jul 29 07:47:42 2008
@@ -1 +1 @@
-2.17.3
+2.17.4
Modified: trunk/packager/package/yast2-packager.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.…
==============================================================================
--- trunk/packager/package/yast2-packager.changes (original)
+++ trunk/packager/package/yast2-packager.changes Tue Jul 29 07:47:42 2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Jul 29 07:10:57 CEST 2008 - lslezak(a)suse.cz
+
+- added yast2-transfer to BuildRequires
+- 2.17.4
+
+-------------------------------------------------------------------
Mon Jul 28 16:41:51 CEST 2008 - lslezak(a)suse.cz
- correctly save the installation repositories at the end of
Modified: trunk/packager/yast2-packager.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/yast2-packager.spec.in?…
==============================================================================
--- trunk/packager/yast2-packager.spec.in (original)
+++ trunk/packager/yast2-packager.spec.in Tue Jul 29 07:47:42 2008
@@ -4,12 +4,16 @@
@HEADER@
BuildRequires: gcc-c++ libxcrypt-devel yast2-country-data yast2-xml perl-XML-Writer update-desktop-files yast2-devtools yast2-testsuite yast2-slp
+# HTTP.ycp
+BuildRequires: yast2-transfer
+
# PackageLock::Connect()
BuildRequires: yast2 >= 2.16.72
# "order" flag for pattern resolvables
BuildRequires: yast2-pkg-bindings >= 2.16.31
+
# Module: OneClickInstallStandard
Requires: perl-XML-Bare yast2-perl-bindings
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r49466 - in /branches/tmp/dmacvicar/yast-xmlui/libyui: examples/ examples/xul/ src/ src/xmlsp/
by dmacvicar@svn.opensuse.org 28 Jul '08
by dmacvicar@svn.opensuse.org 28 Jul '08
28 Jul '08
Author: dmacvicar
Date: Mon Jul 28 18:50:01 2008
New Revision: 49466
URL: http://svn.opensuse.org/viewcvs/yast?rev=49466&view=rev
Log:
initial branch for xul runtime loading code for YUI
some bunch of widgets already working
Added:
branches/tmp/dmacvicar/yast-xmlui/libyui/examples/XULLoad.cc
branches/tmp/dmacvicar/yast-xmlui/libyui/examples/xul/
branches/tmp/dmacvicar/yast-xmlui/libyui/examples/xul/example-1.xul
branches/tmp/dmacvicar/yast-xmlui/libyui/examples/xul/example-widgets.xul
branches/tmp/dmacvicar/yast-xmlui/libyui/src/YUIXULReader.cc
branches/tmp/dmacvicar/yast-xmlui/libyui/src/YUIXULReader.h
branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/
branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/BUGS
branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/Changelog
branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/LICENSE
branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/README
branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/TODO
branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/test1.xml
branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/test2.xml
branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp.cpp
branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp.h
branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_dom.cpp
branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_dom.h
branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_test1.cpp
branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_test2.cpp
branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_test3.cpp
Modified:
branches/tmp/dmacvicar/yast-xmlui/libyui/examples/Makefile.am
branches/tmp/dmacvicar/yast-xmlui/libyui/src/Makefile.am
Modified: branches/tmp/dmacvicar/yast-xmlui/libyui/examples/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/examples/Makefile.am (original)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/examples/Makefile.am Mon Jul 28 18:50:01 2008
@@ -6,6 +6,7 @@
noinst_PROGRAMS = \
HelloWorld \
+ XULLoad \
ComboBox1 \
ComboBox1-editable \
SelectionBox1 \
@@ -16,6 +17,9 @@
HelloWorld_SOURCES = HelloWorld.cc
HelloWorld_LDADD = -L$(top_srcdir)/src -lyui
+XULLoad_SOURCES = XULLoad.cc
+XULLoad_LDADD = -L$(top_srcdir)/src -lyui
+
ComboBox1_SOURCES = ComboBox1.cc
ComboBox1_LDADD = -L$(top_srcdir)/src -lyui
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/examples/XULLoad.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/examples/XULLoad.cc (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/examples/XULLoad.cc Mon Jul 28 18:50:01 2008
@@ -0,0 +1,20 @@
+// Trivial libyui example.
+//
+// Compile with:
+//
+// g++ -I/usr/include/YaST2/yui -lyui HelloWorld.cc -o HelloWorld
+
+#include "YUI.h"
+#include "YUIXULReader.h"
+
+#include "YWidgetFactory.h"
+#include "YDialog.h"
+#include "YLayoutBox.h"
+#include "YEvent.h"
+
+int main( int argc, char **argv )
+{
+ YDialog *dialog = YUIXULReader::readDialogFromFile( argv[1] );
+ dialog->waitForEvent();
+ dialog->destroy();
+}
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/examples/xul/example-1.xul
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/examples/xul/example-1.xul (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/examples/xul/example-1.xul Mon Jul 28 18:50:01 2008
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+
+<window id="vbox example" title="Example"
+xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+<vbox>
+ <button id="yes" label="Yes"/>
+ <button id="no" label="No"/>
+ <hbox>
+ <button id="maybe" label="Maybe"/>
+ <checkbox id="foo" label="Activated"/>
+ </hbox>
+</vbox>
+
+</window>
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/examples/xul/example-widgets.xul
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/examples/xul/example-widgets.xul (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/examples/xul/example-widgets.xul Mon Jul 28 18:50:01 2008
@@ -0,0 +1,101 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+<groupbox flex="1">
+ <caption label="Widgets"/>
+
+ <toolbar id="toolbarid">
+ <toolbarbutton id="toolid" label="Toolbar Button" oncommand="{action}" tooltiptext="{tooltip}"/>
+
+ </toolbar>
+ <progressmeter mode="determined" value="75"/>
+ <hbox>
+ <vbox flex="0">
+ <checkbox label="checkbox"/>
+ <checkbox label="checkbox"/>
+
+ </vbox>
+ <radiogroup flex="0">
+ <radio label="radio button" selected="true"/><radio label="radio button" selected="false"/>
+ <radio label="radio button" selected="false"/>
+ </radiogroup>
+
+ </hbox>
+ <hbox>
+ <menulist>
+ <menupopup>
+ <menuitem value="{item value}" label="Dropdown List"/>
+ <menuitem value="{item value}" label="Another Item"/>
+ <menuseparator/>
+ <menuitem value="{item value}" label="After Separator"/>
+ </menupopup>
+ </menulist>
+ <button label="Plain Button" flex="0"/>
+ </hbox>
+
+</groupbox>
+
+<groupbox flex="1">
+ <caption label="Text Controls"/>
+
+ <hbox>
+ <description control="multilineTextbox" value="Label"/>
+ <textbox multiline="true" id="multilineTextbox" value="Multiline Text box"/>
+
+ <listbox rows="4">
+ <listitem value="{item value}" label="Listbox item"/>
+ <listitem value="{item value}" label="item label"/>
+ </listbox>
+
+ </hbox>
+
+</groupbox>
+
+<groupbox flex="2">
+ <caption label="Containers"/>
+ <label value="Tabs on top and tabs on left:"/>
+ <hbox>
+ <tabbox id="tabboxid" flex="1">
+ <tabs>
+ <tab label="Tab 1"/>
+ <tab label="Tab 2"/>
+ </tabs>
+ <tabpanels flex="1">
+ <tabpanel><label value="Tab 1 content"/></tabpanel>
+ <tabpanel><label value="Tab 2 content"/></tabpanel>
+ </tabpanels>
+ </tabbox>
+ <splitter/>
+ <tabbox id="tabbox2" orient="horizontal" flex="1">
+ <tabs orient="vertical">
+ <tab label="Tab 1"/>
+ <tab label="Tab 2"/>
+ </tabs>
+ <tabpanels flex="1">
+ <tabpanel><label value="Tab 1 content"/></tabpanel>
+ <tabpanel><label value="Tab 2 content"/></tabpanel>
+ </tabpanels>
+ </tabbox>
+ </hbox>
+ <vbox>
+ <label value="Tabs on bottom:"/>
+ <tabbox id="tabbox3" flex="1" dir="reverse">
+ <tabs>
+ <tab label="Tab 1"/>
+ <tab label="Tab 2"/>
+ </tabs>
+ <tabpanels flex="1">
+ <tabpanel><label value="Tab 1 content"/></tabpanel>
+ <tabpanel><label value="Tab 2 content"/></tabpanel>
+ </tabpanels>
+
+ </tabbox>
+ </vbox>
+</groupbox>
+
+<statusbar>
+ <spacer flex="0" width="2"/>
+ <statusbarpanel id="panelid" label="Statusbar Panel"/>
+ <statusbarpanel id="panel2" label="flexible panel" flex="1"/>
+</statusbar>
+</window>
Modified: branches/tmp/dmacvicar/yast-xmlui/libyui/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/Makefile.am (original)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/Makefile.am Mon Jul 28 18:50:01 2008
@@ -88,9 +88,11 @@
\
FSize.cc \
YStringTree.cc \
- YRpmGroupsTree.cc
-
-
+ YRpmGroupsTree.cc \
+ \
+ YUIXULReader.cc \
+ xmlsp/xmlsp.cpp \
+ xmlsp/xmlsp_dom.cpp
pkgincludedir = $(includedir)/yui
@@ -179,7 +181,8 @@
TreeItem.h \
YRpmGroupsTree.h \
YStringTree.h \
- YTransText.h
+ YTransText.h \
+ YUIXULReader.h
CLEANFILES = libyui.kdoc $(BUILT_SOURCES)
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/YUIXULReader.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/YUIXULReader.cc (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/YUIXULReader.cc Mon Jul 28 18:50:01 2008
@@ -0,0 +1,682 @@
+
+#include <sstream>
+#include <fstream>
+#include <iostream>
+#include "xmlsp/xmlsp_dom.h"
+
+#include "YUI.h"
+
+#define YUILogComponent "YUIXULReader"
+#include "YUILog.h"
+
+#include "YWidgetFactory.h"
+#include "YItem.h"
+#include "YWidgetID.h"
+#include "YImage.h"
+#include "YDialog.h"
+#include "YLayoutBox.h"
+#include "YFrame.h"
+#include "YCheckBox.h"
+#include "YIntField.h"
+#include "YInputField.h"
+#include "YMultiLineEdit.h"
+#include "YPushButton.h"
+#include "YRadioButton.h"
+#include "YRadioButtonGroup.h"
+#include "YSelectionBox.h"
+#include "YMultiSelectionBox.h"
+#include "YLabel.h"
+
+#include "YUIXULReader.h"
+
+using namespace std;
+using namespace XMLSP;
+
+/**
+ * Widget ID class based on string.
+ **/
+class StringWidgetID: public YWidgetID
+{
+public:
+ /**
+ * Constructor.
+ **/
+ StringWidgetID( const string &value )
+ : _value(value)
+ {}
+
+ /**
+ * Check if this ID is equal to another.
+ *
+ * Reimplemented from YWidgetID.
+ **/
+ virtual bool isEqual( YWidgetID * otherID ) const
+ { return otherID->toString() == _value; }
+
+ /**
+ * Convert the ID value to string.
+ * Used for logging and debugging.
+ *
+ * Reimplemented from YWidgetID.
+ **/
+ virtual string toString() const
+ { return _value; }
+private:
+ string _value;
+};
+
+
+string dumpAttributes(XMLSP::DOMElement* e)
+{
+ stringstream s;
+ XMLSP::DOMStringList list = e->getAttributeList();
+ XMLSP::DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++) {
+ s<<" "<<*i<<"=\""<<e->getAttribute(*i)<<"\"";
+ }
+ return s.str();
+}
+
+
+void dumpElement(XMLSP::DOMElement* e, int depth)
+{
+ string p1, p2;
+ XMLSP::DOMElements els;
+ XMLSP::DOMElements::iterator i;
+
+
+ p1.assign((depth-1)*4, ' ');
+ p2.assign(depth*4, ' ');
+
+ cout<<p1<<"[element] {"<<endl;
+ cout<<p2<<"name: "<<e->getElementName()<<endl;
+ if (e->attributeCount())
+ cout<<p2<<"attributes:"<<dumpAttributes(e)<<endl;
+
+
+ if (e->hasChilds()) {
+ cout<<p2<<"childs count: "<<e->childCount()<<endl;
+
+ els = e->getChilds();
+ for(i = els.begin(); i != els.end(); i++) {
+ dumpElement(*i, depth+1);
+ }
+ } else if (e->getCData().size()) {
+ cout<<p2<<"cdata: "<<e->getCData()<<endl;
+ }
+
+
+ cout<<p1<<"}"<<endl;
+}
+
+inline int convertToInt(const std::string& s)
+{
+ std::istringstream i(s);
+ int x;
+ if (!(i >> x))
+ YUI_THROW(YUIException("can't convert string \"" + s + "\" to integer"));
+ return x;
+}
+
+// forward declarations
+static YWidget * parseLabel( YWidget *parent, DOMElement *root );
+static YWidget * parseListbox( YWidget *parent, DOMElement *root );
+static YWidget * parseRadioGroup( YWidget *parent, DOMElement *root );
+static YWidget * parseRadio( YWidget *parent, DOMElement *root );
+static YWidget * parseCaption( YWidget *parent, DOMElement *root );
+static YWidget * parseGroupbox( YWidget *parent, DOMElement *root );
+static YWidget * parseTextbox( YWidget *parent, DOMElement *root );
+static YWidget * parseImage( YWidget *parent, DOMElement *root );
+static YWidget * parseButton( YWidget *parent, DOMElement *root );
+static YWidget * parseCheckbox( YWidget *parent, DOMElement *root );
+static YWidget * parseHBox( YWidget *parent, DOMElement *root );
+static YWidget * parseVBox( YWidget *parent, DOMElement *root );
+static YWidget * parseWindow( YWidget *parent, DOMElement *root );
+static YWidget * parseNode( YWidget *parent, DOMElement *root );
+static void parseChildren( YWidget *parent, DOMElement *root );
+static YItemCollection parseItemList( YWidget *parent, DOMElement *root );
+static YItem parseItem( YWidget *parent, DOMElement *root );
+
+static YItem
+parseItem( YWidget *parent, DOMElement *root )
+{
+ if ( root->getElementName() != "listitem" )
+ {
+ YUI_THROW(YUIException("Invalid item '" + root->getElementName() + "'"));
+ }
+
+ string label;
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "label" )
+ label = root->getAttribute(*i);
+ }
+
+ YItem item(label);
+ return item;
+}
+
+
+static YItemCollection
+parseItemList( YWidget *parent, DOMElement *root )
+{
+ YItemCollection itemCollection;
+ itemCollection.reserve( root->childCount() );
+
+ try
+ {
+ DOMElements els;
+ DOMElements::iterator i;
+
+ if (root->hasChilds())
+ {
+ els = root->getChilds();
+ for(i = els.begin(); i != els.end(); i++)
+ {
+ YItem item = parseItem( parent, *i );
+ }
+ }
+ }
+ catch ( YUIException & exception )
+ {
+ // Delete all items created so far
+ YItemIterator it = itemCollection.begin();
+
+ while ( it != itemCollection.end() )
+ {
+ YItem * item = *it;
+ ++it;
+ delete item;
+ }
+ throw;
+ }
+ return itemCollection;
+}
+
+static YWidget *
+parseLabel( YWidget *parent, DOMElement *root )
+{
+ string value;
+ bool isOutputField = false;
+ bool isHeading = false;
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "value" )
+ value = root->getAttribute(*i);
+ }
+ YLabel * label = YUI::widgetFactory()->createLabel( parent, value, isHeading, isOutputField );
+ return label;
+}
+
+static YWidget *
+parseListbox( YWidget *parent, DOMElement *root )
+{
+ string seltype = "single";
+
+ // FIXME XUL has no label here
+ string label;
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "seltype" )
+ seltype = root->getAttribute(*i);
+ }
+
+ if ( seltype == "multiple" )
+ {
+ YMultiSelectionBox * mselBox = YUI::widgetFactory()->createMultiSelectionBox( parent, label );
+ mselBox->addItems( parseItemList( mselBox, root ) );
+ return mselBox;
+ }
+ else
+ {
+ YSelectionBox *selBox = YUI::widgetFactory()->createSelectionBox( parent, label );
+ selBox->addItems( parseItemList( selBox, root ) );
+ return selBox;
+ }
+}
+
+static YWidget *
+parseRadioGroup( YWidget *parent, DOMElement *root )
+{
+ // vertical by default
+ string orient = "vertical";
+
+ YRadioButtonGroup * radioButtonGroup = YUI::widgetFactory()->createRadioButtonGroup( parent );
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "orient" )
+ orient = root->getAttribute(*i);
+ }
+
+ YLayoutBox *box;
+
+ if ( orient == "horizontal" )
+ box = YUI::widgetFactory()->createHBox(radioButtonGroup);
+ else
+ box = YUI::widgetFactory()->createVBox(radioButtonGroup);
+
+ parseChildren( box, root );
+
+ return radioButtonGroup;
+}
+
+static YWidget *
+parseRadio( YWidget *parent, DOMElement *root )
+{
+ string label;
+ string value;
+ bool selected = false;
+ bool disabled = false;
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "selected" )
+ selected = ( root->getAttribute(*i) == "true" );
+ if ( *i == "label" )
+ label = root->getAttribute(*i);
+ if ( *i == "disabled" )
+ disabled = ( root->getAttribute(*i) == "true" );
+ }
+
+ YRadioButton * radioButton = YUI::widgetFactory()->createRadioButton( parent, label, selected );
+ return radioButton;
+}
+
+
+
+/**
+ * Sets the caption of a groupbox
+ * <caption label="..."/>
+ */
+static YWidget * parseCaption( YWidget *parent, DOMElement *root )
+{
+ return 0L;
+}
+
+/**
+ * parses a YFrame from XUL
+ * <groupbox>
+ * <caption label="Network"/>
+ * </groupbox>
+ */
+static YWidget *
+parseGroupbox( YWidget *parent, DOMElement *root )
+{
+ // FIXME children <caption> sets the label
+ string label;
+
+ // vertical by default
+ string orient = "vertical";
+
+ YFrame * frame = YUI::widgetFactory()->createFrame( parent, label );
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "orient" )
+ orient = root->getAttribute(*i);
+ }
+
+ YLayoutBox *box;
+
+ if ( orient == "horizontal" )
+ box = YUI::widgetFactory()->createHBox(frame);
+ else
+ box = YUI::widgetFactory()->createVBox(frame);
+
+ parseChildren( box, root );
+
+ return frame;
+}
+
+/**
+ * parses a YIntField from XUL
+ * <textbox type="..."/>
+ */
+static YWidget *
+parseTextbox( YWidget *parent, DOMElement *root )
+{
+ // type of textbox
+ string type = "normal";
+
+ // for type number
+ int min = 0;
+ int max = 0;
+ int int_value = 0;
+
+ // for normal type
+ bool multiline = false;
+ string value;
+
+ // FIXME
+ string label;
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "type" )
+ type = root->getAttribute(*i);
+ if ( *i == "multiline" )
+ multiline = ( root->getAttribute(*i) == "true" );
+ if ( *i == "max" )
+ max = convertToInt(root->getAttribute(*i));
+ if ( *i == "min" )
+ min = convertToInt(root->getAttribute(*i));
+ }
+
+ if ( type == "number" )
+ {
+ if ( !value.empty() )
+ int_value = convertToInt(value);
+ return YUI::widgetFactory()->createIntField( parent, label, min, max, int_value );
+ }
+ else if ( type == "password" )
+ {
+ return YUI::widgetFactory()->createInputField( parent, label, true );
+ }
+ else
+ {
+ if ( multiline )
+ {
+ YMultiLineEdit *edit = YUI::widgetFactory()->createMultiLineEdit( parent, label );
+ if ( ! value.empty() )
+ edit->setValue( value );
+ return edit;
+ }
+
+ return YUI::widgetFactory()->createInputField( parent, label, false );
+ }
+
+ return 0L;
+}
+
+/**
+ * parses a YImage from XUL
+ * <image src="start.png"/>
+ */
+static YWidget *
+parseImage( YWidget *parent, DOMElement *root )
+{
+ string imageFileName;
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "src" )
+ imageFileName = root->getAttribute(*i);
+ }
+
+ YImage *image = YUI::widgetFactory()->createImage( parent, imageFileName, false);
+ return image;
+}
+
+
+/**
+ * parses a YPushCheckBox from XUL
+ * <checkbox>
+ */
+static YWidget *
+parseCheckbox( YWidget *parent, DOMElement *root )
+{
+ bool checked = false;
+ string label;
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "checked" )
+ checked = ( root->getAttribute(*i) == "true" );
+ if ( *i == "label" )
+ label = root->getAttribute(*i);
+ }
+
+ YCheckBox *checkbox = YUI::widgetFactory()->createCheckBox( parent, label, checked );
+ return checkbox;
+}
+
+/**
+ * parses a YPushButton from XUL
+ * <button>
+ */
+static YWidget *
+parseButton( YWidget *parent, DOMElement *root )
+{
+ string label;
+ string iconname;
+
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "label" )
+ label = root->getAttribute(*i);
+ }
+
+ YPushButton *button = YUI::widgetFactory()->createPushButton( parent, label );
+ return button;
+}
+
+/**
+ * parses a YLayoutBox from XUL
+ * <hbox>
+ */
+static YWidget *
+parseHBox( YWidget *parent, DOMElement *root )
+{
+ YLayoutBox *hbox = YUI::widgetFactory()->createHBox(parent);
+
+ parseChildren( hbox, root );
+
+ return hbox;
+}
+
+/**
+ * parses a YLayoutBox from XUL
+ * <vbox>
+ */
+static YWidget *
+parseVBox( YWidget *parent, DOMElement *root )
+{
+ YLayoutBox *vbox = YUI::widgetFactory()->createVBox(parent);
+
+ parseChildren( vbox, root );
+
+ return vbox;
+}
+
+/**
+ * parses a YDialog from XUL
+ * <window>
+ */
+static YWidget *
+parseWindow( YWidget *parent, DOMElement *root )
+{
+ string orient = "horizontal";
+
+ YDialog *dialog = YUI::widgetFactory()->createPopupDialog();
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "orient" )
+ orient = root->getAttribute(*i);
+ }
+
+ // YUI dialogs can only have one children
+ // so we wrap them in a box if there are
+ // more, using the orient attribute
+ if ( root->childCount() > 1 )
+ {
+ YLayoutBox *box;
+
+ if ( orient == "vertical" )
+ box = YUI::widgetFactory()->createVBox(dialog);
+ else
+ box = YUI::widgetFactory()->createHBox(dialog);
+
+ parseChildren( box, root );
+ }
+ else
+ parseChildren( dialog, root );
+
+ return dialog;
+}
+
+/**
+ * iterates over all children and parses them
+ */
+static void
+parseChildren( YWidget *parent, DOMElement *root )
+{
+ DOMElements els;
+ DOMElements::iterator i;
+
+ if (root->hasChilds())
+ {
+ els = root->getChilds();
+ for(i = els.begin(); i != els.end(); i++)
+ {
+ parseNode( parent, *i );
+ }
+ }
+}
+
+/**
+ * Find out which parser function to call
+ * given the element
+ *
+ * also sets the widget basic properties
+ * like id.
+ */
+static YWidget *
+parseNode( YWidget *parent, DOMElement *root )
+{
+ string name = root->getElementName();
+ YWidget *w = 0L;
+
+ if ( name == "window" )
+ w = parseWindow( parent, root );
+ else if ( name == "label" )
+ w = parseLabel( parent, root );
+ else if ( name == "listbox" )
+ w = parseListbox( parent, root );
+ else if ( name == "radio" )
+ w = parseRadio( parent, root );
+ else if ( name == "radiogroup" )
+ w = parseRadioGroup( parent, root );
+ else if ( name == "groupbox" )
+ w = parseGroupbox( parent, root );
+ //else if ( name == "caption" )
+ // w = parseCaption( parent, root );
+ else if ( name == "textbox" )
+ w = parseTextbox( parent, root );
+ else if ( name == "image" )
+ w = parseImage( parent, root );
+ else if ( name == "checkbox" )
+ w = parseCheckbox( parent, root );
+ else if ( name == "button" )
+ w = parseButton( parent, root );
+ else if ( name == "hbox" )
+ w = parseHBox( parent, root );
+ else if ( name == "vbox" )
+ w = parseVBox( parent, root );
+
+ if ( ! w )
+ {
+ yuiError() << "widget `" << name << "' not supported" << endl;
+// YUI_THROW(YUIException("widget '" + name + "' not supported"));
+ }
+ else
+ {
+
+ // set the id of the widget
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "id" )
+ w->setId( new StringWidgetID(root->getAttribute(*i)) );
+ }
+ }
+
+ return w;
+}
+
+
+YDialog *
+YUIXULReader::readDialogFromFile( const string &filename )
+{
+ FILE * pFile;
+ long lSize;
+ char * buffer;
+ size_t result;
+
+ pFile = fopen ( filename.c_str() , "rb" );
+ if (pFile==NULL)
+ YUI_THROW(YUIException("File error"));
+
+ // obtain file size:
+ fseek (pFile , 0 , SEEK_END);
+ lSize = ftell (pFile);
+ rewind (pFile);
+
+ // allocate memory to contain the whole file:
+ buffer = (char*) malloc (sizeof(char)*lSize);
+ if (buffer == NULL)
+ YUI_THROW(YUIException("Memory error"));
+
+ // copy the file into the buffer:
+ result = fread (buffer,1,lSize,pFile);
+ if (result != (size_t) lSize)
+ YUI_THROW(YUIException("Reading error"));
+
+ /* the whole file is now loaded in the memory buffer. */
+
+ DOMElement* root;
+ root = DOMElement::loadXML(buffer);
+ if (root == NULL)
+ {
+
+ YUI_THROW(YUIException("Failed to parse dialog from xml file" + DOMElement::getLastError()));
+
+ }
+ else
+ {
+ YWidget *w = parseNode( 0L, root );
+
+ YDialog *dialog = dynamic_cast<YDialog *>(w);
+ if ( ! dialog )
+ {
+ YUI_THROW(YUINoDialogException());
+ }
+
+ delete root;
+ return dialog;
+ }
+
+ // terminate
+ fclose (pFile);
+ free (buffer);
+
+ return 0L;
+}
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/YUIXULReader.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/YUIXULReader.h (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/YUIXULReader.h Mon Jul 28 18:50:01 2008
@@ -0,0 +1,30 @@
+
+#ifndef YUIXULReader_h
+#define YUIXULReader_h
+
+#include <string>
+
+class YDialog;
+
+/**
+ * Build YUI dialogs from XUL (http://www.mozilla.org/projects/xul/)
+ * descriptions.
+ *
+ *
+ */
+class YUIXULReader
+{
+ public:
+ /**
+ * Reads a YUI dialog from a XUL file
+ *
+ * 'filename' : the .xul file to read
+ *
+ * throws YUINoDialogException if the file does not
+ * contain a dialog.
+ */
+ static YDialog * readDialogFromFile( const std::string &filename );
+};
+
+
+#endif
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/BUGS
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/BUGS (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/BUGS Mon Jul 28 18:50:01 2008
@@ -0,0 +1,4 @@
+Known bugs:
+- on_tag_start() has StringMap passed by reference without const keyword, it won't be corrected because
+ everyone would have to change StringMap::iterator to StringMap::const_iterator.
+- <![CDATA[ uses parts of <!DOCTYPE detection, this should be fixed.
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/Changelog
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/Changelog (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/Changelog Mon Jul 28 18:50:01 2008
@@ -0,0 +1,49 @@
+version 1.0
+2008-07-22:
+ - Fixed conflict with some libc errno marco, thanks to Toby (baron162)
+ - Fixed string passing in many functions, requires modification in
+ Parser::on_error(), Parser::on_tag_close(), Parser::on_cdata(),
+ Parser::on_tag_open(), Parser::on_comment(), Parser::on_processing()
+ and Parser::on_doctype().
+ - Fixed some typos.
+
+
+version 0.5.1
+2007-12-05: Przemyslaw Grzywacz
+ - Fixed warings about char* to std::string conversion in report().
+ Bugs reported by Mariano Simone:
+ - Fixed bug when tags like "<abc/>" were reported with it's parent name.
+ - Added new sample XML (test2.xml) to test bug fix.
+
+
+version 0.5
+2007-06-29: Przemyslaw Grzywacz
+ - Added simple DOM parser
+ - Added xmlsp_test3 DOM test
+ - Fixed std::* types to DOM types (except strings)
+
+2007-06-28: Przemyslaw Grzywacz
+ - Added basic DOM interface (xmlsp_dom)
+
+
+version 0.4
+2007-05-31: Przemyslaw Grzywacz
+ - Added option to skip reporting CDATA composed only of ' ', \t, \n and \r
+ - Added a sample XML file to test with xmlsp_test2 program
+ - Change in xmlsp_test2, now it use set_skip_whitespaces(true)
+ - Fixed bug in <![CDATA[]]> handling
+
+
+version 0.3
+2007-05-24: Przemyslaw Grzywacz
+ - Added xmlsp_test2.cpp to help test XML files
+ Bugs reported by Lew Raymond:
+ - Fixed passing attributes of previouse tags
+ - Fixed parsing tags without attributes
+ - Fixed false errors on closing tags
+
+
+version 0.2
+2007-04-30: Przemyslaw Grzywacz
+ - Fixed some compile time warning (when compiling with g++ -Wall)
+
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/LICENSE
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/LICENSE (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/LICENSE Mon Jul 28 18:50:01 2008
@@ -0,0 +1,24 @@
+Copyright (c) 2007, Przemyslaw Grzywacz
+All rights reserved.
+
+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 Przemyslaw Grzywacz 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 Przemyslaw Grzywacz ``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 Przemyslaw Grzywacz 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.
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/README
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/README (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/README Mon Jul 28 18:50:01 2008
@@ -0,0 +1,147 @@
+TOC:
+1. About
+2. Usage
+3. Entities
+4. Character set support
+5. UTF-8
+6. XMLSP DOM interface
+7. Upgrading to 1.0
+8. License
+9. Author
+10. Final notes
+
+
+1. About
+
+XMLSP is a non-validating XML parser design to be VERY small and to contain
+only a minimum set of features (what is realy needed to parse a simple XML
+file).
+
+XMLSP can parse tags, attributes, cdata, comments, processing instructions,
+doctypes (partialy).
+
+XMLSP won't even try to understand anything other than tags and attributes
+or namespaces. So if you need more advanced XML features, try something else.
+
+
+
+2. Usage
+
+To use it, you must derive from XMLSP::Parser and implement on_* functions which
+you are interested in.
+
+A simple example is given in xmlsp_test1.cpp how to use this parser.
+
+If you want to use stream parsing (unlike in the example, where the entire
+document is parsed at once), you may do it like this:
+
+ // initialize parsing
+ parser.begin();
+ while(!s.eof()) {
+ s.read(buffer);
+ if (parser.parse_chunk(string(buffer)) == false) {
+ // error
+ }
+ }
+ if (parser.end()) {
+ // ok
+ } else {
+ // error
+ }
+
+
+
+3. Entities
+
+XMLSP supports 1 byte entities in decimal and hex forms:
+
+ ‘
+ &xb0;
+
+By default, the parser supports the following entities: < > & '
+". You may add more entites using Parser::add_entity(name, value):
+
+ parser.add_entity("nbsp", 160);
+
+
+
+4. Character set support
+
+XMLSP, due to it's size, is not aware of things like character sets. It should
+work however with all 8bit character sets (ISO-8859-1, ISO-8859-2, CP1250, ...)
+and will always understand ASCII tag and attribute names.
+
+Using locales, you may allow the parser to understand international characters
+in tag and attribute names.
+
+
+
+5. UTF-8
+
+If my understanding of UTF-8 is correct, it was design in such way, to be
+compatible with ASCII, so there shouldn't be any problem if UTF-8 multibyte
+characters are used only in attribute values and CDATA.
+
+
+
+6. XMLSP DOM interface
+
+DOM interface (xmlsp_dom) is an optional addon to XMLSP which provide a simple
+DOM tree classes. XMLSP::DOMElement::loadXML() uses XMLSP::Parser to parse
+source XML files.
+
+Since this DOM implementation must be small and simple, there is no document
+root class, nor any comments and processing instruction support. If I hear
+request for a more complete DOM, I will write xmlsp_dom2 with more features.
+
+Please note that the DOM interface is very young and untested, so is may
+contain many bugs (or even don't work at all). If you find any bug, please
+report them to me.
+
+NOTE: Actualy, by now, I used the DOM interface in many projects and I think it
+should be quite stable now.
+
+
+
+7. Upgrading to 1.0
+
+Passing from version 0.5.1 to 1.0, XMLSP::Parser lost soucecode compatibility
+with previouse versions. This is mainly the fault of my lazyness when I
+initialy wrote it. Going to final version 1.0, I had to correct some of the
+existing code.
+
+The simplest way to upgrade is to copy XMLSP::Parser::on_XXX function
+declarations to your parser and compile you program. The compiler will show
+you then all the code you must correct (mainly related to
+std::string => const std::string& convertion).
+
+
+XMLSP::DOM interface was modified too, but this doesn't brake source
+compatibility.
+
+
+
+8. License
+
+Since I created this library because I couldn't find something like that
+with a non-restrictive license, I distribute this library under BSD license.
+
+See source/header files for more details.
+
+
+
+9. Author
+
+It's me, Przemyslaw Grzywacz. If you have any questions, suggestions or
+you found a bug, you may contact me throught SourceForge project page:
+
+ http://sourceforge.net/projects/xmlsp
+
+
+
+10. Final notes
+
+That's all, enjoy this XML parser, which is 20 times smaller than libxml2
+header files :)
+
+
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/TODO
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/TODO (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/TODO Mon Jul 28 18:50:01 2008
@@ -0,0 +1,4 @@
+- Change detection of CDATA block so it doesn't use M_DOCTYPE status.
+- Implement DOMElement::getXML() to produce XML string from DOM tree.
+- Implement some basic xpath for DOM.
+- Write documentation.
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/test1.xml
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/test1.xml (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/test1.xml Mon Jul 28 18:50:01 2008
@@ -0,0 +1,29 @@
+<!DOCTYPE whatever PUBLIC "-//blah//EN"
+ "http://somedomain/somexml.dtd">
+<?xml version="1.0"?>
+<document>
+ <info>
+ <description>This XML file is here to test "XMLSP" parser</description>
+ <long><![CDATA[This long text
+ checks if CDATA blocks
+ are parsed correctly]]>
+ <!-- white spaces -->
+ </long>
+ <date>
+ <!-- sorry, no date info -->
+ </date>
+ <version></version>
+ </info>
+ <attributes>
+ <attr name="style" value="custom" />
+ <attr name="class" value="abc"></attr>
+ <attr name="text">
+ This text is a multiline test
+ to check if the parser can
+ handle it without any problems
+ <!-- and some comment -->
+ </attr>
+ </attributes>
+ <!-- That is all for now -->
+</document>
+<!-- EOF -->
\ No newline at end of file
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/test2.xml
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/test2.xml (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/test2.xml Mon Jul 28 18:50:01 2008
@@ -0,0 +1,10 @@
+<hello>
+<a>
+<b></b>
+<c>
+<e/>
+<f />
+<d></d>
+</c>
+</a>
+</hello>
\ No newline at end of file
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp.cpp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp.cpp (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp.cpp Mon Jul 28 18:50:01 2008
@@ -0,0 +1,555 @@
+// Copyright (c) 2007, Przemyslaw Grzywacz
+// All rights reserved.
+//
+// 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 Przemyslaw Grzywacz 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 Przemyslaw Grzywacz ``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 Przemyslaw Grzywacz 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.
+
+
+#include <cstdlib>
+#include <sstream>
+#include "xmlsp.h"
+
+
+//===================================================================
+
+namespace XMLSP {
+
+ //===================================================================
+ // status codes
+ enum {
+ M_TOP = 0,
+ M_TEXT,
+ M_ENTITY,
+ M_OPEN_TAG,
+ M_CLOSE_TAG,
+ M_START_TAG,
+ M_ATTR_LVALUE,
+ M_ATTR_EQUAL,
+ M_ATTR_RVALUE,
+ M_IN_TAG,
+ M_SINGLE_TAG,
+ M_COMMENT,
+ M_COMMENT_DOCTYPE,
+ M_COMMENT_START,
+ M_DOCTYPE,
+ M_PROCESSING,
+ M_CDATA
+ };
+
+ //===================================================================
+
+ bool Parser::begin()
+ {
+ if (!on_document_begin()) return false;
+
+ attributes_temp.clear();
+ while(tag_stack.size()) tag_stack.pop();
+ last_char = 0;
+ before_last_char = 0;
+ text_buffer1 = "";
+ text_buffer2 = "";
+ current_tag = "";
+ entity_buffer = "";
+ status_parse = M_TOP;
+ current_line = 1;
+ current_col = 0;
+ status_new_line = false;
+ status_had_root = false;
+
+ return true;
+ }
+
+
+ //===================================================================
+
+
+ Parser::~Parser()
+ {
+
+ }
+
+
+ //===================================================================
+
+ #define STATE_PUSH status_stack = status_parse;
+ #define STATE_POP status_parse = status_stack;
+
+ #define ENDS(c1) (last_char == c1)
+ #define ENDS2(c1, c2) (before_last_char == c1 && last_char == c2)
+
+ #define IS_SPACE(c) (c == ' ' || c == '\n' || c == '\t')
+ #define IS_LABEL(c) (isalnum(c) || c == '-' || c == '_' || c == '.' || c == ':')
+ bool Parser::parse_chunk(const std::string& xml)
+ {
+ int c, i, l;
+ l = xml.size();
+ for(i = 0; i < l; i++) {
+ c = xml.at(i);
+
+ // Normalize all possible newlines to "\n"
+ if(c == '\n' && status_new_line) {
+ status_new_line = false;
+ continue;
+ } else if(status_new_line) {
+ status_new_line = false;
+ } else if(c == '\n') {
+ current_line++;
+ current_col = 0;
+ } else if(c == '\r') {
+ status_new_line = true;
+ c = '\n';
+ current_line++;
+ current_col = 0;
+ } else {
+ current_col++;
+ }
+
+
+ if (status_parse == M_TOP) {
+ if (c == '<') {
+ status_parse = M_START_TAG;
+ } else if (!IS_SPACE(c)) {
+ report(E_UNEXPECTED_CDATA, "Unexpected character outside tag");
+ return false;
+ }
+ } else if (status_parse == M_START_TAG) {
+ if (c == '?' && tag_stack.size() == 0) {
+ // allowed only at top level
+ status_parse = M_PROCESSING;
+ } else if (c == '!') {
+ // comment or doctype
+ status_parse = M_COMMENT_DOCTYPE;
+ } else if (c == '/') {
+ status_parse = M_CLOSE_TAG;
+ } else if (IS_LABEL(c)) {
+ if (tag_stack.size() == 0 && status_had_root) {
+ // only one root element is allowed
+ report(E_MULTIPL_ROOT, "A second root tag found");
+ return false;
+ }
+ status_parse = M_OPEN_TAG;
+ text_buffer1 = "";
+ text_buffer1.append(1, c);
+ } else {
+ report(E_UNEXPECTED_CHAR, "Unexpected character at the begining of a tag");
+ return false;
+ }
+ } else if (status_parse == M_OPEN_TAG) {
+ // in a open tag
+ if (IS_LABEL(c)) {
+ text_buffer1.append(1, c);
+ } else if (IS_SPACE(c)) {
+ // end of tag name
+ current_tag = text_buffer1;
+ text_buffer1 = "";
+ status_parse = M_IN_TAG;
+ } else if (c == '/') {
+ current_tag = text_buffer1;
+ status_parse = M_SINGLE_TAG;
+ } else if (c == '>') {
+ // to handle tags without attributes
+ if (attributes_temp.size() == 0)
+ current_tag = text_buffer1;
+ tag_stack.push(current_tag);
+ on_tag_open(current_tag, attributes_temp);
+ text_buffer1 = "";
+ status_parse = M_TEXT;
+ attributes_temp.clear();
+ } else if (c == '/') {
+ status_parse = M_SINGLE_TAG;
+ } else {
+ report(E_UNEXPECTED_CHAR, "Unexpected character in tag");
+ return false;
+ }
+ } else if (status_parse == M_SINGLE_TAG) {
+ // expecting >
+ if (c == '>') {
+ tag_stack.push(current_tag);
+ on_tag_open(current_tag, attributes_temp);
+ on_tag_close(current_tag);
+ tag_stack.pop();
+ attributes_temp.clear();
+ text_buffer1 = "";
+ if (tag_stack.size()) {
+ status_parse = M_TEXT;
+ current_tag = tag_stack.top();
+ } else {
+ // we just closed the root tag
+ status_parse = M_TOP;
+ status_had_root = true;
+ }
+ } else {
+ // had "<tag_name [attr="foo" ...] /" but ">" not found
+ report(E_UNEXPECTED_CHAR, "Unexpected character in tag level after slash");
+ return false;
+ }
+ } else if (status_parse == M_PROCESSING) {
+ if (c == '>' && ENDS('?')) {
+ text_buffer1 = text_buffer1.substr(0, text_buffer1.size() - 1);
+ on_processing(text_buffer1);
+ status_parse = M_TOP;
+ text_buffer1 = "";
+ } else {
+ text_buffer1.append(1, c);
+ }
+ } else if (status_parse == M_COMMENT_DOCTYPE) {
+ if (c == '-') {
+ status_parse = M_COMMENT_START;
+ } else if (c == '[') {
+ // this isn't realy a doctype but a CDATA block
+ // TODO: Fix this!!!!
+ status_parse = M_DOCTYPE;
+ text_buffer1 = "[";
+ } else if (tag_stack.size() == 0 && status_had_root == false) {
+ status_parse = M_DOCTYPE;
+ text_buffer1 = "";
+ text_buffer1.append(1, c);
+ } else {
+ report(E_UNEXPECTED_CHAR, "Unexpected character, expected comment or DOCTYPE");
+ return false;
+ }
+ } else if (status_parse == M_DOCTYPE) {
+ if (c == '>') {
+ if (text_buffer1.size() < 8) {
+ report(E_UNKNOWN_ELEMENT, "Unknonw element found");
+ return false;
+ }
+ status_parse = M_TOP;
+ on_doctype(text_buffer1);
+ text_buffer1 = "";
+ } else {
+ text_buffer1.append(1, c);
+ if (text_buffer1.size() == 7) {
+ if (text_buffer1 == "[CDATA[") {
+ text_buffer1 = "";
+ status_parse = M_CDATA;
+ } else if (text_buffer1 != "DOCTYPE") {
+ report(E_UNKNOWN_ELEMENT, "Unknonw element found");
+ return false;
+ }
+ }
+ }
+ } else if (status_parse == M_COMMENT_START) {
+ if (c == '-') status_parse = M_COMMENT;
+ else {
+ report(E_UNEXPECTED_CHAR, "Unexpected character, expecting '-' for comment");
+ return false;
+ }
+ } else if (status_parse == M_COMMENT) {
+ if (c == '>' && ENDS2('-', '-')) {
+ text_buffer1 = text_buffer1.substr(0, text_buffer1.size() - 2);
+ on_comment(text_buffer1);
+ text_buffer1 = "";
+ if (tag_stack.size()) status_parse = M_TEXT;
+ else status_parse = M_TOP;
+ } else text_buffer1.append(1, c);
+ } else if (status_parse == M_IN_TAG) {
+ if (IS_LABEL(c)) {
+ status_parse = M_ATTR_LVALUE;
+ text_buffer1 = "";
+ text_buffer1.append(1, c);
+ } else if (IS_SPACE(c)) {
+ // nothing
+ } else if (c == '>') {
+ tag_stack.push(current_tag);
+ on_tag_open(current_tag, attributes_temp);
+ text_buffer1 = "";
+ status_parse = M_TEXT;
+ attributes_temp.clear();
+ } else if (c == '/') {
+ status_parse = M_SINGLE_TAG;
+ } else {
+ report(E_UNEXPECTED_CHAR, "Unexpected character in tag, expected attribute or close");
+ return false;
+ }
+ } else if (status_parse == M_ATTR_LVALUE) {
+ if (IS_LABEL(c)) {
+ text_buffer1.append(1, c);
+ } else if (c == '=') {
+ text_buffer2 = text_buffer1;
+ text_buffer1 = "";
+ status_parse = M_ATTR_EQUAL;
+ } else {
+ report(E_UNEXPECTED_CHAR, "Unexpected character in attribute name");
+ return false;
+ }
+ } else if (status_parse == M_ATTR_EQUAL) {
+ if (c == '"') status_parse = M_ATTR_RVALUE;
+ else {
+ report(E_UNEXPECTED_CHAR, "Unexpected character, expected double quote");
+ return false;
+ }
+ } else if (status_parse == M_ATTR_RVALUE) {
+ if (c == '"') {
+ // closing value;
+ attributes_temp[text_buffer2] = text_buffer1;
+ text_buffer1 = "";
+ status_parse = M_IN_TAG;
+ } else if (c == '&') {
+ // entity
+ entity_buffer = "";
+ STATE_PUSH;
+ status_parse = M_ENTITY;
+ } else {
+ text_buffer1.append(1, c);
+ }
+ } else if (status_parse == M_ENTITY) {
+ // handle entities
+ if (c == ';') {
+ if (entity_buffer.size() == 0) {
+ report(E_INVALID_ENTITY, "Empty entity identifier found");
+ return false;
+ } else if (entity_buffer.at(0) == '#') {
+ // hex value
+ entity_buffer = entity_buffer.substr(1);
+ if (entity_buffer.empty()) {
+ report(E_INVALID_ENTITY, "Empty decimal entity identifier found");
+ return false;
+ } else if (entity_buffer.at(0) == 'x') {
+ // hex entity
+ if (entity_buffer.size() != 2) {
+ report(E_INVALID_ENTITY, "Hex entity should have 2 character value");
+ return false;
+ } else text_buffer1.append(1, strtol(entity_buffer.c_str(), NULL, 16));
+ } else text_buffer1.append(1, atoi(entity_buffer.c_str()));
+ } else {
+ std::string tmp2 = entities[entity_buffer];
+ if (tmp2.empty()) {
+ report(E_INVALID_ENTITY, "Unknown entity");
+ return false;
+ } else text_buffer1.append(tmp2);
+ }
+ entity_buffer = "";
+ STATE_POP;
+ } else entity_buffer.append(1, c);
+ } else if (status_parse == M_CDATA) {
+ if (c == '>' && ENDS2(']', ']')) {
+ text_buffer1 = text_buffer1.substr(0, text_buffer1.size() - 2);
+ // don't check whitespaces because this CDATA must preserve
+ // everything (including whitespaces).
+ on_cdata(text_buffer1);
+ status_parse = M_TEXT;
+ text_buffer1 = "";
+ } else text_buffer1.append(1, c);
+ } else if (status_parse == M_CLOSE_TAG) {
+ // </foo> - must match with tag from top stack (or current_tag)
+ if (IS_LABEL(c)) {
+ text_buffer1.append(1, c);
+ } else if (c == '>') {
+ if (text_buffer1 != current_tag) {
+ std::stringstream s;
+ s<<"Closing tag '"<<text_buffer1<<"' at level of '"<<current_tag<<"'";
+ report(E_TAG_MISMATCH, s.str());
+ return false;
+ } else {
+ on_tag_close(current_tag);
+ tag_stack.pop();
+
+ if (tag_stack.empty()) status_parse = M_TOP;
+ else {
+ status_parse = M_TEXT;
+ current_tag = tag_stack.top();
+ }
+ text_buffer1 = "";
+ }
+ } else {
+ report(E_UNEXPECTED_CHAR, "Unexpected character in closing tag");
+ return false;
+
+ }
+ } else if (status_parse == M_TEXT) {
+ if (c == '&') {
+ STATE_PUSH;
+ status_parse = M_ENTITY;
+ } else if (c == '<') {
+ status_parse = M_START_TAG;
+ if (text_buffer1.size()) {
+ if (check_whitespaces(text_buffer1))
+ on_cdata(text_buffer1);
+ text_buffer1 = "";
+ }
+ } else if (c == '>') {
+ report(E_UNEXPECTED_CHAR, "Unexpected character '>' in CDATA");
+ return false;
+ } else text_buffer1.append(1, c);
+ } else {
+ std::stringstream s;
+ s<<"Unknown internal status: "<<status_parse;
+ report(E_INTERNAL, s.str());
+ }
+
+ before_last_char = last_char;
+ last_char = c;
+ }
+
+ return true;
+ }
+
+
+ //===================================================================
+
+
+ bool Parser::end()
+ {
+ if (status_parse != M_TOP) {
+ // findout why it's not finished
+ switch (status_parse) {
+ case M_CDATA:
+ case M_COMMENT:
+ case M_COMMENT_DOCTYPE:
+ case M_COMMENT_START:
+ report(E_BLOCK_NOT_CLOSED, "Comment, DOCTYPE, CDATA or processing instruction not closed");
+ break;
+ case M_OPEN_TAG:
+ case M_CLOSE_TAG:
+ case M_SINGLE_TAG:
+ case M_ATTR_LVALUE:
+ case M_ATTR_EQUAL:
+ case M_ATTR_RVALUE:
+ case M_START_TAG:
+ case M_IN_TAG:
+ report(E_TAG_NOT_FINISHED, "Tag not finished or is invalid");
+ break;
+ case M_TEXT:
+ report(E_TAG_NOT_CLOSED, "Open tag missing close tag");
+ break;
+ case M_ENTITY:
+ report(E_INVALID_ENTITY, "Entity not finished, missing ';'");
+ break;
+ default:
+ report(E_INTERNAL, "XML document not finished");
+ break;
+ }
+
+ return false;
+ }
+
+ return on_document_end();
+ }
+
+
+ //===================================================================
+
+
+ bool Parser::check_whitespaces(const std::string& cdata)
+ {
+ int c;
+ unsigned int i;
+ if (skip_whitespaces == false) return true;
+ else {
+ for(i = 0; i < cdata.size(); i++) {
+ c = cdata[i];
+ if (c != ' ' && c != '\t' && c != '\r' && c != '\n')
+ // CDATA has printable characters
+ return true;
+ }
+ // CDATA composed of whitespaces
+ return false;
+ }
+ }
+
+
+ //===================================================================
+
+
+ bool Parser::on_tag_open(const std::string& tag_name, StringMap& attributes)
+ {
+ return true;
+ }
+
+
+ //===================================================================
+
+
+ bool Parser::on_cdata(const std::string& cdata)
+ {
+ return true;
+ }
+
+
+ //===================================================================
+
+
+ bool Parser::on_tag_close(const std::string& tag_name)
+ {
+ return true;
+ }
+
+
+ //===================================================================
+
+
+ bool Parser::on_comment(const std::string& comment)
+ {
+ return true;
+ }
+
+
+ //===================================================================
+
+
+ bool Parser::on_processing(const std::string& value)
+ {
+ return true;
+ }
+
+
+ //===================================================================
+
+
+ bool Parser::on_doctype(const std::string& value)
+ {
+ return true;
+ }
+
+
+ //===================================================================
+
+
+ bool Parser::on_document_begin()
+ {
+ return true;
+ }
+
+
+ //===================================================================
+
+
+ bool Parser::on_document_end()
+ {
+ return true;
+ }
+
+
+ //===================================================================
+
+
+ void Parser::on_error(int errnr, int line, int col, const std::string& message)
+ {
+ return;
+ }
+
+
+ //===================================================================
+
+}; // namespace XMLSP;
+
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp.h (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp.h Mon Jul 28 18:50:01 2008
@@ -0,0 +1,174 @@
+// Copyright (c) 2007, Przemyslaw Grzywacz
+// All rights reserved.
+//
+// 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 Przemyslaw Grzywacz 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 Przemyslaw Grzywacz ``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 Przemyslaw Grzywacz 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.
+
+#ifndef __xmlsp_H
+#define __xmlsp_H
+
+#include <map>
+#include <string>
+#include <stack>
+
+namespace XMLSP {
+
+ typedef std::map<std::string, std::string> StringMap;
+ typedef std::stack<std::string> TagStack;
+
+ class Parser
+ {
+ public:
+ // error codes
+ enum {
+ E_OK = 0,
+ E_TAG_NOT_CLOSED,
+ E_MANY_ROOT_TAGS,
+ E_UNEXPECTED_CDATA,
+ E_UNEXPECTED_CHAR,
+ E_INVALID_ENTITY,
+ E_UNKNOWN_ELEMENT,
+ E_BLOCK_NOT_CLOSED,
+ E_TAG_NOT_FINISHED,
+ E_MULTIPL_ROOT,
+ E_TAG_MISMATCH,
+ E_INTERNAL
+ };
+
+ Parser() {
+ // default XML 1.0 entities
+ add_entity("lt", "<");
+ add_entity("gt", ">");
+ add_entity("amp", "&");
+ add_entity("apos", "'");
+ add_entity("quot", "\"");
+ skip_whitespaces = false;
+ }
+
+ virtual ~Parser();
+
+ // Constructor and parse
+ Parser(const std::string& xml) {
+ add_entity("lt", "<");
+ add_entity("gt", ">");
+ add_entity("amp", "&");
+ add_entity("apos", "'");
+ add_entity("quot", "\"");
+ parse(xml);
+ }
+
+ // whole document parsing at once
+ bool parse(const std::string& xml) {
+ if (begin() == false) return false;
+ if (parse_chunk(xml) == false) return false;
+ return end();
+ }
+
+ // failure ?
+ bool get_status() { return status_failure; }
+
+ // stream parsing
+ bool begin();
+ bool parse_chunk(const std::string& xml);
+ bool end();
+
+ // adds a new entity
+ void add_entity(const std::string& id, const std::string& value) { entities[id] = value; }
+ void add_entity(const char* id, const char* value) { entities[id] = value; }
+
+
+ // skip CDATA composed only of whitespaces
+ void set_skip_whitespaces(bool v) { skip_whitespaces = v; }
+ bool get_skip_whitespaces() { return skip_whitespaces; }
+
+
+ // parse events
+ virtual bool on_tag_open(const std::string& tag_name, StringMap& attributes);
+ virtual bool on_cdata(const std::string& cdata);
+ virtual bool on_tag_close(const std::string& tag_name);
+ virtual bool on_comment(const std::string& comment);
+ virtual bool on_processing(const std::string& value);
+ virtual bool on_doctype(const std::string& value);
+ virtual bool on_document_begin();
+ virtual bool on_document_end();
+ virtual void on_error(int errnr, int line, int col, const std::string& message);
+
+
+
+ protected:
+ // returns current tag for
+ std::string get_tag() { return (tag_stack.size() ? tag_stack.top() : ""); }
+
+ void report(int errnr, const std::string& message) {
+ on_error(errnr, current_line, current_col, message);
+ status_failure = true;
+ }
+
+ void report(int errnr, const char* str) {
+ on_error(errnr, current_line, current_col, std::string(str));
+ status_failure = true;
+ }
+
+ // FIXME: is this function needed ??
+ void report(int errnr, char* message) {
+ std::string s = message;
+ on_error(errnr, current_line, current_col, s);
+ status_failure = true;
+ }
+
+ TagStack* get_tag_stack() { return &tag_stack; }
+
+ private:
+ bool check_whitespaces(const std::string& cdata);
+
+ // entity list
+ StringMap entities;
+
+ // state info
+ // location of current byte
+ int current_line, current_col;
+ // status of converion of new lines to "\n" character
+ int status_new_line;
+ // status of failure
+ bool status_failure;
+ // did we have root tag ?
+ bool status_had_root;
+ // tag stack
+ TagStack tag_stack;
+ // state stack
+ std::stack<int> state_stack;
+ // temporary argument dictionary
+ StringMap attributes_temp;
+ // current parse status
+ int status_parse, status_stack;
+ // last two characters
+ int last_char, before_last_char;
+ // temp buffers
+ std::string text_buffer1, text_buffer2, current_tag;
+ std::string entity_buffer;
+ // skip CDATA composed only of whitespaces
+ bool skip_whitespaces;
+ };
+
+};
+
+#endif // !__xmlsp_H
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_dom.cpp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_dom.cpp (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_dom.cpp Mon Jul 28 18:50:01 2008
@@ -0,0 +1,419 @@
+// Copyright (c) 2007, Przemyslaw Grzywacz
+// All rights reserved.
+//
+// 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 Przemyslaw Grzywacz 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 Przemyslaw Grzywacz ``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 Przemyslaw Grzywacz 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.
+
+
+#include <sstream>
+#include <cstring>
+
+#include "xmlsp_dom.h"
+
+
+namespace XMLSP {
+
+ static std::string lastParseError;
+
+ class DOMParser: public Parser
+ {
+ public:
+ virtual ~DOMParser();
+
+ DOMElement* getDOM() { return rootElement; }
+
+ // parse events
+ virtual bool on_tag_open(const std::string& tag_name, StringMap& attributes);
+ virtual bool on_cdata(const std::string& cdata);
+ virtual bool on_tag_close(const std::string& tag_name);
+ virtual bool on_document_begin();
+ virtual bool on_document_end();
+ virtual void on_error(int errnr, int line, int col, const std::string& message);
+ protected:
+
+ std::stack<DOMElement*> elementStack;
+ DOMElement* rootElement;
+ };
+
+
+ //===================================================================
+ //===================================================================
+ //===================================================================
+
+
+ DOMParser::~DOMParser()
+ {
+
+ }
+
+
+ //===================================================================
+
+
+ bool DOMParser::on_tag_open(const std::string& tag_name, StringMap& attributes)
+ {
+ DOMElement *e = new DOMElement(tag_name);
+ StringMap::iterator i;
+
+ // copy attributes
+ for(i = attributes.begin(); i != attributes.end(); i++)
+ e->setAttribute(i->first, i->second);
+
+ // get parent element
+ if (elementStack.size()) {
+ // add child to parent
+ elementStack.top()->addChild(e);
+ } else {
+ // save root element
+ rootElement = e;
+ }
+
+ // add element to stack
+ elementStack.push(e);
+ return true;
+ }
+
+
+ //===================================================================
+
+
+ bool DOMParser::on_cdata(const std::string& cdata)
+ {
+ DOMElement *e = elementStack.top();
+ std::string data;
+ data.assign(e->getCData());
+ data.append(cdata);
+ e->setCData(data);
+ return true;
+ }
+
+
+ //===================================================================
+
+
+ bool DOMParser::on_tag_close(const std::string& tag_name)
+ {
+ elementStack.pop();
+ return true;
+ }
+
+
+ //===================================================================
+
+
+ bool DOMParser::on_document_begin()
+ {
+ rootElement = NULL;
+ return true;
+ }
+
+
+ //===================================================================
+
+
+ bool DOMParser::on_document_end()
+ {
+ // ?? why ?
+ while(elementStack.size()) elementStack.pop();
+ return true;
+ }
+
+
+ //===================================================================
+
+
+ void DOMParser::on_error(int errnr, int line, int col, const std::string& message)
+ {
+ std::stringstream s;
+ s<<"Error("<<errnr<<"): "<<message<<" on "<<line<<":"<<col;
+ lastParseError = s.str();
+
+ // free dom
+ delete rootElement;
+ while(elementStack.size()) elementStack.pop();
+ }
+
+
+ //===================================================================
+ //===================================================================
+ //===================================================================
+
+
+ /* NOT NEEDED while getXML is not implemented
+ static std::string encodeEntities(const std::string& text)
+ {
+ std::string out;
+ int ch, i, l;
+ static char hex[] = "0123456789abcdef";
+
+ l = text.size();
+ for(i = 0; i < l; i++) {
+ ch = text[i];
+ switch (ch) {
+ case '&': out.append("&"); break;
+ case '"': out.append("""); break;
+ case '\'': out.append("'"); break;
+ case '<': out.append("<"); break;
+ case '>': out.append(">"); break;
+ default:
+ if (isalnum(ch)) {
+ out.append(1, ch);
+ } else {
+ out.append("&#");
+ out.append(1, hex[(ch & 0xf0) >> 4]);
+ out.append(1, hex[(ch & 0x0f)]);
+ }
+ }
+ }
+
+ return out;
+ }
+ */
+
+
+ //===================================================================
+
+
+ std::string DOMElement::getLastError()
+ {
+ return lastParseError;
+ }
+
+
+ //===================================================================
+
+
+ DOMElement* DOMElement::loadXML(const std::string& xml)
+ {
+ DOMParser parser;
+ if (parser.parse(xml)) {
+ return parser.getDOM();
+ } else {
+ return NULL;
+ }
+ }
+
+
+ //===================================================================
+
+
+ /*std::string DOMElement::getXML(DOMElement* root, int depth)
+ {
+
+ }*/
+
+
+ //===================================================================
+
+
+ DOMElement::DOMElement(const std::string& tag_name)
+ {
+ elementName = tag_name;
+ }
+
+
+ //===================================================================
+
+
+ DOMElement::~DOMElement()
+ {
+ DOMElementMap::iterator mi;
+ DOMElements::iterator ei;
+
+ for(mi = childs.begin(); mi != childs.end(); mi++) {
+ for(ei = mi->second.begin(); ei != mi->second.end(); ei++) {
+ delete *ei;
+ }
+ }
+ }
+
+
+ //===================================================================
+
+
+ int DOMElement::hasAttribute(const std::string& name)
+ {
+ DOMAttributes::iterator i;
+ for(i = attributes.begin(); i != attributes.end(); i++) {
+ if (i->first == name) return true;
+ }
+ return false;
+ }
+
+
+ //===================================================================
+
+
+ const std::string& DOMElement::getAttribute(const std::string& name)
+ {
+ return attributes[name];
+ }
+
+
+ //===================================================================
+
+
+ void DOMElement::setAttribute(const std::string& name, const std::string& value)
+ {
+ attributes[name] = value;
+ }
+
+
+ //===================================================================
+
+
+ DOMStringList DOMElement::getAttributeList()
+ {
+ DOMStringList r;
+ DOMAttributes::iterator i;
+ for(i = attributes.begin(); i != attributes.end(); i++)
+ r.push_back(i->first);
+
+ return r;
+ }
+
+
+ //===================================================================
+
+
+ int DOMElement::childCount()
+ {
+ DOMElementMap::iterator mi;
+ DOMElements::iterator ei;
+ int count = 0;
+
+ for(mi = childs.begin(); mi != childs.end(); mi++) {
+ for(ei = mi->second.begin(); ei != mi->second.end(); ei++)
+ count++;
+ }
+
+ return count;
+ }
+
+
+ //===================================================================
+
+
+ DOMStringList DOMElement::getChildsNames()
+ {
+ DOMElementMap::iterator mi;
+ DOMStringList list;
+
+ for(mi = childs.begin(); mi != childs.end(); mi++) {
+ list.push_back(mi->first);
+ }
+
+ return list;
+ }
+
+
+ //===================================================================
+
+
+ DOMElements DOMElement::getElementsByName(const std::string& name)
+ {
+ DOMElementMap::iterator mi;
+ DOMElements::iterator ei;
+ DOMElements elements;
+
+ for(mi = childs.begin(); mi != childs.end(); mi++) {
+ if (mi->first == name) {
+ for(ei = mi->second.begin(); ei != mi->second.end(); ei++) {
+ elements.push_back(*ei);
+ }
+ }
+ }
+
+ return elements;
+ }
+
+
+ //===================================================================
+
+
+ DOMElements DOMElement::getElementsByAttribute(const std::string& attribute, const std::string& value)
+ {
+ DOMElementMap::iterator mi;
+ DOMElements::iterator ei;
+ DOMElements elements;
+
+ for(mi = childs.begin(); mi != childs.end(); mi++) {
+ for(ei = mi->second.begin(); ei != mi->second.end(); ei++) {
+ if ((*ei)->hasAttribute(attribute) && (*ei)->getAttribute(attribute) == value) {
+ elements.push_back(*ei);
+ }
+ }
+ }
+
+ return elements;
+ }
+
+
+ //===================================================================
+
+
+ DOMElements DOMElement::getChilds()
+ {
+ DOMElementMap::iterator mi;
+ DOMElements::iterator ei;
+ DOMElements elements;
+
+ for(mi = childs.begin(); mi != childs.end(); mi++) {
+ for(ei = mi->second.begin(); ei != mi->second.end(); ei++) {
+ elements.push_back(*ei);
+ }
+ }
+
+ return elements;
+ }
+
+
+ //===================================================================
+
+
+ void DOMElement::addChild(DOMElement* element)
+ {
+ childs[element->getElementName()].push_back(element);
+ }
+
+
+ //===================================================================
+
+
+ void DOMElement::removeChild(DOMElement* element)
+ {
+ DOMElementMap::iterator mi;
+ DOMElements::iterator ei;
+
+ for(mi = childs.begin(); mi != childs.end(); mi++) {
+ if (mi->first == element->getElementName()) {
+ for(ei = mi->second.begin(); ei != mi->second.end(); ei++) {
+ if (*ei == element) {
+ mi->second.erase(ei);
+ return;
+ }
+ }
+ }
+ }
+ }
+
+}; // namespace XMLSP
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_dom.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_dom.h (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_dom.h Mon Jul 28 18:50:01 2008
@@ -0,0 +1,84 @@
+// Copyright (c) 2007, Przemyslaw Grzywacz
+// All rights reserved.
+//
+// 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 Przemyslaw Grzywacz 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 Przemyslaw Grzywacz ``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 Przemyslaw Grzywacz 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.
+
+#ifndef __xmlsp_dom_H
+#define __xmlsp_dom_H
+
+#include <map>
+#include <vector>
+#include <string>
+
+#include "xmlsp.h"
+
+namespace XMLSP {
+
+ class DOMElement;
+
+ typedef std::vector<DOMElement*> DOMElements;
+ typedef std::map<std::string, DOMElements> DOMElementMap;
+ typedef std::map<std::string, std::string> DOMAttributes;
+ typedef std::vector<std::string> DOMStringList;
+
+ class DOMElement
+ {
+ public:
+ DOMElement(const std::string& tag_name);
+ ~DOMElement();
+
+ static DOMElement* loadXML(const std::string& xml);
+ //static std::string getXML(DOMElement* element, int depth = 0);
+ static std::string getLastError();
+
+ int attributeCount() { return attributes.size(); }
+ int hasAttribute(const std::string& name);
+ const std::string& getAttribute(const std::string& name);
+ void setAttribute(const std::string& name, const std::string& value);
+ DOMStringList getAttributeList();
+
+ bool hasChilds() { return childs.size() ? true : false; }
+ int childCount();
+ DOMStringList getChildsNames();
+ DOMElements getElementsByName(const std::string& name);
+ DOMElements getElementsByAttribute(const std::string& attribute, const std::string& value);
+ DOMElements getChilds();
+ void addChild(DOMElement* element);
+ void removeChild(DOMElement* element);
+
+ const std::string& getCData() { return cdata; }
+ void setCData(const std::string& data) { cdata = data; }
+
+ std::string getElementName() { return elementName; }
+
+ protected:
+ DOMAttributes attributes;
+ DOMElementMap childs;
+ std::string cdata;
+ std::string elementName;
+ };
+
+}; // namespace XMLSP
+
+
+#endif // !__xmlsp_dom_H
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_test1.cpp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_test1.cpp (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_test1.cpp Mon Jul 28 18:50:01 2008
@@ -0,0 +1,103 @@
+#include <iostream>
+#include "xmlsp.h"
+
+using namespace std;
+
+class MyParser: public XMLSP::Parser
+{
+public:
+
+ virtual bool on_tag_open(const std::string& tag_name, XMLSP::StringMap& attributes);
+ virtual bool on_cdata(const std::string& cdata);
+ virtual bool on_tag_close(const std::string& tag_name);
+ virtual bool on_comment(const std::string& comment);
+ virtual bool on_processing(const std::string& value);
+ virtual bool on_doctype(const std::string& value);
+ virtual bool on_document_begin();
+ virtual bool on_document_end();
+ virtual void on_error(int errnr, int line, int col, const std::string& message);
+};
+
+
+bool MyParser::on_tag_open(const std::string& tag_name, XMLSP::StringMap& attributes)
+{
+ XMLSP::StringMap::iterator i;
+ cout<<"<"<<tag_name;
+
+ for(i = attributes.begin(); i != attributes.end(); i++) {
+ cout<<" "<<i->first<<"=\""<<i->second<<"\"";
+ }
+
+ cout<<">\n";
+
+ return true;
+}
+
+bool MyParser::on_cdata(const std::string& cdata)
+{
+ cout<<"CDATA: "<<cdata<<endl;
+ return true;
+}
+
+bool MyParser::on_tag_close(const std::string& tag_name)
+{
+ cout<<"</"<<tag_name<<">"<<endl;
+ return true;
+}
+
+bool MyParser::on_comment(const std::string& comment)
+{
+ cout<<"<!--"<<comment<<"-->"<<endl;
+ return true;
+}
+
+bool MyParser::on_processing(const std::string& value)
+{
+ cout<<"<?"<<value<<"?>"<<endl;
+ return true;
+}
+
+bool MyParser::on_doctype(const std::string& value)
+{
+ cout<<"<!"<<value<<">"<<endl;
+ return true;
+}
+
+bool MyParser::on_document_begin()
+{
+ cout<<"DOCUMENT BEGIN"<<endl;
+ return true;
+}
+
+bool MyParser::on_document_end()
+{
+ cout<<"DOCUMENT END"<<endl;
+ return true;
+}
+
+void MyParser::on_error(int errnr, int line, int col, const std::string& message)
+{
+ cout<<"ERROR("<<errnr<<"): "<<message<<", at "<<line<<":"<<col<<endl;
+}
+
+
+const char* xml = "<?xml version=\"1.0\"?>\n"
+ "<hello v=\"1\"><Hello world><!-- small comment -->\n"
+ " <subtag v1=\"1\" v2=\"2\" v3=\"3\" />\n"
+ "</hello>";
+
+
+int main(int argc, char* argv[])
+{
+
+ MyParser p;
+ string s = xml;
+ if (p.parse(s)) {
+ cout<<"OK."<<endl;
+ } else {
+ cout<<"Aborted."<<endl;
+ }
+}
+
+
+
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_test2.cpp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_test2.cpp (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_test2.cpp Mon Jul 28 18:50:01 2008
@@ -0,0 +1,163 @@
+#include <iostream>
+#include <sstream>
+#include <fstream>
+#include "xmlsp.h"
+
+using namespace std;
+
+class MyParser: public XMLSP::Parser
+{
+public:
+
+ virtual bool on_tag_open(const std::string& tag_name, XMLSP::StringMap& attributes);
+ virtual bool on_cdata(const std::string& cdata);
+ virtual bool on_tag_close(const std::string& tag_name);
+ virtual bool on_comment(const std::string& comment);
+ virtual bool on_processing(const std::string& value);
+ virtual bool on_doctype(const std::string& value);
+ virtual bool on_document_begin();
+ virtual bool on_document_end();
+ virtual void on_error(int errnr, int line, int col, const std::string& message);
+};
+
+
+bool MyParser::on_tag_open(const std::string& tag_name, XMLSP::StringMap& attributes)
+{
+ XMLSP::StringMap::iterator i;
+ cout<<"<"<<tag_name;
+
+ for(i = attributes.begin(); i != attributes.end(); i++) {
+ cout<<" "<<i->first<<"=\""<<i->second<<"\"";
+ }
+
+ cout<<">\n";
+
+ return true;
+}
+
+bool MyParser::on_cdata(const std::string& cdata)
+{
+ cout<<"CDATA (in "<<get_tag()<<"): "<<cdata<<endl;
+ return true;
+}
+
+bool MyParser::on_tag_close(const std::string& tag_name)
+{
+ cout<<"</"<<tag_name<<">"<<endl;
+ return true;
+}
+
+bool MyParser::on_comment(const std::string& comment)
+{
+ cout<<"<!--"<<comment<<"-->"<<endl;
+ return true;
+}
+
+bool MyParser::on_processing(const std::string& value)
+{
+ cout<<"<?"<<value<<"?>"<<endl;
+ return true;
+}
+
+bool MyParser::on_doctype(const std::string& value)
+{
+ cout<<"<!"<<value<<">"<<endl;
+ return true;
+}
+
+bool MyParser::on_document_begin()
+{
+ cout<<"DOCUMENT BEGIN"<<endl;
+ return true;
+}
+
+bool MyParser::on_document_end()
+{
+ cout<<"DOCUMENT END"<<endl;
+ return true;
+}
+
+void MyParser::on_error(int errnr, int line, int col, const std::string& message)
+{
+ cout<<"ERROR("<<errnr<<"): "<<message<<", at "<<line<<":"<<col<<endl;
+}
+
+
+int main(int argc, char* argv[])
+{
+ MyParser p;
+ ifstream is;
+ string xml;
+ string chunk;
+ char buff[64];
+ int len;
+
+
+ // disable CDATA composed of whitespaces
+ p.set_skip_whitespaces(true);
+
+ // check if one (only one) file name given
+ if (argc != 2) {
+ cout<<"usage: xmlsp_test2 xml_file_to_parse"<<endl;
+ return 0;
+ }
+
+ // open input file
+ is.open(argv[1]);
+ if (!is) {
+ cerr<<"File \""<<argv[1]<<"\" can not be opened"<<endl;
+ return 1;
+ }
+
+ // begin parsing
+ if (!p.begin()) {
+ cerr<<"Failed to initialize parser"<<endl;
+ return 1;
+ }
+
+ // first parse use chunks
+ cout<<"Parsing \""<<argv[1]<<"\" as stream:"<<endl;
+
+ // read chunks, parse them, and save for one chunk parse
+ while (!is.eof() && is.good()) {
+ // read file
+ is.read(buff, 64);
+ len = is.gcount();
+ xml.append(buff, len);
+ chunk.assign(buff, len);
+
+ // try to parse
+ if (p.parse_chunk(chunk) == false) {
+ cout<<"Failed to parse chunk"<<endl;
+ is.close();
+ return 1;
+ }
+ }
+
+
+ if (is.bad()) {
+ cerr<<"Reading file failed"<<endl;
+ is.close();
+ return 1;
+ }
+
+ is.close();
+
+ if (!p.end()) {
+ cerr<<"Failed to finalize parsing"<<endl;
+ return 1;
+ }
+
+
+ cout<<"Parse 1 finished"<<endl<<endl<<endl;
+
+ cout<<"Parsing \""<<argv[1]<<"\" as single chunk:"<<endl;
+ if (p.parse(xml)) {
+ cout<<"Parse 2 finished"<<endl;
+ } else {
+ cerr<<"Failed to parse xml file"<<endl;
+ }
+}
+
+
+
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_test3.cpp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_test3.cpp (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/xmlsp/xmlsp_test3.cpp Mon Jul 28 18:50:01 2008
@@ -0,0 +1,75 @@
+#include <iostream>
+#include <sstream>
+#include "xmlsp_dom.h"
+
+using namespace std;
+
+
+const char* xml = "<?xml version=\"1.0\"?>\n"
+ "<hello v=\"1\">\n"
+ " <key><Hello world></key>\n"
+ " <value v1=\"1\" v2=\"2\" v3=\"3\" />\n"
+ "</hello>";
+
+
+string dumpAttributes(XMLSP::DOMElement* e)
+{
+ stringstream s;
+ XMLSP::DOMStringList list = e->getAttributeList();
+ XMLSP::DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++) {
+ s<<" "<<*i<<"=\""<<e->getAttribute(*i)<<"\"";
+ }
+ return s.str();
+}
+
+
+void dumpElement(XMLSP::DOMElement* e, int depth)
+{
+ string p1, p2;
+ XMLSP::DOMElements els;
+ XMLSP::DOMElements::iterator i;
+
+
+ p1.assign((depth-1)*4, ' ');
+ p2.assign(depth*4, ' ');
+
+ cout<<p1<<"[element] {"<<endl;
+ cout<<p2<<"name: "<<e->getElementName()<<endl;
+ if (e->attributeCount())
+ cout<<p2<<"attributes:"<<dumpAttributes(e)<<endl;
+
+
+ if (e->hasChilds()) {
+ cout<<p2<<"childs count: "<<e->childCount()<<endl;
+
+ els = e->getChilds();
+ for(i = els.begin(); i != els.end(); i++) {
+ dumpElement(*i, depth+1);
+ }
+ } else if (e->getCData().size()) {
+ cout<<p2<<"cdata: "<<e->getCData()<<endl;
+ }
+
+
+ cout<<p1<<"}"<<endl;
+}
+
+
+int main(int argc, char* argv[])
+{
+ XMLSP::DOMElement* root;
+ root = XMLSP::DOMElement::loadXML(xml);
+ if (root == NULL) {
+ cerr<<"Failed to parse xml: "<<XMLSP::DOMElement::getLastError()<<endl;
+ } else {
+ cout<<"Parse OK.\n";
+ dumpElement(root, 1);
+ cout<<"Deleting root... ";
+ delete root;
+ cout<<"done"<<endl;
+ }
+}
+
+
+
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r49465 - /branches/tmp/dmacvicar/yast-xmlui/libyui/
by dmacvicar@svn.opensuse.org 28 Jul '08
by dmacvicar@svn.opensuse.org 28 Jul '08
28 Jul '08
Author: dmacvicar
Date: Mon Jul 28 18:45:21 2008
New Revision: 49465
URL: http://svn.opensuse.org/viewcvs/yast?rev=49465&view=rev
Log: (empty)
Added:
branches/tmp/dmacvicar/yast-xmlui/libyui/
- copied from r49464, trunk/libyui/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0