473,326 Members | 2,010 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,326 software developers and data experts.

Use of tags in header meta statements

In XHTML docs, I find that the W3 Validator raises an objection to my
headers without actually invalidating the document.

Not in <title></title>, but in meta name="abstract" and
name="description" I find that the inclusion of <q></q> is objected to
by the W3 validator. I'm told "< is first character of a delimiter,
but occurred as data."

I'm having trouble understanding this is significant. Is the "<"
definitely to be avoided (by using " for double quotes), or should
this alert simply be ignored because the document does validate OK?

I assume that whatever the answer is would apply as well to such
things as <span></span>

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

Jul 20 '05 #1
18 2575
Haines Brown <br****@hartford-hwp.com> writes:
In XHTML docs, I find that the W3 Validator raises an objection to
my headers without actually invalidating the document.

Not in <title></title>, but in meta name="abstract" and
name="description" I find that the inclusion of <q></q> is objected
to by the W3 validator. I'm told "< is first character of a
delimiter, but occurred as data."


I'm not sure if I'm getting what you're saying, but I assume you have
something like

<meta name="description" content="foo <q>bar</q> baz"/>.

This is not valid; you cannot have elements in an attribute value. In
addition, the less-than sign is not allowed literally in an attribute
value at all; it has be represented by &lt; or by a character
reference.

You will have to use quotation mark characters instead of the q
element, something like

<meta name="description" content='foo "bar" baz'>.

This lack of structure in attribute values is a recognized problem, and
it is proposed that in XHTML 2 the meta element will not be empty:
you will be able to write

<meta name="description">foo <q>bar</q> baz</meta>.

This is also one of the reasons <object>...</object> is superior to
<img alt="..."/>.

--
Dean Tiegs, NE¼-20-52-25-W4
“Confortare et esto robustus”
http://telusplanet.net/public/dctiegs/
Jul 20 '05 #2
In article <m2************@hartford-hwp.com>, one of infinite monkeys
at the keyboard of Haines Brown <br****@hartford-hwp.com> wrote:
In XHTML docs, I find that the W3 Validator raises an objection to my
headers without actually invalidating the document.


I don't know what you mean by that. Please post a URL that demonstrates
what you're talking about.

--
Nick Kew

In urgent need of paying work - see http://www.webthing.com/~nick/cv.html
Jul 20 '05 #3
Haines Brown <br****@hartford-hwp.com> writes:
Thanks. Understood. But I wonder, since <title>...</title> is a
container, how does one quote? I assume I can't use a quotation mark
because it is a reserved character, but could I use <q></q>? Or do
I have to:

<title>foo "bar" baz</title>
The character <"> is not reserved in this context; <title>foo "bar"
baz</title> is perfectly OK. The only place <"> is reserved is in an
attribute value that is delimited by <">. The element "title" is one
of the few elements (maybe the only one?) in XHTML that can contain
character data but no elements.
My inclination instead would be to use:

<meta name="description" content="foo 'bar' baz">

Would there be any difference?
Not really, just follow your personal (or national) preference for
when to use single or double quotation marks.
I assume that I could perfectly well also use:

<meta name="description" content="foo "bar" baz">

or even:

<meta name="description" content="foo “bar” baz">
Yes, both are OK.
when is XHTML 2 going to be usable?
Don't hold your breath. XHTML 1 is not really usable yet because the
most popular browser doesn't support it.
Dean Tiegs <da*******@telus.net> writes:
This is also one of the reasons <object>...</object> is superior to
<img alt="..."/>.


Very interesting. Are you actually recommending this at present?


No, none of the leading browsers support it correctly yet. I use it
in some documents when I don't care how it renders for anybody else,
but for my "real" work I stick to the img element.

--
Dean Tiegs, NE¼-20-52-25-W4
“Confortare et esto robustus”
http://telusplanet.net/public/dctiegs/
Jul 20 '05 #4
In article <87************@telus.net>,
Dean Tiegs <da*******@telus.net> wrote:
Haines Brown <br****@hartford-hwp.com> writes:
In XHTML docs, I find that the W3 Validator raises an objection to
my headers without actually invalidating the document.

Not in <title></title>, but in meta name="abstract" and
name="description" I find that the inclusion of <q></q> is objected
to by the W3 validator. I'm told "< is first character of a
delimiter, but occurred as data."


I'm not sure if I'm getting what you're saying, but I assume you have
something like

<meta name="description" content="foo <q>bar</q> baz"/>.

This is not valid; you cannot have elements in an attribute value. In
addition, the less-than sign is not allowed literally in an attribute
value at all; it has be represented by &lt; or by a character
reference.


Hmmm. Yes and no. It's certainly not going to achieve the goal you were
after, but AFAICT it's not actually invalid. The Validator is giving
you a warning because it thinks you've made a mistake, but it's not
actually invalid to use a "delimiter as data". Another case of SGML
allowing something that appears completely nonsensical to humans
because it is actually possible to disambiguate it.
BTW, take this with a grain of salt. I'm basing this mainly on OpenSP's
behaviour (i.e. classifying it as a warning and not an error) and
previous instances where SGML has turned out to allow seemingly
ambigious constructs. I haven't actually tried to look this up.

--
T.E.R.J.E. - Technician Engineered for Repair and Justified Exploration
B.L.E.S.S. - Biomechanical Lifeform Engineered for Scientific Sabotage
Jul 20 '05 #5
Dean Tiegs <da*******@telus.net> writes:
The character <"> is not reserved in this context; <title>foo "bar"
baz</title> is perfectly OK. The only place <"> is reserved is in
an attribute value that is delimited by <">. The element "title" is
one of the few elements (maybe the only one?) in XHTML that can
contain character data but no elements.


Thanks you seem to have answered all my questions. I suspected the
situation was as you say, but was not sure.
when is XHTML 2 going to be usable?


Don't hold your breath. XHTML 1 is not really usable yet because
the most popular browser doesn't support it.


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

Jul 20 '05 #6
ni**@fenris.webthing.com (Nick Kew) writes:
In article <m2************@hartford-hwp.com>, one of infinite
monkeys
at the keyboard of Haines Brown <br****@hartford-hwp.com> wrote:
In XHTML docs, I find that the W3 Validator raises an objection to
my headers without actually invalidating the document.


I don't know what you mean by that. Please post a URL that
demonstrates what you're talking about.


Can't very well, for it was a local document not yet n line, so I copy
here one of the offending lines (I here restore it to its original
[offending] condition:

<meta name="description" content="Clôture de la conférence
nationale sur le thème: <q>les droits de la femme tunisienne:
acquis et perspectives</q>" />

The opening first angle bracket within in the content string caused
the alert I quoted before, which seems to boil down to the objection
that I'm using a reserved special character where there should be a
data character.

Any idea why the W3 Validator did not invalidate the document because
of this error?

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

Jul 20 '05 #7
On Mon, Jul 21, Dean Tiegs inscribed on the eternal scroll:
<meta name="description" content="foo <q>bar</q> baz"/>.

This is not valid;
Is that really so???
you cannot have elements in an attribute value.
I agree. So the character strings <q> and </q> are just strings of
characters, with no particular significance to (X)HTML, despite their
apparent resemblance to tags.

I reckon the above syntax qualifies as syntactically "valid" (it just
doesn't happen to mean what we might guess it had been intended to
mean).
In addition, the less-than sign is not allowed literally in an
attribute value at all;


Again I question the accuracy of that statement. "Inadvisable",
certainly, but by no means "not allowed", or else I reckon that the
formal validator would report an error, (rather than a warning, which
seems to be what was under discussion here).

Well, I'm sure that this was legal in HTML: can you cite something in
the specifications which rules it out in XHTML? I don't see anything
listed in http://www.w3.org/TR/xhtml1/#diffs for example which would
rule-out this usage.

Jul 20 '05 #8
In article <m2************@hartford-hwp.com>, one of infinite monkeys
at the keyboard of Haines Brown <br****@hartford-hwp.com> wrote:
I don't know what you mean by that. Please post a URL that
demonstrates what you're talking about.


Can't very well, for it was a local document not yet n line,


Any good reason you can't demo it with a five-line dummy document?

--
Nick Kew

In urgent need of paying work - see http://www.webthing.com/~nick/cv.html
Jul 20 '05 #9
"Alan J. Flavell" <fl*****@mail.cern.ch> writes:
Again I question the accuracy of that statement. "Inadvisable",
certainly, but by no means "not allowed", or else I reckon that the
formal validator would report an error, (rather than a warning,
which seems to be what was under discussion here).

Well, I'm sure that this was legal in HTML: can you cite something
in the specifications which rules it out in XHTML? I don't see
anything listed in http://www.w3.org/TR/xhtml1/#diffs for example
which would rule-out this usage.


The OP had specifically mentioned XHTML, so those were the syntax
rules I was thinking of. (Actually I wasn't aware this was a
difference from HTML, so I just learned something.) Here's the
citation:

"The ampersand character (&) and the left angle bracket (<) may appear
in their literal form only when used as markup delimiters, or within a
comment, a processing instruction, or a CDATA section. If they are
needed elsewhere, they must be escaped using either numeric character
references or the strings '&amp;' and '&lt;' respectively."

<http://www.w3.org/TR/REC-xml#syntax>

Note that attribute values are not listed as an exception. I wonder
why it wasn't an exception? It causes no ambiguity, at least not for
"<". The authors probably just wanted to minimize the exceptions and
make the recommendation clear and simple.

--
Dean Tiegs, NE¼-20-52-25-W4
“Confortare et esto robustus”
http://telusplanet.net/public/dctiegs/
Jul 20 '05 #10
In article <m2************@hartford-hwp.com>, br****@hartford-hwp.com
says...
ni**@fenris.webthing.com (Nick Kew) writes:
In article <m2************@hartford-hwp.com>, one of infinite
monkeys
at the keyboard of Haines Brown <br****@hartford-hwp.com> wrote:
In XHTML docs, I find that the W3 Validator raises an objection to
my headers without actually invalidating the document.


I don't know what you mean by that. Please post a URL that
demonstrates what you're talking about.


Can't very well, for it was a local document not yet n line, so I copy


If you really can't find any free (and ad-free) webspace then email me a
copy & I'll put it somewhere accessible.

....
Jul 20 '05 #11
On Tue, Jul 22, Dean Tiegs inscribed on the eternal scroll:

[I -ajf- had written, (specifically in regard to the character '<' in
attribute values:]
Well, I'm sure that this was legal in HTML: can you cite something
in the specifications which rules it out in XHTML? I don't see
anything listed in http://www.w3.org/TR/xhtml1/#diffs for example
which would rule-out this usage.
The OP had specifically mentioned XHTML, so those were the syntax
rules I was thinking of. (Actually I wasn't aware this was a
difference from HTML, so I just learned something.)


And so, it seems, did I. How curious that they didn't seem to
point this up as a difference from HTML.
Here's the citation:

"The ampersand character (&) and the left angle bracket (<) may appear
in their literal form only when used as markup delimiters, or within a
comment, a processing instruction, or a CDATA section. If they are
needed elsewhere, they must be escaped using either numeric character
references or the strings '&amp;' and '&lt;' respectively."

<http://www.w3.org/TR/REC-xml#syntax>
So it does, although that's somewhat narrative in nature. But this:

http://www.w3.org/TR/REC-xml#NT-AttValue

appears to clinch the deal, as far as XML is concerned. Does this
restriction carry-over to XHTML, and if so, why isn't it mentioned
here?: http://www.w3.org/TR/xhtml1/#h-4
Note that attribute values are not listed as an exception. I wonder
why it wasn't an exception? It causes no ambiguity, at least not for
"<". The authors probably just wanted to minimize the exceptions and
make the recommendation clear and simple.


Perhaps we could ask the XML group (x-posted).

[please feel free to narrow f'ups to whichever group you see fit.]

Jul 20 '05 #12
ni**@fenris.webthing.com (Nick Kew) writes:
Any good reason you can't demo it with a five-line dummy document?


Nope. I uploaded a truncated document to
www.hartford-hwp.com/archives/test/079.html.

To recall the point, this is a document with a stylistically defined
quotation container <q></q> in the title and the <meta
name="description" content=... lines in the header. This validated OK
in W3, but generated a warning message about the "<" for the latter
line.
--
Haines Brown
br****@hartford-hwp.com
kb****@arrl.net
www.hartford-hwp.com

Jul 20 '05 #13
Haines Brown <br****@hartford-hwp.com> wrote:
ni**@fenris.webthing.com (Nick Kew) writes:
Any good reason you can't demo it with a five-line dummy document?
Nope. I uploaded a truncated document to
www.hartford-hwp.com/archives/test/079.html.


As you can see by looking at your browser's title bar the <q> is
interpreted as just a string of characters and not as the opening tag
of the q element.

Now my French is very rusty but I don't think this is what you want.

<title>How to use the <q> element in a web page</title>
Would be fine and makes sense.

<title>Review: <q>The worst play ever</q></title>
Would not make sense, use " instead.

The same goes for meta tags, except that here you need to use &quot;
or " instead of just " if you have used " to quote the attribute
value as a whole.
To recall the point, this is a document with a stylistically defined
quotation container <q></q> in the title and the <meta
name="description" content=... lines in the header.
As I say above, it is not a "a stylistically defined
quotation container <q></q>".
Iit is just the string of characters <q>.
It is not the <q> element at all.
This validated OK in W3, but generated a warning message
about the "<" for the latter line.


It is valid, but the validator suspects that it might be a mistake on
the author's part.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #14
In reply to the previous message, the I had gathered from the
discussion. Actually, that was more or less what I had been doing, but
inadvertantly copied the quote tag over into a meta tag line and then
was surprised that it validated. Thanks for the added input.

As for Steve's point, indeed the only correct quotation marks in
French are the guillemets, but the majority of documents I process use
the English style of quotations, and I don't correct them. The same
for the space between a word and a following ?, : ; or !. For whatever
reason, whoever types the documents leaves the extra space out.

So while "..." is not proper in a French text, most French documents I
encounter, even when typed by a French speaking person in a
predominantly French speaking country use the English quotation
marks. Indeed, an example is the sample document I put up for this
discussion, which is a Tunisian document, but uses the English
quotation marks.

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

Jul 20 '05 #15
In article <m2************@hartford-hwp.com>, one of infinite monkeys
at the keyboard of Haines Brown <br****@hartford-hwp.com> wrote:
Nope. I uploaded a truncated document to
www.hartford-hwp.com/archives/test/079.html.
Erm, that has one straightforward error which the validators report
perfectly clearly.
name="description" content=... lines in the header. This validated OK
in W3, but generated a warning message about the "<" for the latter
line.


Erm, not unless it's changed since you wrote that.

--
Nick Kew

In urgent need of paying work - see http://www.webthing.com/~nick/cv.html
Jul 20 '05 #16
Dean Tiegs <da*******@telus.net> writes:
Haines Brown <br****@hartford-hwp.com> writes:
The same for the space between a word and a following ?, : ; or
!. For whatever reason, whoever types the documents leaves the extra
space out.


Different French style guides suggest different spacing. The Canadian
government's style guide for French, _Le guide du rédacteur_,
recommends the no-break space before <:> and inside « and », but not
with any other punctuation.


Dean, sorry to pursue an OT question, but since you have access to a
guide, I wonder if it is also true that the choice of quotation mark
type might not also vary among French speaking nations.

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

Jul 20 '05 #17
Haines Brown <br****@hartford-hwp.com> writes:
Dean, sorry to pursue an OT question, but since you have access to a
guide, I wonder if it is also true that the choice of quotation mark
type might not also vary among French speaking nations.
<blockquote lang="fr-CA"
cite="Le guide du rédacteur, 7.1 Types de guillemets"

Quelle que soit la langue des mots que l'on encadre de guillemets, on
emploie en français les guillemets français. Ils consistent en
doubles chevrons ...

Les guillemets anglais (“ ”), les doubles apostrophes (") et les
simples apostrophes (‘ ’) ne sont utilisés en général que pour les
citations * l'intérieur de citations ou pour guillemeter des mots qui
apparaissent * l'intérieur de passages qui sont déj* entre guillemets
....

Des auteurs et des éditeurs confient parfois des fonctions différentes
aux guillemets français et aux guillemets anglais * l'intérieur d'un
même texte. Par exemple, ils réservent les guillemets français pour
les citation proprement dites, et utilisent les guillemets anglais
pour les mots employés dans un sens spécial.
</blockquote>

The unspoken assumption is that these are the Canadian rules.
Unfortunately it does not mention usage in other countries.

--
Dean Tiegs, NE¼-20-52-25-W4
“Confortare et esto robustus”
http://telusplanet.net/public/dctiegs/
Jul 20 '05 #18
Under Subject: Re: Use of tags in header meta statements
Haines Brown <br****@hartford-hwp.com> wrote:
As for Steve's point, indeed the only correct quotation marks in
French are the guillemets, but the majority of documents I process
use the English style of quotations,
I think you mean Ascii quotation marks, which are _not_ correct
quotation marks in _any_ language (excluding programming "languages"
and other "computer languages") - just surrogates we use in place of
whatever quotation marks we should really be using.

The situation looks strange, since the guillemets (unlike correct
English quotation marks) belong to ISO 8859-1 and hence work almost
universally on the Web. But I think a partial explanation is that you
cannot really achieve correct French typography using just HTML and ISO
8859-1.
The same for the space between a word and a following ?, : ; or !.
For whatever reason, whoever types the documents leaves the extra
space out.


This might have several possible explanations. One explanation is that
the space should be _narrow_, and there's no practical way to say that
in HTML. Maybe people think that no space is then better than a normal
space character.

There's no good solution to this yet, but if you are prepared to extra
markup work and if the issue is important (as it might be e.g. in
headings and other prominent texts), you could consider using &nbsp;
together with <span> markup that lets you set word-spacing suitably,
see http://www.cs.tut.fi/~jkorpela/html/french.html

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

Jul 20 '05 #19

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

Similar topics

1
by: Cezary | last post by:
Hello. I was read PHP manual, but i'm not sure yet. Here is my meta tags in html: <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-2"> <META HTTP-EQUIV="Expires"...
24
by: Day Bird Loft | last post by:
Web Authoring | Meta-Tags The first thing to understand in regard to Meta Tags is the three most important tags placed in the head of your html documents. They are the title, description, and...
8
by: Kathleen Dollard | last post by:
Hi, Oleg's answer about attribute value templates led me to look back at a different problem, and wonder if someone else had solved it. I want to output an ASP.NET page. Thus I need to output...
4
by: clintonG | last post by:
Anybody know how to dynamically write the meta tags using code so they are formatted on a separate line in the HTML source? Preferred or optimal framework classes that may be used in this regard? ...
1
by: rolfb | last post by:
I use ASP.net 2.0 C# for my shop-system. I want to programm dynamic meta-tags. In some books I find as memer of HtmlHead statements like Page.Header.Metadata.Add("description", "my product"); ...
4
by: bashetty | last post by:
Well its a strange problem i have, some of you might already faced it and have a solution. I have to maintain a set of unique "search key words" in meta tags for each content page in my site. With...
2
by: thetechturf.com | last post by:
I have some simple dynamic content pages (included below). I need to know how to add specific meta tags (ie. description, keywords, ect.), as well as extra specific header coding to a page. I would...
21
by: karen987 | last post by:
I have a news website, with asp pages. It has publishing software which allows you to add articles in a database, and then calls them up from links etc. I have added dynamic meta tags in 2 parts. The...
4
by: karen987 | last post by:
I want to draw out records from the database, and use them in my meta tags. I only want to use one record, which is called "TITLE", and i want to use this in the "title", "keywords", and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.