1 ! Copyright (C) 2005, 2006 Daniel Ehrenberg
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: accessors debugger io kernel prettyprint sequences
4 xml.errors xml.writer ;
5 IN: xml.errors.debugger
8 "XML parsing error" print
9 "Line: " write dup line>> .
10 "Column: " write column>> . ;
14 "Token expected: " write dup should-be>> print
15 "Token present: " write was>> print ;
17 M: unexpected-end error.
19 "File unexpectedly ended." print ;
21 M: missing-close error.
23 "Missing closing token." print ;
25 M: disallowed-char error.
27 "Disallowed character in XML document: " write
31 drop "XML document contains multiple main tags" print ;
33 M: pre/post-content error.
34 "The text string:" print
37 pre?>> "before" "after" ? write
38 " the main tag." print ;
42 "Entity does not exist: &" write thing>> write ";" print ;
46 "Mismatched tags" print
47 "Opening tag: <" write dup open>> print-name ">" print
48 "Closing tag: </" write close>> print-name ">" print ;
54 tags>> [ " <" write print-name ">" print ] each ;
58 "Bad URI:" print string>> . ;
62 "Namespace " write name>> write " has not been declared" print ;
66 "Closed an unopened tag" print ;
70 "standalone must be either yes or no, not \"" write
71 text>> write "\"." print ;
75 "Extra attributes included in xml version declaration:" print
79 "XML version must be \"1.0\" or \"1.1\". Version here was " write
83 drop "XML document lacks a main tag" print ;
87 "Misplaced XML prolog" print
88 prolog>> write-xml nl ;
90 M: capitalized-prolog error.
92 "XML prolog name was partially or totally capitalized, using" print
93 "<?" write name>> write "...?>" write
94 " instead of <?xml...?>" print ;
96 M: versionless-prolog error.
98 "XML prolog lacks a version declaration" print ;
100 M: bad-directive error.
102 "Unknown directive:" print
106 call-next-method "Extra content in directive" print ;
108 M: bad-external-id error.
109 call-next-method "Bad external ID" print ;
111 M: misplaced-directive error.
113 "Misplaced directive:" print
118 "Invalid name: " write name>> print ;
120 M: unclosed-quote error.
122 "XML document ends with quote still open" print ;
124 M: quoteless-attr error.
125 call-next-method "Attribute lacks quotes around value" print ;
129 "Attribute value contains literal <" print ;
133 "Text node contains ']]>'" print ;
135 M: duplicate-attr error.
136 call-next-method "Duplicate attribute" print ;
139 call-next-method "CDATA occurs before or after main tag" print ;
141 M: not-enough-characters error.
143 "Not enough characters" print ;
145 M: bad-doctype error.
146 call-next-method "DTD contains invalid object" print ;
148 M: bad-encoding error.
150 "Encoding in XML document does not exist" print ;