[Tkabber-dev] r1155 - in trunk/tkabber: . jabberlib-tclxml

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Thu Jul 12 18:33:19 MSD 2007


Author: sergei
Date: 2007-07-12 18:33:19 +0400 (Thu, 12 Jul 2007)
New Revision: 1155

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/jabberlib-tclxml/wrapper.tcl
Log:
	* jabberlib-tclxml/wrapper.tcl: Do not add xmlns attribute to an XML
	  element if it is the same as for its parent element.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-07-11 21:01:02 UTC (rev 1154)
+++ trunk/tkabber/ChangeLog	2007-07-12 14:33:19 UTC (rev 1155)
@@ -1,3 +1,8 @@
+2007-07-12  Sergei Golovan  <sgolovan at nes.ru>
+
+	* jabberlib-tclxml/wrapper.tcl: Do not add xmlns attribute to an XML
+	  element if it is the same as for its parent element.
+
 2007-07-11  Sergei Golovan  <sgolovan at nes.ru>
 
 	* jabberlib-tclxml/tclxml/sgmlparser.tcl,

Modified: trunk/tkabber/jabberlib-tclxml/wrapper.tcl
===================================================================
--- trunk/tkabber/jabberlib-tclxml/wrapper.tcl	2007-07-11 21:01:02 UTC (rev 1154)
+++ trunk/tkabber/jabberlib-tclxml/wrapper.tcl	2007-07-12 14:33:19 UTC (rev 1155)
@@ -217,7 +217,7 @@
 #
 # This procedure converts (and returns) $xmldata to raw-XML
 #
-proc wrapper:createxml {xmldata} {
+proc wrapper:createxml {xmldata {xmlns jabber:client}} {
     set retext ""
 
     set tagname [lindex $xmldata 0]
@@ -227,6 +227,13 @@
 
     append retext "<$tagname"
     foreach {attr value} $vars {
+	if {$attr == "xmlns"} {
+	    if {$value == $xmlns} {
+		continue
+	    } else {
+		set xmlns $value
+	    }
+	}
 	append retext " $attr='[wrapper:xmlcrypt $value]'"
     }
     if {$chdata == "" && [llength $subtags] == 0} {
@@ -239,7 +246,7 @@
     append retext [wrapper:xmlcrypt $chdata]
 
     foreach subdata $subtags {
-	append retext [wrapper:createxml $subdata]
+	append retext [wrapper:createxml $subdata $xmlns]
     }
 
     append retext "</$tagname>"



More information about the Tkabber-dev mailing list