signature CopyOutput = sig type Dtd include CopyEncode val startDtd : UniChar.Data val endDecl : UniChar.Data val printError : Errors.Position * Errors.Error -> unit val printWarning : Errors.Position * Errors.Warning -> unit val putDecl : File * Dtd * HookData.DeclInfo -> File val putXmlDecl : File * HookData.XmlDecl -> File val putProcInst : File * HookData.ProcInstInfo -> File val putComment : File * HookData.CommentInfo -> File val putStartTag : File * Dtd * HookData.StartTagInfo -> File val putEndTag : File * Dtd * HookData.EndTagInfo -> File val putCData : File * UniChar.Vector -> File val putExtId : File * Base.ExternalId -> File end functor CopyOutput (structure ParserOptions : ParserOptions) : CopyOutput = struct structure CopyEncode = CopyEncode (structure ParserOptions = ParserOptions) open Base DfaData Dtd Errors ParserOptions UniChar Uri CopyEncode CopyOptions HookData fun printError(pos,err) = if !O_SILENT then () else TextIO.output (!O_ERROR_DEVICE,formatMessage (4,!O_ERROR_LINEWIDTH) (Position2String pos ::(if isFatalError err then "Fatal error:" else "Error:") ::errorMessage err)) fun printWarning(pos,warn) = if !O_SILENT then () else TextIO.output (!O_ERROR_DEVICE,formatMessage (4,!O_ERROR_LINEWIDTH) (Position2String pos^" Warning:"::warningMessage warn)) val ANY = String2Data "ANY" val ATTLIST = String2Data "" val endCom = String2Data "-->" val endPi = String2Data "?>" val endSection= String2Data "]]>" val preAttDef = String2Data "\n " val startCom = String2Data "