Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 04:16 PM
Haines Brown
Guest
 
Posts: n/a
Default 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
brownh@hartford-hwp.com
kb1grm@arrl.net
www.hartford-hwp.com

  #2  
Old July 20th, 2005, 04:16 PM
Dean Tiegs
Guest
 
Posts: n/a
Default Re: Use of tags in header meta statements

Haines Brown <brownh@hartford-hwp.com> writes:
[color=blue]
> 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."[/color]

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/
  #3  
Old July 20th, 2005, 04:16 PM
Nick Kew
Guest
 
Posts: n/a
Default Re: Use of tags in header meta statements

In article <m2d6g4ndx2.fsf@hartford-hwp.com>, one of infinite monkeys
at the keyboard of Haines Brown <brownh@hartford-hwp.com> wrote:[color=blue]
> In XHTML docs, I find that the W3 Validator raises an objection to my
> headers without actually invalidating the document.[/color]

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
  #4  
Old July 20th, 2005, 04:17 PM
Dean Tiegs
Guest
 
Posts: n/a
Default Re: Use of tags in header meta statements

Haines Brown <brownh@hartford-hwp.com> writes:
[color=blue]
> 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>[/color]

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.
[color=blue]
> My inclination instead would be to use:
>
> <meta name="description" content="foo 'bar' baz">
>
> Would there be any difference?[/color]

Not really, just follow your personal (or national) preference for
when to use single or double quotation marks.
[color=blue]
> 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">[/color]

Yes, both are OK.
[color=blue]
> when is XHTML 2 going to be usable?[/color]

Don't hold your breath. XHTML 1 is not really usable yet because the
most popular browser doesn't support it.
[color=blue]
> Dean Tiegs <dat200304@telus.net> writes:
>[color=green]
>> This is also one of the reasons <object>...</object> is superior to
>> <img alt="..."/>.[/color]
>
> Very interesting. Are you actually recommending this at present?[/color]

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/
  #5  
Old July 20th, 2005, 04:17 PM
Terje Bless
Guest
 
Posts: n/a
Default Re: Use of tags in header meta statements

In article <87ispvsybj.fsf@telus.net>,
Dean Tiegs <dat200304@telus.net> wrote:
[color=blue]
>Haines Brown <brownh@hartford-hwp.com> writes:
>[color=green]
>> 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."[/color]
>
>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.[/color]

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
  #6  
Old July 20th, 2005, 04:17 PM
Haines Brown
Guest
 
Posts: n/a
Default Re: Use of tags in header meta statements

Dean Tiegs <dat200304@telus.net> writes:
[color=blue]
> 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.[/color]

Thanks you seem to have answered all my questions. I suspected the
situation was as you say, but was not sure.
[color=blue][color=green]
> > when is XHTML 2 going to be usable?[/color]
>
> Don't hold your breath. XHTML 1 is not really usable yet because
> the most popular browser doesn't support it.[/color]

--
Haines Brown
brownh@hartford-hwp.com
kb1grm@arrl.net
www.hartford-hwp.com

  #7  
Old July 20th, 2005, 04:17 PM
Haines Brown
Guest
 
Posts: n/a
Default Re: Use of tags in header meta statements

nick@fenris.webthing.com (Nick Kew) writes:
[color=blue]
> In article <m2d6g4ndx2.fsf@hartford-hwp.com>, one of infinite
> monkeys
> at the keyboard of Haines Brown <brownh@hartford-hwp.com> wrote:[color=green]
> > In XHTML docs, I find that the W3 Validator raises an objection to
> > my headers without actually invalidating the document.[/color]
>
> I don't know what you mean by that. Please post a URL that
> demonstrates what you're talking about.[/color]

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@hartford-hwp.com
kb1grm@arrl.net
www.hartford-hwp.com

  #8  
Old July 20th, 2005, 04:17 PM
Alan J. Flavell
Guest
 
Posts: n/a
Default Re: Use of tags in header meta statements

On Mon, Jul 21, Dean Tiegs inscribed on the eternal scroll:
[color=blue]
> <meta name="description" content="foo <q>bar</q> baz"/>.
>
> This is not valid;[/color]

Is that really so???
[color=blue]
> you cannot have elements in an attribute value.[/color]

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).
[color=blue]
> In addition, the less-than sign is not allowed literally in an
> attribute value at all;[/color]

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.

  #9  
Old July 20th, 2005, 04:17 PM
Nick Kew
Guest
 
Posts: n/a
Default Re: Use of tags in header meta statements

In article <m28yqqn6i2.fsf@hartford-hwp.com>, one of infinite monkeys
at the keyboard of Haines Brown <brownh@hartford-hwp.com> wrote:
[color=blue][color=green]
>> I don't know what you mean by that. Please post a URL that
>> demonstrates what you're talking about.[/color]
>
> Can't very well, for it was a local document not yet n line,[/color]

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
  #10  
Old July 20th, 2005, 04:17 PM
Dean Tiegs
Guest
 
Posts: n/a
Default Re: Use of tags in header meta statements

"Alan J. Flavell" <flavell@mail.cern.ch> writes:
[color=blue]
> 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.[/color]

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/
  #11  
Old July 20th, 2005, 04:17 PM
Jacqui or (maybe) Pete
Guest
 
Posts: n/a
Default Re: Use of tags in header meta statements

In article <m28yqqn6i2.fsf@hartford-hwp.com>, brownh@hartford-hwp.com
says...[color=blue]
> nick@fenris.webthing.com (Nick Kew) writes:
>[color=green]
> > In article <m2d6g4ndx2.fsf@hartford-hwp.com>, one of infinite
> > monkeys
> > at the keyboard of Haines Brown <brownh@hartford-hwp.com> wrote:[color=darkred]
> > > In XHTML docs, I find that the W3 Validator raises an objection to
> > > my headers without actually invalidating the document.[/color]
> >
> > I don't know what you mean by that. Please post a URL that
> > demonstrates what you're talking about.[/color]
>
> Can't very well, for it was a local document not yet n line, so I copy[/color]

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

....
  #12  
Old July 20th, 2005, 04:17 PM
Alan J. Flavell
Guest
 
Posts: n/a
Default Re: Use of tags in header meta statements

On Tue, Jul 22, Dean Tiegs inscribed on the eternal scroll:

[I -ajf- had written, (specifically in regard to the character '<' in
attribute values:]
[color=blue][color=green]
> > 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.[/color]
>
> 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.)[/color]

And so, it seems, did I. How curious that they didn't seem to
point this up as a difference from HTML.
[color=blue]
> 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>[/color]

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
[color=blue]
> 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.[/color]

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

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

  #13  
Old July 20th, 2005, 04:18 PM
Haines Brown
Guest
 
Posts: n/a
Default Re: Use of tags in header meta statements

nick@fenris.webthing.com (Nick Kew) writes:
[color=blue]
> Any good reason you can't demo it with a five-line dummy document?[/color]

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
brownh@hartford-hwp.com
kb1grm@arrl.net
www.hartford-hwp.com

  #14  
Old July 20th, 2005, 04:18 PM
Steve Pugh
Guest
 
Posts: n/a
Default Re: Use of tags in header meta statements

Haines Brown <brownh@hartford-hwp.com> wrote:
[color=blue]
>nick@fenris.webthing.com (Nick Kew) writes:
>[color=green]
>> Any good reason you can't demo it with a five-line dummy document?[/color]
>
>Nope. I uploaded a truncated document to
>www.hartford-hwp.com/archives/test/079.html.
>[/color]

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.
[color=blue]
>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.[/color]

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.
[color=blue]
>This validated OK in W3, but generated a warning message
>about the "<" for the latter line.[/color]

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 <steve@pugh.net> <http://steve.pugh.net/>
  #15  
Old July 20th, 2005, 04:18 PM
Haines Brown
Guest
 
Posts: n/a
Default Re: Use of tags in header meta statements

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
brownh@hartford-hwp.com
kb1grm@arrl.net
www.hartford-hwp.com

  #16  
Old July 20th, 2005, 04:18 PM
Nick Kew
Guest
 
Posts: n/a
Default Re: Use of tags in header meta statements

In article <m2lluplbru.fsf@hartford-hwp.com>, one of infinite monkeys
at the keyboard of Haines Brown <brownh@hartford-hwp.com> wrote:
[color=blue]
> Nope. I uploaded a truncated document to
> www.hartford-hwp.com/archives/test/079.html.[/color]

Erm, that has one straightforward error which the validators report
perfectly clearly.
[color=blue]
> name="description" content=... lines in the header. This validated OK
> in W3, but generated a warning message about the "<" for the latter
> line.[/color]

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
  #17  
Old July 20th, 2005, 04:19 PM
Haines Brown
Guest
 
Posts: n/a
Default Re: Use of tags in header meta statements

Dean Tiegs <dat200304@telus.net> writes:
[color=blue]
> Haines Brown <brownh@hartford-hwp.com> writes:
>[color=green]
> > The same for the space between a word and a following ?, : ; or
> > !. For whatever reason, whoever types the documents leaves the extra
> > space out.[/color]
>
> 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.[/color]

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
brownh@hartford-hwp.com
kb1grm@arrl.net
www.hartford-hwp.com

  #18  
Old July 20th, 2005, 04:19 PM
Dean Tiegs
Guest
 
Posts: n/a
Default Re: Use of tags in header meta statements

Haines Brown <brownh@hartford-hwp.com> writes:
[color=blue]
> 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.[/color]

<blockquote lang="fr-CA"
cite="Le guide du rédacteur, 7.1 Types de guillemets"[color=blue]
>[/color]
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/
  #19  
Old July 20th, 2005, 04:19 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Guillemets and French punctuation in general

Under Subject: Re: Use of tags in header meta statements
Haines Brown <brownh@hartford-hwp.com> wrote:
[color=blue]
> 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,[/color]

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.
[color=blue]
> The same for the space between a word and a following ?, : ; or !.
> For whatever reason, whoever types the documents leaves the extra
> space out.[/color]

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

 

Bookmarks

Thread Tools

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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles