+ // We don't know how to input or include non-LyX files. Input it as a comment.
+ FileName const included_file = includedFileName(buffer(), params());
+ if (!isLyXFileName(included_file.absFileName())) {
+ if (!rp.silent)
+ frontend::Alert::warning(_("Unsupported Inclusion"),
+ bformat(_("LyX does not know how to process included non-LyX files when "
+ "generating DocBook output. The content of the file will be output as a "
+ "comment. Offending file:\n%1$s"),
+ ltrim(params()["filename"])));
+
+ // Read the file, output it wrapped into comments.
+ xs << XMLStream::ESCAPE_NONE << "<!-- Included file: ";
+ xs << from_utf8(included_file.absFileName());
+ xs << XMLStream::ESCAPE_NONE << " -->";
+
+ xs << XMLStream::ESCAPE_NONE << "<!-- ";
+ xs << included_file.fileContents("UTF-8");
+ xs << XMLStream::ESCAPE_NONE << " -->";
+
+ xs << XMLStream::ESCAPE_NONE << "<!-- End of included file: ";
+ xs << from_utf8(included_file.absFileName());
+ xs << XMLStream::ESCAPE_NONE << " -->";