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]
*******************************************************************