[Tkabber-dev] [tclxmpp commit] r28 - in trunk: . xmpp

codesite-noreply at google.com codesite-noreply at google.com
Sat Oct 18 01:10:47 MSD 2008


Author: sgolovan
Date: Fri Oct 17 14:10:07 2008
New Revision: 28

Modified:
    trunk/ChangeLog
    trunk/xmpp/xml.tcl

Log:
	* xmpp/xml.tcl: Fixed creating XML element if it has empty subelements.


Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	(original)
+++ trunk/ChangeLog	Fri Oct 17 14:10:07 2008
@@ -27,6 +27,8 @@

  	* xmpp/xmpp.tcl: Fixed sending text.

+	* xmpp/xml.tcl: Fixed creating XML element if it has empty subelements.
+
  2008-10-15  Sergei Golovan  <sgolovan at nes.ru>

  	* xmpp/xml.tcl: Added default (empty) XMLNS for empty prefix. Also,

Modified: trunk/xmpp/xml.tcl
==============================================================================
--- trunk/xmpp/xml.tcl	(original)
+++ trunk/xmpp/xml.tcl	Fri Oct 17 14:10:07 2008
@@ -278,18 +278,22 @@
                  }
              }
              -subelement  {
-                if {[string equal [lindex $val 1] ""]} {
-                    lappend subels [lreplace $val 1 1 $xmlns]
-                } else {
-                    lappend subels $val
+                if {[llength $val] > 0} {
+                    if {[string equal [lindex $val 1] ""]} {
+                        lappend subels [lreplace $val 1 1 $xmlns]
+                    } else {
+                        lappend subels $val
+                    }
                  }
              }
              -subelements {
                  foreach subel $val {
-                    if {[string equal [lindex $subel 1] ""]} {
-                        lappend subels [lreplace $subel 1 1 $xmlns]
-                    } else {
-                        lappend subels $subel
+                    if {[llength $subel] > 0} {
+                        if {[string equal [lindex $subel 1] ""]} {
+                            lappend subels [lreplace $subel 1 1 $xmlns]
+                        } else {
+                            lappend subels $subel
+                        }
                      }
                  }
              }


More information about the Tkabber-dev mailing list