Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,28 @@
proc xquote string {
list [string map "' &apos; \\\" &quot; < &gt; > &lt; & &amp;" $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]

View 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

View 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