Re: [WSG] Valid characters in class names

2006-10-21 Thread Charles Roper

On 21/10/06, Lachlan Hunt [EMAIL PROTECTED] wrote:

 OK, I should rephrase that to If it were a URL then that would be
 more practical for an href surely?

You're only saying that because most implementations don't support LSID
URIs yet, but you already showed me a working implementation of it that
does make it practical for those users.


You are right, I'll concede that putting an LSID into a link would
have its benefits in certain contexts. If you look at some of the
broad and varied uses of species names [1], placing LSIDs in links *by
default every time*, would only serve to confuse and irritate users.

[1] http://microformats.org/wiki/species-examples


 However, providing a *direct* link to the resource described by the
 LSID isn't the intended aim of the microformat; the LSID is in there
 as metadata that describe a resource, while the normal hyperlink, if
 there is one, probably points to something else entirely.

 What's wrong with providing 2 links?  One to the LSID, another to the
 related information.

 How might that work, given that you probably don't want the user to
 see the LSID?

Why wouldn't you want the user to see it?  What benefit does it provide
if a user can't do anything with it?


Just because the LSID isn't in a link or can't see it, doesn't mean
there's no benefit to the user. hCards are mostly useless to a user
unless they install special add-ins for Firefox, or use bookmarklets
or webservices etc. On their own, microformats don't do much. The
benefit comes when a computer is able to accurately parse the
information and act on it somehow. The user doesn't need to be able to
act on it directly.


That LSID implementation you showed me earlier seems like quite a good
reason to show it.  The fact that it's not a widely deployed extension,
nor a widely supported URI scheme, is a rather minor point if you think
about how fast such implementations can spread.  If you give users a
reason to add support to their browser and given that there is already
at least 3 separate LSID implementations, it probably will.


Yes, that's a good point; there's no reason why LSIDs shouldn't be
used in links. That's kind of a seperate issue. I'm thinking of
practical ways of implementing them within a microformat.


Just consider how fast the feed:, skype:, callto: and other URI schemes
have spread and became relatively widely supported in feed readers and
IM clients.  My point is lack of widely deployed implementations now is
not a reason to avoid using it in the future.


Agreed.


What wrong with something like this structure?

span class==taxon
 a href=/lutra_lutra/View information about span
class=speciesOtters/span/a
 (a href=lsidres:... class=lsidLSID/a)
/span


What's wrong with it? Nothing, as such. But what if you don't want the
second link? It's not practical or desirable to have a second link
after every occurrence of a species name. It would be akin to
requiring an ISBN link after every mention of a book, or an email
address after every mention of a person.

I've got nothing against including LSIDs in links, which I agree is
where they semantically belong, but they also need to be attached to
non-link elements too. That's the problem that the microformat is
trying to address.

An alternative implementation using the abbr design pattern has also
been suggested. What to folk here think of this? Here's what the abbr
design pattern is:

http://microformats.org/wiki/abbr-design-pattern

The datetime design pattern is also pertinent:

http://microformats.org/wiki/datetime-design-pattern

Here's how it might work:

 span class=taxon
   abbr class=lsid title=urn:lsid:ubio.org:classificationbank:1092045
 Deuterostomia
   /abbr
 /span

Semantically, it's not dissimilar to the use of abbr with dates as
described on the abbr and datetime design pattern pages.

Feedback on this most welcome.

Charles


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Valid characters in class names

2006-10-20 Thread David Dorward
On Fri, Oct 20, 2006 at 12:41:02PM +0100, Charles Roper wrote:
 Can anyone point me to a reference (or simply post here) of characters
 that are valid to use in HTML class attribute values. I've searched
 and searched but can't find a definitive list.

It's a CDATA list, you can use any character (although you can't
depend on whitespace not being mucked about with).

-- 
David Dorward  http://dorward.me.uk



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Valid characters in class names

2006-10-20 Thread Nick Fitzsimons

On 20 Oct 2006, at 12:41:02, Charles Roper wrote:


Hi,

Can anyone point me to a reference (or simply post here) of characters
that are valid to use in HTML class attribute values. I've searched
and searched but can't find a definitive list.



When in doubt, read the spec ;-)

HTML 4.01 defines the class attributes a being of type cdata-list:
http://www.w3.org/TR/html4/struct/global.html#adef-class

A cdata-list is a whitespace-separated collection of values  
containing CDATA:

http://www.w3.org/TR/html4/types.html#type-cdata
which is a sequence of characters from the document character set  
(which means anything you like if you're using UTF-8).


Note that the id attribute is defined as being of type name, which  
has further restrictions applied to it, including being required to  
begin with a letter (A-Z a-z), but the spec doesn't, in my  
interpretation of it, impose the same constraint on classes.  
Therefore 12345 would be a valid class name, but not a valid id.


Oh, and both class and id are case sensitive, so fred and Fred  
are different.


HTH,

Nick.
--
Nick Fitzsimons
http://www.nickfitz.co.uk/





***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Valid characters in class names

2006-10-20 Thread Anders Nawroth

Charles Roper skrev:

Can anyone point me to a reference (or simply post here) of characters
that are valid to use in HTML class attribute values.


Be aware that there are different rules for class names in CSS vs. HTML!

http://www.w3.org/TR/CSS21/syndata.html#q6


In CSS 2.1, identifiers  (including element names, classes, and IDs in 
selectors) can contain only the characters [A-Za-z0-9] and ISO 10646 characters 
U+00A1 and higher, plus the hyphen (-) and the underscore (_); they cannot 
start with a digit, or a hyphen followed by a digit.



/anders


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Valid characters in class names

2006-10-20 Thread Nick Fitzsimons

On 20 Oct 2006, at 13:42:51, Anders Nawroth wrote:


Charles Roper skrev:
Can anyone point me to a reference (or simply post here) of  
characters

that are valid to use in HTML class attribute values.


Be aware that there are different rules for class names in CSS vs.  
HTML!


http://www.w3.org/TR/CSS21/syndata.html#q6

In CSS 2.1, identifiers  (including element names, classes, and  
IDs in selectors) can contain only the characters [A-Za-z0-9] and  
ISO 10646 characters U+00A1 and higher, plus the hyphen (-) and  
the underscore (_); they cannot start with a digit, or a hyphen  
followed by a digit.




Good point, Anders; Charles, please note this as a correction to the  
relevant part of my own response to your original question.


I knew I should have double-checked with the CSS spec :-(

Nick.
--
Nick Fitzsimons
http://www.nickfitz.co.uk/





***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Valid characters in class names

2006-10-20 Thread Charles Roper

Thanks all - what a great response. I did end up reading the CSS 2.1
spec but as has been pointed out, a CSS selector does not necessarily
equal an HTML class name. Here's a bit of background: I need to
include the following in a class name (for use in a microformat):

class=urn:lsid:ubio.org:namebank:530114


From what I gleaned from the CSS spec, I escaped it to this:


class=urn\:lsid\:ubio\.org\:namebank\:530114

Is that now valid (in terms of CSS) as far as anyone can see? Would
the original unescaped version be a valid class name, even though it's
not a valid CSS selector?

Cheers,

Charles


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Valid characters in class names

2006-10-20 Thread David Dorward
On Fri, Oct 20, 2006 at 04:45:49PM +0100, Charles Roper wrote:
 From what I gleaned from the CSS spec, I escaped it to this:
 
 class=urn\:lsid\:ubio\.org\:namebank\:530114

 Is that now valid (in terms of CSS) as far as anyone can see?

You need to escape the characters in the _CSS_, not in the HTML.

(Just like you represent  as amp; in a URL in an HTML document,
but not in a URL in the address bar of your browser.)

-- 
David Dorward  http://dorward.me.uk



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Valid characters in class names

2006-10-20 Thread Lachlan Hunt

Charles Roper wrote:

I need to include the following in a class name (for use in a microformat):

class=urn:lsid:ubio.org:namebank:530114


Which microformat?  That's a URI and so a more semantic place for it is 
in a href=urn:... or maybe link href=urn:.



From what I gleaned from the CSS spec, I escaped it to this:


class=urn\:lsid\:ubio\.org\:namebank\:530114


No, you do not use selector syntax in HTML attributes.  You use selector 
syntax in selectors.


To select a class attribute containing colons, you would using the first 
example above without the back slashes and then in your CSS, you would 
write this:


.urn\:lsid\:ubio\.org\:namebank\:530114 { color: green }

For it to work in IE6 (not sure about IE7), you need to use \3A  
(including the space) instead of \:


.urn\3A lsid\3A ubio\.org\3A namebank\3A 530114 { color: green; }

If you put in an href attribute where it belongs, you would use this 
instead:


[href=urn\:lsid\:ubio\.org\:namebank\:530114] { color: green; }

(This won't work in IE at all, even if you use \3A)

See this test case:
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0A%3Cstyle%3E%0A.urn%5C%3Alsid%5C%3Aubio%5C.org%5C%3Anamebank%5C%3A530114%20%7B%20color%3A%20green%3B%20%7D%0A%5Bhref%3D%22urn%5C%3Alsid%5C%3Aubio%5C.org%5C%3Anamebank%5C%3A530114%22%5D%20%7B%20color%3A%20green%3B%20%7D%0A%3C/style%3E%0A%3Cp%20class%3D%22urn%3Alsid%3Aubio.org%3Anamebank%3A530114%22%3EThis%20line%20should%20be%20green%3C/p%3E%0A%3Cp%3E%3Ca%20href%3D%22urn%3Alsid%3Aubio.org%3Anamebank%3A530114%22%3EThis%20link%20should%20be%20green%3C/a%3E%3C/p%3E

--
Lachlan Hunt
http://lachy.id.au/


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Valid characters in class names

2006-10-20 Thread Charles Roper

On 20/10/06, Lachlan Hunt [EMAIL PROTECTED] wrote:

Charles Roper wrote:
 I need to include the following in a class name (for use in a microformat):

 class=urn:lsid:ubio.org:namebank:530114

Which microformat?  That's a URI and so a more semantic place for it is
in a href=urn:... or maybe link href=urn:.


It's actually a URN, a subset of URI which does not imply availability
of the identified resource. Doesn't this make it inappropriate for an
href in the context of a web page? I completely see where you're
coming from, though. If it were a URL then that would be more
appropriate for an href surely? See here for more info on this
distinction:

http://snipurl.com/zyca

Getting more specific, it's actually an LSID for a microformat that is
still in development. More on LSIDs here:

http://lsid.sourceforge.net/#whatislsid

Having said all this, LSIDs can be made to behave like URLs via a Firefox addin:

http://lsid.biopathways.org/lsid_browser/lsid_browser_1_0_0.html

So perhaps sticking the LSID in the href might be useful after all.
However, providing a *direct* link to the resource described by the
LSID isn't the intended aim of the microformat; the LSID is in there
as metadata that describe a resource, while the normal hyperlink, if
there is one, probably points to something else entirely.


 From what I gleaned from the CSS spec, I escaped it to this:

 class=urn\:lsid\:ubio\.org\:namebank\:530114

No, you do not use selector syntax in HTML attributes.  You use selector
syntax in selectors.


OK, so urn:lsid:ubio.org:namebank:530114 would actually be a valid
class name then? The LSID would almost certainly never be used as a
CSS selector (should never rule the possibility out, though), so if
it's valid in its unescaped form then that's great news.


To select a class attribute containing colons, you would using the first
example above without the back slashes and then in your CSS, you would
write this:

.urn\:lsid\:ubio\.org\:namebank\:530114 { color: green }

For it to work in IE6 (not sure about IE7), you need to use \3A 
(including the space) instead of \:

.urn\3A lsid\3A ubio\.org\3A namebank\3A 530114 { color: green; }

If you put in an href attribute where it belongs, you would use this
instead:

[href=urn\:lsid\:ubio\.org\:namebank\:530114] { color: green; }

(This won't work in IE at all, even if you use \3A)

See this test case:
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0A%3Cstyle%3E%0A.urn%5C%3Alsid%5C%3Aubio%5C.org%5C%3Anamebank%5C%3A530114%20%7B%20color%3A%20green%3B%20%7D%0A%5Bhref%3D%22urn%5C%3Alsid%5C%3Aubio%5C.org%5C%3Anamebank%5C%3A530114%22%5D%20%7B%20color%3A%20green%3B%20%7D%0A%3C/style%3E%0A%3Cp%20class%3D%22urn%3Alsid%3Aubio.org%3Anamebank%3A530114%22%3EThis%20line%20should%20be%20green%3C/p%3E%0A%3Cp%3E%3Ca%20href%3D%22urn%3Alsid%3Aubio.org%3Anamebank%3A530114%22%3EThis%20link%20should%20be%20green%3C/a%3E%3C/p%3E



That's all really useful to know, many thanks!

Charles


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Valid characters in class names

2006-10-20 Thread Nick Fitzsimons

On 20 Oct 2006, at 15:26:10, Lachlan Hunt wrote:


Nick Fitzsimons wrote:

On 20 Oct 2006, at 13:42:51, Anders Nawroth wrote:
Be aware that there are different rules for class names in CSS  
vs. HTML!


http://www.w3.org/TR/CSS21/syndata.html#q6
Good point, Anders; Charles, please note this as a correction to  
the relevant part of my own response to your original question.

I knew I should have double-checked with the CSS spec :-(


No, you were (almost) right the first time, without checking the  
CSS spec.  Even though a class selector may have limitations with  
which characters it can use directly, escape sequences allow the  
use of absolutely any character at all.  So, if you have a need to  
use such characters, then you can do so with too much difficulty.




Yes, but the linked part of the CSS 2.1 spec states of identifiers  
used in CSS, including class names used in class selectors, that  
they cannot start with a digit, or a hyphen followed by a digit.


So when I originally stated that 12345  is a valid value for the  
class attribute (or words to that effect) I was correct in terms of  
HTML 4.01, but such a class could not then be the subject of a class  
selector in CSS.


I think... :-)

Cheers,

Nick.
--
Nick Fitzsimons
http://www.nickfitz.co.uk/





***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Valid characters in class names

2006-10-20 Thread Nick Fitzsimons

On 20 Oct 2006, at 18:34:44, Charles Roper wrote:



OK, so urn:lsid:ubio.org:namebank:530114 would actually be a valid
class name then? The LSID would almost certainly never be used as a
CSS selector (should never rule the possibility out, though), so if
it's valid in its unescaped form then that's great news.



Yes, by any reading of the spec it's a valid value of the HTML class  
attribute.


We tend to associate class so closely with its use in CSS class  
selectors that we forget that it's also, or even primarily, for  
general-purpose processing by user agents. Your use as part of a  
microformat fits in perfectly with that. Those that want to target it  
with CSS will have to be aware of the additional handling they need  
to do to work with it according to spec; but that's Somebody Else's  
Problem :-)


Cheers,

Nick.
--
Nick Fitzsimons
http://www.nickfitz.co.uk/





***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Valid characters in class names

2006-10-20 Thread Lachlan Hunt

Charles Roper wrote:

On 20/10/06, Lachlan Hunt [EMAIL PROTECTED] wrote:

Charles Roper wrote:

I need to include the following in a class name (for use in a

microformat):


class=urn:lsid:ubio.org:namebank:530114


Which microformat?  That's a URI and so a more semantic place for
it is in a href=urn:... or maybe link href=urn:.


It's actually a URN, a subset of URI which does not imply 
availability of the identified resource.


Yes, I know that.


Doesn't this make it inappropriate for an href in the context of a
web page?


No.  The attributes: href, cite, data, src, longdesc, etc. are defined 
to contain URIs, not just URLs.  It is not unprecedented to use a URN in 
such an attribute.


e.g. blockquote cite=urn:isbn:0-534-37131-0

It would even make sense to use that same URI in
  a href=urn:isbn:0-534-37131-0Standard C++ with Object-Oriented 
Programming/a


Unfortunately, the practical problem is that browsers generally don't do 
anything useful with them, though there is nothing to prevent a browser 
from loading the user's preferred online book store (e.g. Amazon.com, 
Barnes and Noble, etc.) with more information about the book.  Google 
did a similar thing with it's AutoLink feature, which recognises plain 
text ISBNs in the source and links them to Amazon.



I completely see where you're coming from, though. If it
were a URL then that would be more appropriate for an href surely?


Where does it say in the spec that an href attribute has to point to to 
a network-retrievable resource?  It explicitly allows URIs, including 
both URLs and URNs.



Getting more specific, it's actually an LSID for a microformat that
is still in development. More on LSIDs here:

http://lsid.sourceforge.net/#whatislsid


For future reference, when talking about a microformat, it's useful if 
you actually link to something about that microformat, so it's easier to 
find what you're talking about.  I assume it's the species format that I 
found, since it mentions LSIDs in this page.


http://microformats.org/wiki/species-brainstorming

Having said all this, LSIDs can be made to behave like URLs via a 
Firefox addin:


http://lsid.biopathways.org/lsid_browser/lsid_browser_1_0_0.html

So perhaps sticking the LSID in the href might be useful after all.


An existing implementation is one of the strongest argument for doing 
that way.


You also need to consider that it is much easier for an external 3rd 
party plugin to do something with a URI when it's activated (by 
registering the URI scheme with the system) than it is to do something 
with the class attribute.


There's even a way being developed for scripts in web pages to register 
protocol handlers.


http://www.whatwg.org/specs/web-apps/current-work/#custom-handlers

Say, for example, you visit a site that provides some service related to 
species, the site could register to handle urn:lsid: URIs, such that 
when the user clicks an LSID link, they're taken to that website for 
whatever it is they want to do.  Amazon.com and other book stores could 
do exactly the same thing with urn:isbn: URIs.


Keep in mind that the class attribute is *hidden* metadata, which is 
somewhat against the philosophy of microformats.  At least with a link, 
it's much more visible and easier for the user to access (without 
viewing source) and then do something with it.


However, providing a *direct* link to the resource described by the 
LSID isn't the intended aim of the microformat; the LSID is in there 
as metadata that describe a resource, while the normal hyperlink, if 
there is one, probably points to something else entirely.


What's wrong with providing 2 links?  One to the LSID, another to the 
related information.


--
Lachlan Hunt
http://lachy.id.au/


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***