This procedure is defined in the server but not documented via ad_proc or proc_doc and may be intended as a private interface.
The procedure is defined as:
proc sgml::tokenise {sgml elemExpr elemSub args} {
array set options {-final 1}
catch {array set options $args}
set options(-final) [Boolean $options(-final)]
# If the data is not final then there must be a variable to store
# unused data.
if {!$options(-final) && ![info exists options(-statevariable)]} {
return -code error {option "-statevariable" required if not final}
}
# Pre-process stage
#
# Extract the internal DTD subset, if any
catch {upvar #0 $options(-internaldtdvariable) dtd}
if {[regexp {<!DOCTYPE[^[<]+\[([^]]+)\]} $sgml discard dtd]} {
regsub {(<!DOCTYPE[^[<]+)(\[[^]]+\])} $sgml {\1\&xml:intdtd;} sgml
}
# Protect Tcl special characters
regsub -all -- {([{}\\])} $sgml {\\\1} sgml
# Do the translation
if {[info exists options(-statevariable)]} {
upvar #0 $opts(-statevariable) unused
if {[info exists unused]} {
regsub -all -- $elemExpr $unused$sgml $elemSub sgml
unset unused
} else {
regsub -all -- $elemExpr $sgml $elemSub sgml
}
set sgml "{} {} {} \{$sgml\}"
# Performance note (Tcl 8.0):
# Use of lindex, lreplace will cause parsing to list object
if {[regexp {^([^<]*)(<[^>]*$)} [lindex $sgml end] x text unused]} {
set sgml [lreplace $sgml end end $text]
}
} else {
# Performance note (Tcl 8.0):
# In this case, no conversion to list object is performed
regsub -all -- $elemExpr $sgml $elemSub sgml
set sgml "{} {} {} \{$sgml\}"
}
return $sgml
}