Re: ::xmlgen::buffer command broken
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: ::xmlgen::buffer command broken

From: WL <me@privacy.net>
Date: Tue Apr 11 2006 - 02:23:54 CEST

In article <1144702229.870780@sj-nntpcache-5>,
Peter Wang <wkwang@cisco.com> wrote:
>Is there anything wrong here or with the xmlgen-1.4 package? I really liked
>the xmlgen functionalities to generate XML doc, however its buffer command
>seemed broken here. BTW, do you have recommendation of other Tcl packages
>for generating XML doc?

Seems ok for me. I always use [buffer], so I can't really
compare it to non-[buffer] use. The examples does indicate
some difference, but I think [buffer] requires the tag usage
to be more strict. Also, getting the hang of -, !, etc,
takes a while. Experiment some more :)

As for others, I've only used the xmlgen package. There may
be other suggestions on the wiki http://mini.net/tcl/

>expect1.1> package require xmlgen
>1.4
>expect1.2> namespace import ::xmlgen::*
>expect1.3> declaretag test
>expect1.4> test a=1 b=2
><test a="1" b="2" />
>expect1.5> buffer myvar {test a=1 b=2}

% buffer output { test {a=2} {b=3} - }
% puts $output
<test a="2" b="3" />

>expect1.6> info exists myvar
>1
>expect1.7> set myvar
>expect1.8> puts $myvar
>
>expect1.9> buffer myvar {puts ok}

% buffer output { test ! { put "yee haw" } }
% puts $output

<test>yee haw
</test>
%

Note the use of [put] instead of [puts].

Good luck,

-- 
WL
real mail: wliao at sdf loSnPesAtarM org
(remove the uppercase letters...)
Received on Sun Apr 30 03:05:33 2006