473,543 Members | 1,916 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 1867
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
2083
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...
0
1644
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
3416
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...
16
7071
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();...
82
5613
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...
9
3126
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...
24
2603
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"...
30
2226
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
4319
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...
0
7594
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7746
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...
1
7354
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...
0
7693
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5888
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5282
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...
0
3394
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1824
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.