|
From: Derek F. <fo...@hu...> - 2002-09-27 14:38:01
|
I'm trying to work out the status of CDATA support in text nodes in various
versions of ActiveTcl. I have this little test script:
---
#!/bin/sh
# \
exec tclsh8.3 "$0" "$@"
package require xml
package require dom
set xml {<test><![CDATA[Some text with a <br/> in it]]></test>}
set docNode [::dom::DOMImplementation parse $xml -parser tcl]
set elementNode [dom::node cget $docNode -firstChild]
set textNode [dom::node cget $elementNode -firstChild]
puts [dom::node cget $textNode -nodeValue]
---
With ActiveTcl-8.3.4.3 this returns an empty string. If I remove the -parser
option, it returns the CDATA text. Unfortunately, the default parser is too
buggy - I need the tcl parser to make the rest of my script work.
ActiveTcl-8.4.0.1 doesn't have the -parser option (I thought it used the same
Tcldom package as 8.3.4.3, but must be mistaken), and has other issues in
other places which prevent my script working.
Basically, I want to stick with ActiveTcl-8.3.4.3, and the tcl parser, and
get the text from CDATA sections. Can I do that?
--
3:28pm up 65 days, 5:56, 2 users, load average: 0.02, 0.13, 0.09
|