473,412 Members | 2,087 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

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="description">, 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 1861
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="description">, 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="description"> 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
"description" 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.tut.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.tut.fi> wrote:
On the other hand, <meta name="description"> 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="description">.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #5
Stephen Poley <sb******************@xs4all.nl> 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="description">.


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
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. ...
0
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...
33
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...
16
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");...
82
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...
9
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...
24
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"...
30
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...
15
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.