Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
28
Task/XML-Output/Tcl/xml-output-1.tcl
Normal file
28
Task/XML-Output/Tcl/xml-output-1.tcl
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
proc xquote string {
|
||||
list [string map "' ' \\\" " < > > < & &" $string]
|
||||
}
|
||||
proc < {name attl args} {
|
||||
set res <$name
|
||||
foreach {att val} $attl {
|
||||
append res " $att='$val'"
|
||||
}
|
||||
if {[llength $args]} {
|
||||
append res >
|
||||
set sep ""
|
||||
foreach a $args {
|
||||
append res $sep $a
|
||||
set sep \n
|
||||
}
|
||||
append res </$name>
|
||||
} else {append res />}
|
||||
return $res
|
||||
}
|
||||
set cmd {< CharacterRemarks {}}
|
||||
foreach {name comment} {
|
||||
April "Bubbly: I'm > Tam and <= Emily"
|
||||
"Tam O'Shanter" "Burns: \"When chapman billies leave the street ...\""
|
||||
Emily "Short & shrift"
|
||||
} {
|
||||
append cmd " \[< Character {Name [xquote $name]} [xquote $comment]\]"
|
||||
}
|
||||
puts [eval $cmd]
|
||||
13
Task/XML-Output/Tcl/xml-output-2.tcl
Normal file
13
Task/XML-Output/Tcl/xml-output-2.tcl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package require tdom
|
||||
set xml [dom createDocument CharacterRemarks]
|
||||
foreach {name comment} {
|
||||
April "Bubbly: I'm > Tam and <= Emily"
|
||||
"Tam O'Shanter" "Burns: \"When chapman billies leave the street ...\""
|
||||
Emily "Short & shrift"
|
||||
} {
|
||||
set elem [$xml createElement Character]
|
||||
$elem setAttribute name $name
|
||||
$elem appendChild [$xml createTextNode $comment]
|
||||
[$xml documentElement] appendChild $elem
|
||||
}
|
||||
$xml asXML
|
||||
13
Task/XML-Output/Tcl/xml-output-3.tcl
Normal file
13
Task/XML-Output/Tcl/xml-output-3.tcl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package require dom
|
||||
set xml [dom::DOMImplementation create]
|
||||
set root [dom::document createElement $xml CharacterRemarks]
|
||||
foreach {name comment} {
|
||||
April "Bubbly: I'm > Tam and <= Emily"
|
||||
"Tam O'Shanter" "Burns: \"When chapman billies leave the street ...\""
|
||||
Emily "Short & shrift"
|
||||
} {
|
||||
set element [dom::document createElement $root Character]
|
||||
dom::element setAttribute $element name $name
|
||||
dom::document createTextNode $element $comment
|
||||
}
|
||||
dom::DOMImplementation serialize $xml -indent 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue