Output an XML preamble

slava 2006-02-04 01:17:18 +00:00
parent e45dc57d7c
commit 58d17c9f9b
2 changed files with 5 additions and 2 deletions

View File

@ -190,7 +190,7 @@ M: html-stream stream-terpri [ <br/> ] with-stream* ;
</style> ; </style> ;
: xhtml-preamble : xhtml-preamble
"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>" print xml-preamble print
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">" print ; "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">" print ;
: html-document ( title quot -- ) : html-document ( title quot -- )

View File

@ -367,8 +367,11 @@ M: comment (xml>string)
comment-text % comment-text %
"-->" % ; "-->" % ;
: xml-preamble
"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>" ;
: xml>string ( xml -- string ) : xml>string ( xml -- string )
[ (xml>string) ] "" make ; [ xml-preamble % (xml>string) ] "" make ;
: xml-reprint ( string -- string ) : xml-reprint ( string -- string )
xml xml>string ; xml xml>string ;