| Christian Nassau 2006-11-29, 7:08 pm |
| You should probably leave out the extra quotes from your definition of
the testscript, because those gives you the unwanted extra level of
grouping. If you use just
set teststring {
channel {
title { }
description { }
}
}
a plain
$root appendFromScript $teststring
ought to work.
jkj wrote:
> ...the entire test copied from my terminal:
> % package require tdom
> 0.8.0
> % set doc [dom createDocument test]
> domDoc0x8ebc648
> % set root [$doc documentElement]
> domNode0x8ebc8bc
> % dom createNodeCmd elementNode channel
> ::channel
> % dom createNodeCmd elementNode title
> ::title
> % dom createNodeCmd elementNode description
> ::description
> % set teststring "{
> channel {
> title { }
> description { }
> }
> }
> "
> {
> channel {
> title { }
> description { }
> }
> }
>
> % eval [concat "$root appendFromScript" $teststring]
> domNode0x8ebc8bc
> % puts [$root asXML]
> <test>
> <channel>
> <title/>
> <description/>
> </channel>
> </test>
>
--
=> Christian Nassau, http://www.nullhomotopie.de
|