• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/tcl-102/tcl_ext/xotcl/xotcl/library/xml/

Lines Matching +refs:sgml +refs:unclosed +refs:tag

0 # sgml.tcl --
33 # $Id: sgml.tcl,v 1.4 2006/09/27 08:12:40 neumann Exp $
35 package provide sgml 1.6
37 namespace eval sgml {
75 # sgml::tokenise --
80 # sgml text to tokenize
92 proc sgml::tokenise {sgml elemExpr elemSub args} {
108 if {[regexp {<!DOCTYPE[^[<]+\[([^]]+)\]} $sgml discard dtd]} {
109 regsub {(<!DOCTYPE[^[<]+)(\[[^]]+\])} $sgml {\1\&xml:intdtd;} sgml
113 regsub -all {([{}\\])} $sgml {\\\1} sgml
120 regsub -all $elemExpr $unused$sgml $elemSub sgml
123 regsub -all $elemExpr $sgml $elemSub sgml
125 set sgml "{} {} {} {} \{$sgml\}"
130 if {[regexp {^([^<]*)(<[^>]*$)} [lindex $sgml end] x text unused]} {
131 set sgml [lreplace $sgml end end $text]
139 regsub -all $elemExpr $sgml $elemSub sgml
140 set sgml "{} {} {} {} \{$sgml\}"
143 return $sgml
147 # sgml::parseEvent --
160 # sgml Instance data, as a Tcl list.
190 proc sgml::parseEvent {sgml args} {
238 foreach {tag close empty param text} $sgml {
251 if {[regexp ([cl ^-]*)--\$ $tag discard comm1]} {
252 # end of comment (in tag)
253 set tag {}
261 uplevel #0 $options(-commentcommand) [list $state(commentdata)<$close$tag$empty>$comm1]
263 set tag {}
270 uplevel #0 $options(-commentcommand) [list $state(commentdata)<$close$tag$param$empty>$comm1]
272 set tag {}
279 append state(commentdata) <$close$tag$param$empty>$text
284 if {[string length $param] && [regexp ([cl ^\]]*)\]\][cl $Wsp]*\$ $tag discard cdata1]} {
285 # end of CDATA (in tag)
288 set tag {}
293 uplevel #0 $options(-characterdatacommand) [list $state(cdata)<$close$tag$cdata1$text]
295 set tag {}
301 uplevel #0 $options(-characterdatacommand) [list $state(cdata)<$close$tag$param$empty>$cdata1$text]
303 set tag {}
311 append state(cdata) <$close$tag$param$empty>$text
322 set isEmpty [uplevel #0 $options(-emptyelement) [list $tag $param $empty]]
324 foreach {empty tag param} $isEmpty break
327 switch -glob -- [string length $tag],[regexp {^\?|!.*} $tag],$close,$empty {
330 # Ignore empty tag - dealt with non-normal mode above
334 # Start tag for an element.
356 ParseEvent:ElementOpen $tag $param options
363 # End tag for an element.
365 ParseEvent:ElementClose $tag options
373 ParseEvent:ElementOpen $tag $param options -empty 1
374 ParseEvent:ElementClose $tag options -empty 1
380 switch -glob -- $tag {
385 uplevel #0 $options(-errorcommand) "unexpected characters \"<$tag\" around line $state(line)"
423 uplevel #0 $options(-processinginstructioncommand) [list [string range $tag 1 end] [string trimleft $param]]
470 # See if it ends in the same tag, otherwise change the
473 regexp {!--(.*)} $tag discard comm1
475 # processed comment (end in tag)
493 regexp {!\[CDATA\[(.*)} $tag discard cdata1
523 uplevel #0 $options(-processinginstructioncommand) [list $tag $param]
526 uplevel #0 $options(-errorcommand) [list "unknown processing instruction \"<$tag>\" around line $state(line)"]
533 uplevel #0 $options(-errorcommand) [list [list syntax error: closed/empty tag: tag $tag param $param empty $empty close $close around line $state(line)]]
567 eval $options(-errorcommand) [list [list element [lindex $state(stack) end] remains unclosed around line $state(line)]]
573 # sgml::ParseEvent:ElementOpen --
578 # tag Element name
590 proc sgml::ParseEvent:ElementOpen {tag attr opts args} {
597 set tag [string toupper $tag]
601 lappend state(stack) $tag
617 uplevel #0 $options(-elementstartcommand) [list $tag $attr] $empty
622 # sgml::ParseEvent:ElementClose --
627 # tag Element name
638 proc sgml::ParseEvent:ElementClose {tag opts args} {
645 if {$tag ne [lindex $state(stack) end] } {
646 uplevel #0 $options(-errorcommand) [list "end tag \"$tag\" does not match open element \"[lindex $state(stack) end]\" around line $state(line)"]
659 uplevel #0 $options(-elementendcommand) [list $tag] $empty
664 # sgml::Normalize --
675 proc sgml::Normalize {name req} {
683 # sgml::Entity --
697 proc sgml::Entity {opts entityrefcmd pcdatacmd entities ref} {
788 # sgml::parseDTD --
801 proc sgml::parseDTD {dtd args} {
829 # sgml::DTD:ELEMENT --
853 proc sgml::DTD:ELEMENT {id value} {
884 # sgml::CModelParse --
899 proc sgml::CModelParse {state value} {
911 # sgml::CModelMakeSyntaxTree --
936 proc sgml::CModelMakeSyntaxTree {state spec} {
959 # sgml::CModelSTname --
972 proc sgml::CModelSTname {state name rep cs args} {
980 # sgml::CModelSTcp --
993 proc sgml::CModelSTcp {state cp rep cs} {
1032 # sgml::CModelSTcsSet --
1043 proc sgml::CModelSTcsSet {state cs} {
1055 # sgml::CModelSTcpAdd --
1067 proc sgml::CModelSTcpAdd {state cp rep} {
1079 # sgml::CModelSTopenParen --
1089 proc sgml::CModelSTopenParen {state args} {
1100 # sgml::CModelSTcloseParen --
1112 proc sgml::CModelSTcloseParen {state rep cs args} {
1125 # sgml::CModelMakeTransitionTable --
1140 proc sgml::CModelMakeTransitionTable {state st} {
1221 # sgml::followpos --
1235 proc sgml::followpos {state st firstpos lastpos} {
1277 # sgml::TraverseDepth1st --
1291 proc sgml::TraverseDepth1st {state t leaf nonTerm} {
1325 # sgml::firstpos --
1337 proc sgml::firstpos {cs firstpos nullable} {
1359 # sgml::lastpos --
1372 proc sgml::lastpos {cs lastpos nullable} {
1394 # sgml::makeSet --
1404 proc sgml::makeSet s {
1413 # sgml::nullable --
1426 proc sgml::nullable {nodeType rep name {subtree {}}} {
1463 namespace eval sgml {
1478 # sgml::DTD:ATTLIST --
1489 proc sgml::DTD:ATTLIST {id value} {
1511 # sgml::DTDAttribute --
1521 proc sgml::DTDAttribute {name type default {value {}}} {
1527 # sgml::DTD:ENTITY --
1538 proc sgml::DTD:ENTITY {id value} {
1570 # sgml::DTD:NOTATION --
1572 proc sgml::DTD:NOTATION {id value} {
1584 # sgml::noop --
1594 proc sgml::noop args {
1598 # sgml::identity --
1608 proc sgml::identity a {
1612 # sgml::Error --
1622 proc sgml::Error args {
1628 # sgml::zapWhite --
1638 proc sgml::zapWhite data {
1643 proc sgml::Boolean value {
1649 proc sgml::dbgputs {where text} {