Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/xtt%3A+XML+%3C%2D%2D%3E+Text+Tag+translator?V=3
QUERY_STRINGV=3
CONTENT_TYPE
DOCUMENT_URI/revision/xtt:+XML+<-->+Text+Tag+translator
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
HTTPSon
REMOTE_ADDR172.69.58.212
REMOTE_PORT45538
SERVER_PORT4443
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_X_FORWARDED_FOR18.217.182.45
HTTP_CF_RAY87dd57307818111d-ORD
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_ACCEPT*/*
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_CONNECTING_IP18.217.182.45
HTTP_CDN_LOOPcloudflare
HTTP_CF_IPCOUNTRYUS

Body


Error

Unknow state transition: LINE -> END

-code

1

-level

0

-errorstack

INNER {returnImm {Unknow state transition: LINE -> END} {}} CALL {my render_wikit {xtt: XML <--> Text Tag translator} \[EKB\]\ I\ wrote\ this\ long\ before\ I\ knew\ about\ this\ wiki.\ It\ converts\ tags\ in\ a\ text\ canvas\ to\ and\ from\ XML\ (so\ you\ can\ write\ up\ an\ XML\ file,\ then\ load\ it\ into\ a\ text\ widget).\ It\ needs\ some\ work\ (such\ as\ entities\ and\ handling\ nested\ tags),\ but\ can\ do\ a\ few\ tricks,\ so\ I\ thought\ it\ was\ worth\ sharing.\n\nThe\ main\ file,\ ''xtt.tcl'':\n======\n\ \ \ \ package\ require\ dom\ 2.0\n\ \ \ \ package\ require\ struct\n\ \ \ \ \n\ \ \ \ #\ xtt:\ The\ XML\ <-->\ Text\ Tag\ Translator\n\ \ \ \ #\ ver\ 1.0\n\ \ \ \ #\n\ \ \ \ #\ Copyright\ (c)\ 2003\ Eric\ Kemp-Benedict\n\ \ \ \ #\ All\ Rights\ Reserved\n\ \ \ \ #\n\ \ \ \ #\ This\ code\ is\ freely\ distributable,\ but\ is\ provided\ as-is\ with\n\ \ \ \ #\ no\ waranty\ expressed\ or\ implied.\n\ \ \ \ #\n\ \ \ \ #\ Send\ comments\ to\ [email protected].\ If\ you\ make\ improvements,\n\ \ \ \ #\ please\ send\ them\ to\ me.\ I\ will\ give\ you\ credit\ and\ distribute\ the\n\ \ \ \ #\ improved\ code.\ Thanks!\n\ \ \ \ \n\ \ \ \ #\ ==\ Description\ ==\n\ \ \ \ #\n\ \ \ \ #\ xtt\ offers\ an\ interface\ between\ a\ tk\ text\ widget's\ tags\ and\n\ \ \ \ #\ an\ XML\ document's\ tags.\n\ \ \ \ #\n\ \ \ \ #\ NOTE:\ It's\ pretty\ basic.\ In\ particular,\ it\ doesn't\ (yet)\ handle\n\ \ \ \ #\ nested\ tags\ or\ entities.\n\ \ \ \ #\n\ \ \ \ #\ To\ use\ it,\ just\ \"source\"\ xtt.tcl\ in\ your\ tcl\ script.\ Note\n\ \ \ \ #\ that\ xtt\ requires\ the\ dom\ and\ struct\ packages.\ Struct\ is\n\ \ \ \ #\ part\ of\ tcllib.\n\ \ \ \ #\n\ \ \ \ #\ Example:\n\ \ \ \ #\n\ \ \ \ #\ Step\ 1:\ Associate\ XML\ codes\ with\ text\ widget\ tags\n\ \ \ \ #\n\ \ \ \ #\ \ set\ xtt::tagArray(i)\ italic\ \ \ \ \ \ \;#\ \"i\"\ is\ the\ XML\ tag,\ \"italic\"\ is\ the\ text\ widget\ tag\n\ \ \ \ #\ \ set\ xtt::tagArray(b)\ bold\n\ \ \ \ #\ \ set\ xtt::tagArray(bi)\ boldital\n\ \ \ \ #\ \ set\ xtt::tagArray(sup)\ super\n\ \ \ \ #\ \ set\ xtt::tagArray(sub)\ sub\n\ \ \ \ #\n\ \ \ \ #\ Step\ 2:\ Specify\ a\ tag\ for\ a\ paragraph\ element\ (defaults\ to\ p,\ so\ this\ is\ optional)\n\ \ \ \ #\n\ \ \ \ #\ \ set\ xtt::paraElem\ para\n\ \ \ \ #\n\ \ \ \ #\ Step\ 3:\ Start\ translating!\n\ \ \ \ #\n\ \ \ \ #\ From\ XML\ ->\ TextWidget\n\ \ \ \ #\ \ xtt::XMLtoText\ .myTextWidget\ \$parsedXMLdoc\n\ \ \ \ #\n\ \ \ \ #\ From\ Text\ Widget\ ->\ XML\n\ \ \ \ #\ \ set\ XMLoutput\ \[xtt::TextToXML\ .t\]\n\ \ \ \ #\n\ \ \ \ #\ From\ Text\ Widget\ ->\ DOMnode\n\ \ \ \ #\ \ set\ DOMnode\ \[xtt::TextToDOM\ .t\]\n\ \ \ \ #\n\ \ \ \ \n\ \ \ \ namespace\ eval\ xtt\ \{\n\ \ \ \ \n\ \ \ \ \ \ \ #############################################\n\ \ \ \ \ \ \ ##\n\ \ \ \ \ \ \ ##\ Interface\n\ \ \ \ \ \ \ ##\n\ \ \ \ \ \ \ #############################################\n\ \ \ \ \n\ \ \ \ \ \ \ variable\ tagArray\n\ \ \ \ \ \ \ variable\ paraElem\ \"p\"\n\ \ \ \ \n\ \ \ \ \ \ \ proc\ XMLtoText\ \{w\ DOMnode\}\ \{\n\ \ \ \ \ \ \ \ \ \ variable\ tagArray\n\ \ \ \ \ \ \ \ \ \ variable\ paraElem\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ set\ paralist\ \[dom::element\ getElementsByTagName\ \$DOMnode\ \$paraElem\]\n\ \ \ \ \ \ \ \ \ \ foreach\ p\ \[set\ \$paralist\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ xtt::expandNodes\ \$w\ \$p\n\ \ \ \ \ \ \ \ \ \ \ \ \ \$w\ insert\ end\ \"\\n\"\n\ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \ \ \ proc\ TextToXML\ \{w\}\ \{\n\ \ \ \ \ \ \ \ \ \ #\ NOTE:\ The\ stack\ is\ for\ future\ flexibility.\ At\ the\ moment\ nested\ tags\ are\ not\n\ \ \ \ \ \ \ \ \ \ #\ processed.\ In\ future\ versions\ I\ expect\ to\ process\ nested\ tags\ and\ that\ will\n\ \ \ \ \ \ \ \ \ \ #\ be\ easier\ with\ a\ stack.\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ struct::stack\ tagStack\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ set\ dump\ \[\$w\ dump\ -tag\ -text\ 1.0\ end\]\n\ \ \ \ \ \ \ \ \ \ set\ length\ \[llength\ \$dump\]\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ set\ retval\ \"<p>\"\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ for\ \{set\ i\ 0\}\ \{\$i\ <\ \$length\}\ \{incr\ i\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ switch\ \[lindex\ \$dump\ \$i\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ text\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ incr\ i\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ retval\ \$retval\[lindex\ \$dump\ \$i\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ tagon\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ incr\ i\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ tagStack\ push\ \[xtt::getTagCode\ \[lindex\ \$dump\ \$i\]\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ retval\ \$retval<\[tagStack\ peek\]>\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ tagoff\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ incr\ i\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ retval\ \$retval</\[tagStack\ pop\]>\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ set\ retval\ \$retval</p>\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ #\ Replace\ all\ newlines\ with\ \"</p><p>\"\n\ \ \ \ \ \ \ \ \ \ regsub\ -all\ --\ \"\\\\n\"\ \$retval\ \"</p><p>\"\ retval\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ #\ Strip\ multiple\ newlines\ at\ the\ end\n\ \ \ \ \ \ \ \ \ \ regsub\ --\ \"(<p></p>)+\$\"\ \$retval\ \"\"\ retval\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ tagStack\ destroy\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ return\ \$retval\n\ \ \ \ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \ \ \ proc\ TextToDOM\ \{w\}\ \{\n\ \ \ \ \ \ \ \ \ \ #\ Wrap\ the\ XML\ in\ a\ fake\ \"document\"\n\ \ \ \ \ \ \ \ \ \ set\ XMLtext\ \"<document>\[TextToXML\ \$w\]</document>\"\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ #\ Return\ the\ first\ child\ (which\ is\ all\ the\ contents)\n\ \ \ \ \ \ \ \ \ \ return\ \[dom::node\ cget\ \[dom::parse\ \$XMLtext\]\ -firstChild\]\n\ \ \ \ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \ \ \ #############################################\n\ \ \ \ \ \ \ ##\n\ \ \ \ \ \ \ ##\ Supporting\ routines\n\ \ \ \ \ \ \ ##\n\ \ \ \ \ \ \ #############################################\n\ \ \ \ \n\ \ \ \ \ \ \ proc\ expandNodes\ \{w\ paraNode\}\ \{\n\ \ \ \ \ \ \ \ \ \ variable\ tagArray\n\ \ \ \ \ \ \ \ \ \ variable\ paraElem\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ set\ childList\ \[dom::node\ children\ \$paraNode\]\n\ \ \ \ \ \ \ \ \ \ foreach\ child\ \$childList\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\[dom::node\ cget\ \$child\ -nodeType\]\ !=\ \"textNode\"\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ Recursively\ call\ expandNodes,\ to\ nest\ tags\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ Nested\ tags\ follow\ formatting\ rules\ for\ Tk\ text\ widget\ tags\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ xtt::expandNodes\ \$w\ \$child\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ set\ type\ \[dom::node\ cget\ \[dom::node\ parent\ \$child\]\ -nodeName\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ set\ val\ \[stripNewlines\ \[dom::node\ cget\ \$child\ -nodeValue\]\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$type\ ==\ \$paraElem\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$w\ insert\ end\ \$val\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$w\ insert\ end\ \$val\ \$tagArray(\$type)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \ \ \ proc\ stripNewlines\ \{text\}\ \{\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ #\ Loop\ through\ and\ remove\ any\ newlines\ from\ text.\ Replace\ with\ a\ space\ if\ adjacent\ characters\ are\ not\ spaces,\n\ \ \ \ \ \ \ \ \ \ #\ \ \ or\ if\ not\ at\ beginning\ or\ end\ of\ string.\n\ \ \ \ \ \ \ \ \ \ while\ \{\[string\ first\ \"\\n\"\ \$text\]\ !=\ -1\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ set\ newlinePos\ \[string\ first\ \"\\n\"\ \$text\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ set\ charBefore\ \[expr\ \$newlinePos\ -\ 1\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ set\ charAfter\ \[expr\ \$newlinePos\ +\ 1\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ set\ alreadySpace\ false\n\ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$newlinePos\ ==\ 0\ ||\ \$newlinePos\ ==\ \[expr\ \[string\ length\ \$text\]\ -\ 1\]\}\ \{set\ alreadySpace\ true\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$newlinePos\ !=\ 0\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\[string\ range\ \$text\ \$charBefore\ \$charBefore\]\ ==\ \"\ \"\}\ \{set\ alreadySpace\ true\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$newlinePos\ !=\ \[expr\ \[string\ length\ \$text\]\ -\ 1\]\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\[string\ range\ \$text\ \$charAfter\ \$charAfter\]\ ==\ \"\ \"\}\ \{set\ alreadySpace\ true\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$alreadySpace\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ replaceText\ \"\"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ replaceText\ \"\ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ set\ text\ \[string\ replace\ \$text\ \$newlinePos\ \$newlinePos\ \$replaceText\]\n\ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ return\ \$text\n\ \ \ \ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \ \ \ proc\ getTagCode\ \{code\}\ \{\n\ \ \ \ \ \ \ \ \ \ variable\ tagArray\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ foreach\ name\ \[array\ names\ tagArray\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$tagArray(\$name)\ ==\ \$code\}\ \{return\ \$name\}\n\ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ error\ \"Tag\ code\ does\ not\ exist\"\n\ \ \ \ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \n\ \ \ \ \}\n======\n\nA\ demo\ script:\n======\n\ \ \ \ source\ \"xtt.tcl\"\n\ \ \ \ \n\ \ \ \ ##\n\ \ \ \ ##\ Set\ up\ the\ text\ widget\n\ \ \ \ ##\n\ \ \ \ set\ font(normal)\ \"Times\ 12\"\n\ \ \ \ set\ font(ital)\ \"\$font(normal)\ italic\"\n\ \ \ \ set\ font(bold)\ \"\$font(normal)\ bold\"\n\ \ \ \ set\ font(boldital)\ \"\$font(normal)\ bold\ italic\"\n\ \ \ \ set\ font(small)\ \"Times\ 8\"\n\ \ \ \ \n\ \ \ \ text\ .t\ -font\ \$font(normal)\ -wrap\ word\ -spacing3\ 18p\ -spacing2\ 6p\ -width\ 70\ -height\ 10\n\ \ \ \ \n\ \ \ \ #\ Add\ the\ \".proc\"\ window\ to\ look\ at\ the\ processed\ XML\n\ \ \ \ text\ .proc\ -font\ \$font(normal)\ -wrap\ word\ -width\ 70\ -height\ 10\n\ \ \ \ \n\ \ \ \ pack\ .t\ -fill\ both\ -expand\ yes\ -side\ top\n\ \ \ \ pack\ .proc\ -fill\ both\ -expand\ yes\n\ \ \ \ \n\ \ \ \ .t\ tag\ config\ italic\ -font\ \$font(ital)\n\ \ \ \ .t\ tag\ config\ bold\ -font\ \$font(bold)\n\ \ \ \ .t\ tag\ config\ boldital\ -font\ \$font(boldital)\n\ \ \ \ .t\ tag\ config\ super\ -offset\ 6\ -font\ \$font(small)\n\ \ \ \ .t\ tag\ config\ sub\ -offset\ -6\ -font\ \$font(small)\n\ \ \ \ \n\ \ \ \ ##\n\ \ \ \ ##\ Load\ the\ xml\ source\n\ \ \ \ ##\n\ \ \ \ set\ xmlFile\ \[open\ \"TestDoc.xml\"\ r\]\n\ \ \ \ set\ document\ \[read\ \$xmlFile\]\n\ \ \ \ close\ \$xmlFile\n\ \ \ \ \n\ \ \ \ ##\n\ \ \ \ ##\ Process\ the\ xml\ source\n\ \ \ \ ##\n\ \ \ \ #\ Move\ from\ \"document\"\ down\ to\ the\ main\ node\n\ \ \ \ set\ parsedDoc\ \[dom::node\ cget\ \[dom::parse\ \$document\]\ -firstChild\]\n\ \ \ \ \n\ \ \ \ ########################################################\n\ \ \ \ ##\n\ \ \ \ ##\ This\ is\ the\ interface\ between\ text\ widget\ and\ XML\n\ \ \ \ ##\n\ \ \ \ ########################################################\n\ \ \ \ \n\ \ \ \ ##\n\ \ \ \ ##\ Associate\ XML\ codes\ with\ text\ widget\ tags\n\ \ \ \ ##\n\ \ \ \ set\ xtt::tagArray(i)\ italic\n\ \ \ \ set\ xtt::tagArray(b)\ bold\n\ \ \ \ set\ xtt::tagArray(bi)\ boldital\n\ \ \ \ set\ xtt::tagArray(sup)\ super\n\ \ \ \ set\ xtt::tagArray(sub)\ sub\n\ \ \ \ \n\ \ \ \ xtt::XMLtoText\ .t\ \$parsedDoc\n\ \ \ \ \n\ \ \ \ .proc\ insert\ end\ \[xtt::TextToXML\ .t\]\n\ \ \ \ \n\ \ \ \ ########################################################\n\ \ \ \ ##\n\ \ \ \ ##\ End\ of\ interface\n\ \ \ \ ##\n\ \ \ \ ########################################################\n======\n\ \ \ \ \n\nThe\ sample\ file,\ ''TestDoc.xml''\ used\ by\ the\ demo\ script:\n\ \ \ \ <body>\n\ \ \ \ <p>\n\ \ \ \ This\ is\ text,\ <i>this\ is\ italicized</i>,\ this\ is\ normal.\ Here's\ a\ subscript:\ CO<sub>2</sub>.\ The\ rest\ of\ the\ paragraph\ is\ pretty\ long,\n\ \ \ \ allowing\ it\ to\ be\ wrapped\ in\ the\ window.\ It\ just\ keeps\ going\ and\ going\ and\ there\ isn't\ much\ you\ can\ do\ about\ it.\ What\ would\ you\ do\ about\ it,\ anyway?\ Just\ make\ sure\ it\ wraps\n\ \ \ \ properly\ and\ also\ that\ any\ newlines\ in\ the\ XML\ file\ are\ properly\n\ \ \ \ stripped\ out\ before\ putting\ them\ in\ the\ text\ widget.\ Only\ text\ marked\n\ \ \ \ off\ with\ paragraph\ tags\ should\ receive\ newlines.\n\ \ \ \ </p>\n\ \ \ \ <p>\n\ \ \ \ This\ is\ another\ paragraph,\ with\ <b>bold</b>\ text\ in\ it.\ Later\ in\ this\ paragraph\ I\ will\ add\ some\ other\n\ \ \ \ special\ text,\ but\ first\ I\ want\ a\ long\ enough\ run\ of\ text\ that\ there\ may\ be\ some\ wrapping.\ Otherwise,\n\ \ \ \ I'm\ curious\ to\ see\ what\ a\ superscript<sup>1</sup>\ might\ look\ like.\n\ \ \ \ </p>\n\ \ \ \ <p>Unfortunately,\ xtt\ doesn't\ (yet)\ handle\ nested\ tags,\ so\ I\ have\ to\n\ \ \ \ make\ up\ a\ new\ tag\ to\ do\ <bi>bold\ italic</bi>.\ To\ have\ some\ bold\ text\ inside\n\ \ \ \ an\ italicized\ block,\ I\ have\ to\ do\ this:\ <i>This\ is\ </i><bi>so</bi>\ <i>italic!</i></p>\n\ \ \ \ </body>\n<<categories>>\ XML\n\n\n\n======\nif\ you\ prefer\ working\ with\ tdom\ replace\ these\ rows:\nin\ xtt.tcl\n\nline\ 1:\ package\ require\ tdom\nline\ 70:\ set\ paralist\ \[\$DOMnode\ getElementsByTagName\ \$paraElem\]\nline\ 71:\ foreach\ p\ \$paralist\ \{\nline\ 124:\ return\ \[dom\ parse\ \$XMLtext\]\nline\ 137:\ set\ childList\ \[\$paraNode\ childNodes\]\nline\ 145:\ set\ type\ \[\[\$child\ parentNode\]\ nodeName\]\n\nin\ test.tcl\n\ \ \ \ set\ parsedDoc\ \[dom\ \ parse\ \$document\] regexp2} CALL {my render {xtt: XML <--> Text Tag translator} \[EKB\]\ I\ wrote\ this\ long\ before\ I\ knew\ about\ this\ wiki.\ It\ converts\ tags\ in\ a\ text\ canvas\ to\ and\ from\ XML\ (so\ you\ can\ write\ up\ an\ XML\ file,\ then\ load\ it\ into\ a\ text\ widget).\ It\ needs\ some\ work\ (such\ as\ entities\ and\ handling\ nested\ tags),\ but\ can\ do\ a\ few\ tricks,\ so\ I\ thought\ it\ was\ worth\ sharing.\n\nThe\ main\ file,\ ''xtt.tcl'':\n======\n\ \ \ \ package\ require\ dom\ 2.0\n\ \ \ \ package\ require\ struct\n\ \ \ \ \n\ \ \ \ #\ xtt:\ The\ XML\ <-->\ Text\ Tag\ Translator\n\ \ \ \ #\ ver\ 1.0\n\ \ \ \ #\n\ \ \ \ #\ Copyright\ (c)\ 2003\ Eric\ Kemp-Benedict\n\ \ \ \ #\ All\ Rights\ Reserved\n\ \ \ \ #\n\ \ \ \ #\ This\ code\ is\ freely\ distributable,\ but\ is\ provided\ as-is\ with\n\ \ \ \ #\ no\ waranty\ expressed\ or\ implied.\n\ \ \ \ #\n\ \ \ \ #\ Send\ comments\ to\ [email protected].\ If\ you\ make\ improvements,\n\ \ \ \ #\ please\ send\ them\ to\ me.\ I\ will\ give\ you\ credit\ and\ distribute\ the\n\ \ \ \ #\ improved\ code.\ Thanks!\n\ \ \ \ \n\ \ \ \ #\ ==\ Description\ ==\n\ \ \ \ #\n\ \ \ \ #\ xtt\ offers\ an\ interface\ between\ a\ tk\ text\ widget's\ tags\ and\n\ \ \ \ #\ an\ XML\ document's\ tags.\n\ \ \ \ #\n\ \ \ \ #\ NOTE:\ It's\ pretty\ basic.\ In\ particular,\ it\ doesn't\ (yet)\ handle\n\ \ \ \ #\ nested\ tags\ or\ entities.\n\ \ \ \ #\n\ \ \ \ #\ To\ use\ it,\ just\ \"source\"\ xtt.tcl\ in\ your\ tcl\ script.\ Note\n\ \ \ \ #\ that\ xtt\ requires\ the\ dom\ and\ struct\ packages.\ Struct\ is\n\ \ \ \ #\ part\ of\ tcllib.\n\ \ \ \ #\n\ \ \ \ #\ Example:\n\ \ \ \ #\n\ \ \ \ #\ Step\ 1:\ Associate\ XML\ codes\ with\ text\ widget\ tags\n\ \ \ \ #\n\ \ \ \ #\ \ set\ xtt::tagArray(i)\ italic\ \ \ \ \ \ \;#\ \"i\"\ is\ the\ XML\ tag,\ \"italic\"\ is\ the\ text\ widget\ tag\n\ \ \ \ #\ \ set\ xtt::tagArray(b)\ bold\n\ \ \ \ #\ \ set\ xtt::tagArray(bi)\ boldital\n\ \ \ \ #\ \ set\ xtt::tagArray(sup)\ super\n\ \ \ \ #\ \ set\ xtt::tagArray(sub)\ sub\n\ \ \ \ #\n\ \ \ \ #\ Step\ 2:\ Specify\ a\ tag\ for\ a\ paragraph\ element\ (defaults\ to\ p,\ so\ this\ is\ optional)\n\ \ \ \ #\n\ \ \ \ #\ \ set\ xtt::paraElem\ para\n\ \ \ \ #\n\ \ \ \ #\ Step\ 3:\ Start\ translating!\n\ \ \ \ #\n\ \ \ \ #\ From\ XML\ ->\ TextWidget\n\ \ \ \ #\ \ xtt::XMLtoText\ .myTextWidget\ \$parsedXMLdoc\n\ \ \ \ #\n\ \ \ \ #\ From\ Text\ Widget\ ->\ XML\n\ \ \ \ #\ \ set\ XMLoutput\ \[xtt::TextToXML\ .t\]\n\ \ \ \ #\n\ \ \ \ #\ From\ Text\ Widget\ ->\ DOMnode\n\ \ \ \ #\ \ set\ DOMnode\ \[xtt::TextToDOM\ .t\]\n\ \ \ \ #\n\ \ \ \ \n\ \ \ \ namespace\ eval\ xtt\ \{\n\ \ \ \ \n\ \ \ \ \ \ \ #############################################\n\ \ \ \ \ \ \ ##\n\ \ \ \ \ \ \ ##\ Interface\n\ \ \ \ \ \ \ ##\n\ \ \ \ \ \ \ #############################################\n\ \ \ \ \n\ \ \ \ \ \ \ variable\ tagArray\n\ \ \ \ \ \ \ variable\ paraElem\ \"p\"\n\ \ \ \ \n\ \ \ \ \ \ \ proc\ XMLtoText\ \{w\ DOMnode\}\ \{\n\ \ \ \ \ \ \ \ \ \ variable\ tagArray\n\ \ \ \ \ \ \ \ \ \ variable\ paraElem\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ set\ paralist\ \[dom::element\ getElementsByTagName\ \$DOMnode\ \$paraElem\]\n\ \ \ \ \ \ \ \ \ \ foreach\ p\ \[set\ \$paralist\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ xtt::expandNodes\ \$w\ \$p\n\ \ \ \ \ \ \ \ \ \ \ \ \ \$w\ insert\ end\ \"\\n\"\n\ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \ \ \ proc\ TextToXML\ \{w\}\ \{\n\ \ \ \ \ \ \ \ \ \ #\ NOTE:\ The\ stack\ is\ for\ future\ flexibility.\ At\ the\ moment\ nested\ tags\ are\ not\n\ \ \ \ \ \ \ \ \ \ #\ processed.\ In\ future\ versions\ I\ expect\ to\ process\ nested\ tags\ and\ that\ will\n\ \ \ \ \ \ \ \ \ \ #\ be\ easier\ with\ a\ stack.\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ struct::stack\ tagStack\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ set\ dump\ \[\$w\ dump\ -tag\ -text\ 1.0\ end\]\n\ \ \ \ \ \ \ \ \ \ set\ length\ \[llength\ \$dump\]\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ set\ retval\ \"<p>\"\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ for\ \{set\ i\ 0\}\ \{\$i\ <\ \$length\}\ \{incr\ i\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ switch\ \[lindex\ \$dump\ \$i\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ text\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ incr\ i\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ retval\ \$retval\[lindex\ \$dump\ \$i\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ tagon\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ incr\ i\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ tagStack\ push\ \[xtt::getTagCode\ \[lindex\ \$dump\ \$i\]\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ retval\ \$retval<\[tagStack\ peek\]>\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ tagoff\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ incr\ i\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ retval\ \$retval</\[tagStack\ pop\]>\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ set\ retval\ \$retval</p>\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ #\ Replace\ all\ newlines\ with\ \"</p><p>\"\n\ \ \ \ \ \ \ \ \ \ regsub\ -all\ --\ \"\\\\n\"\ \$retval\ \"</p><p>\"\ retval\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ #\ Strip\ multiple\ newlines\ at\ the\ end\n\ \ \ \ \ \ \ \ \ \ regsub\ --\ \"(<p></p>)+\$\"\ \$retval\ \"\"\ retval\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ tagStack\ destroy\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ return\ \$retval\n\ \ \ \ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \ \ \ proc\ TextToDOM\ \{w\}\ \{\n\ \ \ \ \ \ \ \ \ \ #\ Wrap\ the\ XML\ in\ a\ fake\ \"document\"\n\ \ \ \ \ \ \ \ \ \ set\ XMLtext\ \"<document>\[TextToXML\ \$w\]</document>\"\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ #\ Return\ the\ first\ child\ (which\ is\ all\ the\ contents)\n\ \ \ \ \ \ \ \ \ \ return\ \[dom::node\ cget\ \[dom::parse\ \$XMLtext\]\ -firstChild\]\n\ \ \ \ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \ \ \ #############################################\n\ \ \ \ \ \ \ ##\n\ \ \ \ \ \ \ ##\ Supporting\ routines\n\ \ \ \ \ \ \ ##\n\ \ \ \ \ \ \ #############################################\n\ \ \ \ \n\ \ \ \ \ \ \ proc\ expandNodes\ \{w\ paraNode\}\ \{\n\ \ \ \ \ \ \ \ \ \ variable\ tagArray\n\ \ \ \ \ \ \ \ \ \ variable\ paraElem\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ set\ childList\ \[dom::node\ children\ \$paraNode\]\n\ \ \ \ \ \ \ \ \ \ foreach\ child\ \$childList\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\[dom::node\ cget\ \$child\ -nodeType\]\ !=\ \"textNode\"\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ Recursively\ call\ expandNodes,\ to\ nest\ tags\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ Nested\ tags\ follow\ formatting\ rules\ for\ Tk\ text\ widget\ tags\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ xtt::expandNodes\ \$w\ \$child\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ set\ type\ \[dom::node\ cget\ \[dom::node\ parent\ \$child\]\ -nodeName\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ set\ val\ \[stripNewlines\ \[dom::node\ cget\ \$child\ -nodeValue\]\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$type\ ==\ \$paraElem\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$w\ insert\ end\ \$val\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$w\ insert\ end\ \$val\ \$tagArray(\$type)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \ \ \ proc\ stripNewlines\ \{text\}\ \{\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ #\ Loop\ through\ and\ remove\ any\ newlines\ from\ text.\ Replace\ with\ a\ space\ if\ adjacent\ characters\ are\ not\ spaces,\n\ \ \ \ \ \ \ \ \ \ #\ \ \ or\ if\ not\ at\ beginning\ or\ end\ of\ string.\n\ \ \ \ \ \ \ \ \ \ while\ \{\[string\ first\ \"\\n\"\ \$text\]\ !=\ -1\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ set\ newlinePos\ \[string\ first\ \"\\n\"\ \$text\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ set\ charBefore\ \[expr\ \$newlinePos\ -\ 1\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ set\ charAfter\ \[expr\ \$newlinePos\ +\ 1\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ set\ alreadySpace\ false\n\ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$newlinePos\ ==\ 0\ ||\ \$newlinePos\ ==\ \[expr\ \[string\ length\ \$text\]\ -\ 1\]\}\ \{set\ alreadySpace\ true\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$newlinePos\ !=\ 0\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\[string\ range\ \$text\ \$charBefore\ \$charBefore\]\ ==\ \"\ \"\}\ \{set\ alreadySpace\ true\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$newlinePos\ !=\ \[expr\ \[string\ length\ \$text\]\ -\ 1\]\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\[string\ range\ \$text\ \$charAfter\ \$charAfter\]\ ==\ \"\ \"\}\ \{set\ alreadySpace\ true\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$alreadySpace\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ replaceText\ \"\"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ replaceText\ \"\ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ set\ text\ \[string\ replace\ \$text\ \$newlinePos\ \$newlinePos\ \$replaceText\]\n\ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ return\ \$text\n\ \ \ \ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \ \ \ proc\ getTagCode\ \{code\}\ \{\n\ \ \ \ \ \ \ \ \ \ variable\ tagArray\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ foreach\ name\ \[array\ names\ tagArray\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$tagArray(\$name)\ ==\ \$code\}\ \{return\ \$name\}\n\ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \ \ \ \ \ \ error\ \"Tag\ code\ does\ not\ exist\"\n\ \ \ \ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \n\ \ \ \ \}\n======\n\nA\ demo\ script:\n======\n\ \ \ \ source\ \"xtt.tcl\"\n\ \ \ \ \n\ \ \ \ ##\n\ \ \ \ ##\ Set\ up\ the\ text\ widget\n\ \ \ \ ##\n\ \ \ \ set\ font(normal)\ \"Times\ 12\"\n\ \ \ \ set\ font(ital)\ \"\$font(normal)\ italic\"\n\ \ \ \ set\ font(bold)\ \"\$font(normal)\ bold\"\n\ \ \ \ set\ font(boldital)\ \"\$font(normal)\ bold\ italic\"\n\ \ \ \ set\ font(small)\ \"Times\ 8\"\n\ \ \ \ \n\ \ \ \ text\ .t\ -font\ \$font(normal)\ -wrap\ word\ -spacing3\ 18p\ -spacing2\ 6p\ -width\ 70\ -height\ 10\n\ \ \ \ \n\ \ \ \ #\ Add\ the\ \".proc\"\ window\ to\ look\ at\ the\ processed\ XML\n\ \ \ \ text\ .proc\ -font\ \$font(normal)\ -wrap\ word\ -width\ 70\ -height\ 10\n\ \ \ \ \n\ \ \ \ pack\ .t\ -fill\ both\ -expand\ yes\ -side\ top\n\ \ \ \ pack\ .proc\ -fill\ both\ -expand\ yes\n\ \ \ \ \n\ \ \ \ .t\ tag\ config\ italic\ -font\ \$font(ital)\n\ \ \ \ .t\ tag\ config\ bold\ -font\ \$font(bold)\n\ \ \ \ .t\ tag\ config\ boldital\ -font\ \$font(boldital)\n\ \ \ \ .t\ tag\ config\ super\ -offset\ 6\ -font\ \$font(small)\n\ \ \ \ .t\ tag\ config\ sub\ -offset\ -6\ -font\ \$font(small)\n\ \ \ \ \n\ \ \ \ ##\n\ \ \ \ ##\ Load\ the\ xml\ source\n\ \ \ \ ##\n\ \ \ \ set\ xmlFile\ \[open\ \"TestDoc.xml\"\ r\]\n\ \ \ \ set\ document\ \[read\ \$xmlFile\]\n\ \ \ \ close\ \$xmlFile\n\ \ \ \ \n\ \ \ \ ##\n\ \ \ \ ##\ Process\ the\ xml\ source\n\ \ \ \ ##\n\ \ \ \ #\ Move\ from\ \"document\"\ down\ to\ the\ main\ node\n\ \ \ \ set\ parsedDoc\ \[dom::node\ cget\ \[dom::parse\ \$document\]\ -firstChild\]\n\ \ \ \ \n\ \ \ \ ########################################################\n\ \ \ \ ##\n\ \ \ \ ##\ This\ is\ the\ interface\ between\ text\ widget\ and\ XML\n\ \ \ \ ##\n\ \ \ \ ########################################################\n\ \ \ \ \n\ \ \ \ ##\n\ \ \ \ ##\ Associate\ XML\ codes\ with\ text\ widget\ tags\n\ \ \ \ ##\n\ \ \ \ set\ xtt::tagArray(i)\ italic\n\ \ \ \ set\ xtt::tagArray(b)\ bold\n\ \ \ \ set\ xtt::tagArray(bi)\ boldital\n\ \ \ \ set\ xtt::tagArray(sup)\ super\n\ \ \ \ set\ xtt::tagArray(sub)\ sub\n\ \ \ \ \n\ \ \ \ xtt::XMLtoText\ .t\ \$parsedDoc\n\ \ \ \ \n\ \ \ \ .proc\ insert\ end\ \[xtt::TextToXML\ .t\]\n\ \ \ \ \n\ \ \ \ ########################################################\n\ \ \ \ ##\n\ \ \ \ ##\ End\ of\ interface\n\ \ \ \ ##\n\ \ \ \ ########################################################\n======\n\ \ \ \ \n\nThe\ sample\ file,\ ''TestDoc.xml''\ used\ by\ the\ demo\ script:\n\ \ \ \ <body>\n\ \ \ \ <p>\n\ \ \ \ This\ is\ text,\ <i>this\ is\ italicized</i>,\ this\ is\ normal.\ Here's\ a\ subscript:\ CO<sub>2</sub>.\ The\ rest\ of\ the\ paragraph\ is\ pretty\ long,\n\ \ \ \ allowing\ it\ to\ be\ wrapped\ in\ the\ window.\ It\ just\ keeps\ going\ and\ going\ and\ there\ isn't\ much\ you\ can\ do\ about\ it.\ What\ would\ you\ do\ about\ it,\ anyway?\ Just\ make\ sure\ it\ wraps\n\ \ \ \ properly\ and\ also\ that\ any\ newlines\ in\ the\ XML\ file\ are\ properly\n\ \ \ \ stripped\ out\ before\ putting\ them\ in\ the\ text\ widget.\ Only\ text\ marked\n\ \ \ \ off\ with\ paragraph\ tags\ should\ receive\ newlines.\n\ \ \ \ </p>\n\ \ \ \ <p>\n\ \ \ \ This\ is\ another\ paragraph,\ with\ <b>bold</b>\ text\ in\ it.\ Later\ in\ this\ paragraph\ I\ will\ add\ some\ other\n\ \ \ \ special\ text,\ but\ first\ I\ want\ a\ long\ enough\ run\ of\ text\ that\ there\ may\ be\ some\ wrapping.\ Otherwise,\n\ \ \ \ I'm\ curious\ to\ see\ what\ a\ superscript<sup>1</sup>\ might\ look\ like.\n\ \ \ \ </p>\n\ \ \ \ <p>Unfortunately,\ xtt\ doesn't\ (yet)\ handle\ nested\ tags,\ so\ I\ have\ to\n\ \ \ \ make\ up\ a\ new\ tag\ to\ do\ <bi>bold\ italic</bi>.\ To\ have\ some\ bold\ text\ inside\n\ \ \ \ an\ italicized\ block,\ I\ have\ to\ do\ this:\ <i>This\ is\ </i><bi>so</bi>\ <i>italic!</i></p>\n\ \ \ \ </body>\n<<categories>>\ XML\n\n\n\n======\nif\ you\ prefer\ working\ with\ tdom\ replace\ these\ rows:\nin\ xtt.tcl\n\nline\ 1:\ package\ require\ tdom\nline\ 70:\ set\ paralist\ \[\$DOMnode\ getElementsByTagName\ \$paraElem\]\nline\ 71:\ foreach\ p\ \$paralist\ \{\nline\ 124:\ return\ \[dom\ parse\ \$XMLtext\]\nline\ 137:\ set\ childList\ \[\$paraNode\ childNodes\]\nline\ 145:\ set\ type\ \[\[\$child\ parentNode\]\ nodeName\]\n\nin\ test.tcl\n\ \ \ \ set\ parsedDoc\ \[dom\ \ parse\ \$document\]} CALL {my revision {xtt: XML <--> Text Tag translator}} CALL {::oo::Obj4586393 process revision/xtt%3A+XML+%3C%2D%2D%3E+Text+Tag+translator} CALL {::oo::Obj4586391 process}

-errorcode

NONE

-errorinfo

Unknow state transition: LINE -> END
    while executing
"error $msg"
    (class "::Wiki" method "render_wikit" line 6)
    invoked from within
"my render_$default_markup $N $C $mkup_rendering_engine"
    (class "::Wiki" method "render" line 8)
    invoked from within
"my render $name $C"
    (class "::Wiki" method "revision" line 31)
    invoked from within
"my revision $page"
    (class "::Wiki" method "process" line 56)
    invoked from within
"$server process [string trim $uri /]"

-errorline

4