misplaced-directive ( line -- * )
XML parsing errors
Prev:attr-w/< ( -- * )


Vocabulary
xml.errors

Class description
Describes the error where an internal DTD directive is used outside of a DOCTYPE or DTD file, or where a DOCTYPE occurs somewhere other than before the main tag of an XML document.

Bad XML document for the error
<x><!ENTITY foo 'bar'></x>


Definition
IN: xml.errors

TUPLE: misplaced-directive
{ line read-only } { column read-only } { dir read-only } ;


USING: generalizations kernel xml.state ;

IN: xml.errors

: misplaced-directive ( line -- * )
\ misplaced-directive 2 [ get-line get-column ] swap ndip
boa throw ;


Methods
USING: accessors debugger generic io kernel xml.errors
xml.writer ;

M: misplaced-directive error.
dup M\ misplaced-directive error. (call-next-method)
"Misplaced directive:" print dir>> write-xml nl ;