473,763 Members | 7,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XHTML simple little header questions


Re. <title>, my impression has been that a line break is _NOT_ allowed
in the contained text. Is that true? Also, I gather a double quotation
mark in the text string (and ampersand, etc.) _IS_ acceptable, but not
char entities (such as &quote;), decimal characters (such as ‛)
or style-sheet defined elements (such as <q>).

Re. <meta name="descripti on">, is a line break acceptable here? My
impression is that for the enclosed descriptor string, one can't have
illicit characters (such as & and ") nor style-sheet defined elements
(such as <q>, etc.), but only decimal characters in lieu of illicit
characters (such as ‛).

Re. <meta name="keywords" >, same question about line breaks. For
XHTML, can one still freely choose either a comma-separated or
space-separated list? Is there any reason to choose one over the
other?

--
Haines Brown
br****@hartford-hwp.com
kb****@arrl.net
www.hartford-hwp.com

Jul 20 '05 #1
5 1880
Haines Brown <br****@teufel. hartford-hwp.com> wrote:
Re. <title>, my impression has been that a line break is _NOT_
allowed in the contained text. Is that true?
No, in element content, a line break is always permitted. It is
equivalent to a space (except within a <pre> or <textarea> element).
Also, I gather a
double quotation mark in the text string (and ampersand, etc.) _IS_
acceptable, but not char entities (such as &quote;), decimal
characters (such as ‛) or style-sheet defined elements (such
as <q>).
The content model of <title> is #PCDATA, parsed character data, which
means that any characters are allowed and entity references (such as
&quot; - note the spelling, &quote; is undefined) and character
references (such as ‛) are allowed, but no elements (such as
<q>) are allowed. The quotation mark " is no problem, whereas the
ampersand & can be, so it is safest to escape it as &amp; unless it is
meant to start an entity or character reference.

However, browsers get this partly wrong. For example, IE 6 on Win98
seems to get ‛ very wrong. I had noticed that it displays –
as a thick vertical bar (effectively as a symbol of undisplayable
character) but with ‛ things get _very_ wrong: if I have
<title>test ‛</title>
then IE ignores the entire <title> element and displays the page's URL
in the browser window's top bar where it normally shows the title.

On ISO-8859-1 encoded pages, ISO-8859-1 characters work well in the
<title> element, though. (Well, apart from the fact that the font used
by the browser there is somewhat inadequate.)
Re. <meta name="descripti on">, is a line break acceptable here?
You mean in the content attribute? That's partly a different thing. In
principle, line breaks are permitted in attribute values and are
equivalent to spaces. In practice, browsers sometimes get this wrong,
and the XHTML 1.0 recommendation says, in the (in)famous appendix C:
"Avoid line breaks and multiple white space characters within attribute
values. These are handled inconsistently by user agents."
As far as I know, this has nothing special to do with XHTML. Rather, it
is based on an observation of browser behavior, which is indeed
inconsistent. But this should be of little importance, since you mainly
write those <meta> tags for search engines, not browsers, and I think
search engines get this simple thing right.

On the other hand, <meta name="descripti on"> is not particularly
important. It is more important to start the _body_ of your document in
an interesting way - in a way that makes human readers immediately
interested and aware of the content and thereby gives good food to
search engines as well.

However, if, for example, a Mozilla user hits control-I on your page,
to view page info, he will see, under the "Meta" heading, a
"descriptio n" field. And there the line breaks seem to appear as double
vertical bars - at least on Mozilla 1.4 under Win98. This is somewhat
annoying, so it is best to write the description on one line if you can
afford it (that is, if your authoring tool lets you work conveniently
with long lines).
My
impression is that for the enclosed descriptor string, one can't
have illicit characters (such as & and ") nor style-sheet defined
elements (such as <q>, etc.), but only decimal characters in lieu
of illicit characters (such as ‛).
The content attribute of <meta> is declared as being of type CDATA,
which means (for attributes) effectively the same as #PCDATA. Thus,
entity and character references are OK. Tags are not recognized (but
neither are they errors - this deviates from #PCDATA, but we're getting
rather theoretical here). The quotation mark " is a special case, since
it is used as a delimiter, so inside the attribute value, it needs to
be escaped e.g. as &quot; (if you use " as delimiter - you could use
the apostrophe ' as well). Whether search engines get everything right
is a different matter.
Re. <meta name="keywords" >, same question about line breaks.
Ditto. But this <meta> tag is rather useless, since search engines have
largely ignored it for years, due to widespread abuse.
For
XHTML, can one still freely choose either a comma-separated or
space-separated list? Is there any reason to choose one over the
other?


Inside the content attribute in <meta name="keywords" content="...">,
you mean? This is not defined in any specification. There are various
rumors of what search engines actually do, but what sounds most
probable is that commas separate words and phrases, whereas spaces just
separate words _inside_ a phrase. So
content="foo, bar zap, zip zop"
would specify keywords/keyphrases "foo", "bar zap", "zip zop", and this
might be relevant when people use phrase search. But this is just an
educated guess, or maybe just speculation.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #2
"Jukka K. Korpela" <jk******@cs.tu t.fi> writes:
Haines Brown <br****@teufel. hartford-hwp.com> wrote:
Re. <title>, my impression has been that a line break is _NOT_
allowed in the contained text. Is that true?


No, in element content, a line break is always permitted. It is
equivalent to a space (except within a <pre> or <textarea> element).

....

Thank you very much; you straightened out a number of points.

--
Haines Brown
br****@hartford-hwp.com
kb****@arrl.net
www.hartford-hwp.com

Jul 20 '05 #3
On Mon, 5 Jan 2004, Jukka K. Korpela wrote:
However, browsers get this partly wrong.
Title bars are typically produced by facilities of the OS and/or the
window manager, so it could be that the browser itself is not at
fault (sometimes it is, sometimes it isn't).
For example, IE 6 on Win98
seems to get ‛ very wrong. I had noticed that it displays –
as a thick vertical bar (effectively as a symbol of undisplayable
character)
I can't speak for Win98 specifically, but I was following some advice
of yours when I found one solution to that class of problem: see
http://ppewww.ph.gla.ac.uk/~flavell/...ers-fonts.html
(search for your own name).
but with ‛ things get _very_ wrong: if I have
<title>test ‛</title>
then IE ignores the entire <title> element and displays the page's URL
in the browser window's top bar where it normally shows the title.


Bizarre.

Jul 20 '05 #4
On Mon, 5 Jan 2004 19:34:16 +0000 (UTC), "Jukka K. Korpela"
<jk******@cs.tu t.fi> wrote:
On the other hand, <meta name="descripti on"> is not particularly
important. It is more important to start the _body_ of your document in
an interesting way - in a way that makes human readers immediately
interested and aware of the content and thereby gives good food to
search engines as well.


Generally true, I think, but I did come across one Dutch search engine
recently whose help pages said (or at least implied) that it would only
index pages with a <meta name="descripti on">.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #5
Stephen Poley <sb************ ******@xs4all.n l> wrote:
I did come across one Dutch search engine
recently whose help pages said (or at least implied) that it would
only index pages with a <meta name="descripti on">.


Luckily there is a rich supply of search engines, so that we can ignore
such search engines that have no chances of getting much importance.
A search engine that decides to restrict searches to a small minority
of pages is hardly a successful effort.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2092
by: Captain Nemo | last post by:
Hi I'm essentially a back-end programmer so I don't know very much about Dreamweaver. However, I work with web-designers who are keen for me to write my pages using Dreamweaver templates. One problem that has emerged straight away is that of XHTML compliance. I understand (and please correct me if I'm wrong) that in order to achieve this, every document must start with a line like:
0
1659
by: Peter Rohleder | last post by:
Hi, I have a few simple questions in order to use modularized xhtml and getting it to work. A simple example may make this obviouse: Lets say we want to create a simple xml-file to reflect a faq-structure.
33
3471
by: Mark Tranchant | last post by:
My site now uses Apache MultiViews and some PHP code to determine whether your browser can handle the application/xhtml+xml media type. If it does, the document is sent with that content type and the XHTML 1.1 DOCTYPE. If not, it is sent as text/html and the XHTML 1.0 DOCTYPE. Details of how this is achieved and the problems solved en route can be seen in these two pages: http://tranchant.plus.com/notes/xhtml11
16
7117
by: Mcginkel | last post by:
I am trying to find a way to load XHTML content in an Iframe. I use to do this in html by using the following code : var iframeObject = document.createElement("iframe"); MyDiv.appendChild(iframeObject); var data = "<html><head><title>testing</title></head><body>data</body></html>" iframeObject.contentDocument.open(); iframeObject.contentDocument.writeln(data);
82
5712
by: Buford Early | last post by:
I read this in http://annevankesteren.nl/2004/12/xhtml-notes "A common misconception is that XHTML 1.1 is the latest version of the XHTML series. And although it was released a bit more than a year later then the first version of XHTML 1.0, the second edition is actually newer. Furthermore, XHTML 1.1 is not really the follow-up of XHTML 1.0" I thought that XHTML 1.1 was the follow-up to XHTML 1.0 and that XHTML 2.0 will someday be the...
9
3137
by: wardy1975 | last post by:
Hi All, Looking for a little expert advice on a few web standards issues. I am currently trying to understand the impact of web standards for a web application I work with. I have been doing a lot of research in the areas of XHTML and WAI compliance, and am attempting to come up with a recommendation for our product in terms of standards level compliance. Ideally, I would like to be at XHTML 1.0 Strict. However, in my reading I have...
24
2646
by: Dan Jacobson | last post by:
I shall jump on the XHTML bandwagon. I run my perfectly good html4/strict pages thru $ tidy -asxhtml -utf8 #to get: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Language" content="zh-tw" /> knowing all the time as...
30
2270
by: abracad_1999 | last post by:
Is it possible to serve valid xhtml with php? xhtml requires the 1st line: <?xml version="1.0" encoding="iso-8859-1"?> But php interprets the opening <? as a php statement. If I try to echo this in PHP: <?php echo '<?xml version="1.0" encoding="iso-8859-1"?>'; ?>
15
4356
by: Zhang Weiwu | last post by:
http://www.w3.org/MarkUp/2004/xhtml-faq provided a trick to serve xhtml webpage to IE as application/xml I used that trick and now every one of my xhtml webpage have following first 4 starting lines: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="curseIE.xsl"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9997
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9937
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.