HighDots Forums  

Use of tags in header meta statements

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss Use of tags in header meta statements in the HTML forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Haines Brown
 
Posts: n/a

Default Use of tags in header meta statements - 07-21-2003 , 10:37 AM






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
brownh (AT) hartford-hwp (DOT) com
kb1grm (AT) arrl (DOT) net
www.hartford-hwp.com


Reply With Quote
  #2  
Old   
Dean Tiegs
 
Posts: n/a

Default Re: Use of tags in header meta statements - 07-21-2003 , 11:18 AM






Haines Brown <brownh (AT) hartford-hwp (DOT) com> writes:

Quote:
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/


Reply With Quote
  #3  
Old   
Nick Kew
 
Posts: n/a

Default Re: Use of tags in header meta statements - 07-21-2003 , 01:45 PM



In article <m2d6g4ndx2.fsf (AT) hartford-hwp (DOT) com>, one of infinite monkeys
at the keyboard of Haines Brown <brownh (AT) hartford-hwp (DOT) com> wrote:
Quote:
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


Reply With Quote
  #4  
Old   
Dean Tiegs
 
Posts: n/a

Default Re: Use of tags in header meta statements - 07-21-2003 , 08:33 PM



Haines Brown <brownh (AT) hartford-hwp (DOT) com> writes:

Quote:
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.

Quote:
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.

Quote:
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.

Quote:
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.

Quote:
Dean Tiegs <dat200304 (AT) telus (DOT) 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/


Reply With Quote
  #5  
Old   
Terje Bless
 
Posts: n/a

Default Re: Use of tags in header meta statements - 07-22-2003 , 01:06 AM



In article <87ispvsybj.fsf (AT) telus (DOT) net>,
Dean Tiegs <dat200304 (AT) telus (DOT) net> wrote:

Quote:
Haines Brown <brownh (AT) hartford-hwp (DOT) 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


Reply With Quote
  #6  
Old   
Haines Brown
 
Posts: n/a

Default Re: Use of tags in header meta statements - 07-22-2003 , 07:21 AM



Dean Tiegs <dat200304 (AT) telus (DOT) net> writes:

Quote:
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.

Quote:
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
brownh (AT) hartford-hwp (DOT) com
kb1grm (AT) arrl (DOT) net
www.hartford-hwp.com



Reply With Quote
  #7  
Old   
Haines Brown
 
Posts: n/a

Default Re: Use of tags in header meta statements - 07-22-2003 , 07:30 AM



nick (AT) fenris (DOT) webthing.com (Nick Kew) writes:

Quote:
In article <m2d6g4ndx2.fsf (AT) hartford-hwp (DOT) com>, one of infinite
monkeys
at the keyboard of Haines Brown <brownh (AT) hartford-hwp (DOT) 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
brownh (AT) hartford-hwp (DOT) com
kb1grm (AT) arrl (DOT) net
www.hartford-hwp.com



Reply With Quote
  #8  
Old   
Nick Kew
 
Posts: n/a

Default Re: Use of tags in header meta statements - 07-22-2003 , 01:19 PM



In article <m28yqqn6i2.fsf (AT) hartford-hwp (DOT) com>, one of infinite monkeys
at the keyboard of Haines Brown <brownh (AT) hartford-hwp (DOT) com> wrote:

Quote:
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


Reply With Quote
  #9  
Old   
Alan J. Flavell
 
Posts: n/a

Default Re: Use of tags in header meta statements - 07-22-2003 , 01:20 PM



On Mon, Jul 21, Dean Tiegs inscribed on the eternal scroll:

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

This is not valid;
Is that really so???

Quote:
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).

Quote:
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.



Reply With Quote
  #10  
Old   
Dean Tiegs
 
Posts: n/a

Default Re: Use of tags in header meta statements - 07-22-2003 , 04:23 PM



"Alan J. Flavell" <flavell (AT) mail (DOT) cern.ch> writes:

Quote:
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/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.