W3C home > Mailing lists > Public > www-html@w3.org > March 2007

RE: Control Text-file Embedding in HTML-docs

From: Due Per-VCW437 <Per.Due@motorola.com>
Date: Wed, 28 Mar 2007 23:24:26 +0200
To: Asbjørn Ulsberg <asbjorn@ulsberg.no>, www-html@w3.org
Message-ID: <EAAB8BFF1D052A44830B467F3E9FB6B7026FD9DD@zuk35exm64.ds.mot.com>

Thanks for response.

The reason to have the TXT-files is reuse and "update-in-one-place" only.

If the same piece of text must be used in multiple HTML-documents it is  
nice to edit and maintain it in one place.
This ensures that the changes take effect everywhere the TXT-file is used.

If the text is embedded in HTML-documents it must be edited in multiple  
HTML-files when changes are needed.

I tried this:


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
This is
<object data="file:///D:/HtmlTest/File1.txt">
a test. This is a
<object data="file:///D:/HtmlTest/File2.txt">
<object data="file:///D:/HtmlTest/File3.txt" height="50%" width="50%">
is a test
<IFRAME src="file:///D:/HtmlTest/File1.txt">
<IFRAME src="file:///D:/HtmlTest/File2.txt">
a test
This is a
<IFRAME src="file:///D:/HtmlTest/File3.txt" height="50%" width="50%">

<TEXTAREA name="thetext" rows="20" cols="80">
First line of initial text.
Second line of initial text.



For TEXTAREA it doesn't seem to be possible to refer to an external file.

Both IFRAME and OBJECT causes text to be places in boxes in the HTML  
document for browsers:

Mozilla, Opera, Microsoft Internet Explorer.

Best Regards,


Per Hygum Due, Software Engineer,

-----Original Message-----
From: Asbjørn Ulsberg [mailto:asbjorn@ulsberg.no]
Sent: 28. marts 2007 18:07
To: Due Per-VCW437; www-html@w3.org
Subject: Re: Control Text-file Embedding in HTML-docs

On Wed, 28 Mar 2007 09:50:54 +0200, Due Per-VCW437 <Per.Due@motorola.com>

> <object data="file:///D:/HtmlTest/File1.txt">
> </object>
> <object data="file:///D:/HtmlTest/File2.txt">
> </object>

Wouldn't it be better to inline the text in a <div> element, like so:

    <div style="width: 10em; overflow: auto">
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit [...]

Alternatively, you could use the <iframe> instead of <object> and  
<textarea> instead of <div>. I'd go with inlining the content instead of  
having it externally, though, since that would make it available for all  
UAs, including Google.

Asbjørn Ulsberg           -=|=-        asbjorn@ulsberg.no
«He's a loathsome offensive brute, yet I can't look away»
Received on Thursday, 29 March 2007 09:19:54 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:06:15 UTC