how to extend HTML tags/attributes? [message #217885] |
Mon, 21 July 2008 15:50 |
|
Hi,
Is there a convenient way of extending HTML tags/attributes?
Writing something like:
<div myCustomTag="...">
is not accepted by HTML validator.
Is there a way to "improve" HTML validator?
Thanks!
|
|
|
|
Re: how to extend HTML tags/attributes? [message #217974 is a reply to message #217949] |
Tue, 22 July 2008 14:14 |
Eclipse User |
|
|
|
Originally posted by: nowhere.a.com
Philippe Marschall wrote :
> Michael Spector wrote:
>> Hi,
>>
>> Is there a convenient way of extending HTML tags/attributes?
>>
>> Writing something like:
>>
>> <div myCustomTag="...">
>>
>> is not accepted by HTML validator.
>>
>> Is there a way to "improve" HTML validator?
>>
>> Thanks!
>
>
> IBM did this for a long time. Just write your own DTD. You have the change
> the source code of all the browsers to make it work though. This was done for
> Mozilla.
>
> http://ln.hixie.ch/?start=1089635050&count=1
>
> Cheers
> Philippe
I use custom attributes within HTML tags. Yes the validator complains,
but the browser simply ignores it.
Maybe a project level setting?
div : myCustomTag
etc?
--
Wojtek :-)
|
|
|
|
Re: how to extend HTML tags/attributes? [message #218013 is a reply to message #217982] |
Tue, 22 July 2008 18:40 |
Eclipse User |
|
|
|
Originally posted by: nowhere.a.com
Philippe Marschall wrote :
> Wojtek wrote:
>> Philippe Marschall wrote :
>>> Michael Spector wrote:
>>>> Hi,
>>>>
>>>> Is there a convenient way of extending HTML tags/attributes?
>>>>
>>>> Writing something like:
>>>>
>>>> <div myCustomTag="...">
>>>>
>>>> is not accepted by HTML validator.
>>>>
>>>> Is there a way to "improve" HTML validator?
>>>>
>>>> Thanks!
>>>
>>>
>>> IBM did this for a long time. Just write your own DTD. You have the change
>>> the source code of all the browsers to make it work though. This was done
>>> for Mozilla.
>>>
>>> http://ln.hixie.ch/?start=1089635050&count=1
>>>
>>> Cheers
>>> Philippe
>>
>> I use custom attributes within HTML tags. Yes the validator complains, but
>> the browser simply ignores it.
>>
>> Maybe a project level setting?
>
> No, custom attributes is simply invalid.
For XHTML I agree, but HTML is looser and does "allow" it.
--
Wojtek :-)
|
|
|
Re: how to extend HTML tags/attributes? [message #218020 is a reply to message #218013] |
Tue, 22 July 2008 21:17 |
|
Wojtek wrote:
> For XHTML I agree, but HTML is looser and does "allow" it.
The browsers may allow it, but that doesn't make it valid.
In any case, we do have an _internal_ extension point,
org.eclipse.wst.xml.core.modelQueryExtensions, making use of
subclasses of
org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ex tension.ModelQueryExtension
that could be used to add new definitions for what's valid. This
makes use of a number of _internal_ interfaces, however, and is
unsupported beyond its use in WTP, so you'd be on your own. And be
aware that it's easy to torpedo editor performance by misusing it.
--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Re: how to extend HTML tags/attributes? [message #218025 is a reply to message #218020] |
Tue, 22 July 2008 22:29 |
Eclipse User |
|
|
|
Originally posted by: nowhere.a.com
Nitin Dahyabhai wrote :
> Wojtek wrote:
>> For XHTML I agree, but HTML is looser and does "allow" it.
>
> The browsers may allow it, but that doesn't make it valid.
Which is unfortunate as it can be useful. I use it inside a <span> to
mark text for special processing. Well, two custom attributes.
The user selects some text in a JavaScript text editor (Xinha), then
clicks on a button. The button surrounds the selected text with a
<span> which contains a custom attribute.
On the server side I parse for the span/attributes, then do the
processing on the text. I then save the original and the processed text
into a DB.
When showing the two texts, the text inside the <span> is in a
different CSS class. So the user can see the selected text plus what
the processing did.
Um, somewhat terse, but I have an NDA...
The alternative would be to subvert and mis-use some standard
attributes.
--
Wojtek :-)
|
|
|
|
Re: how to extend HTML tags/attributes? [message #218068 is a reply to message #218032] |
Wed, 23 July 2008 14:47 |
Eclipse User |
|
|
|
Originally posted by: nowhere.a.com
Philippe Marschall wrote :
> Wojtek wrote:
>> Nitin Dahyabhai wrote :
>>> Wojtek wrote:
>>>> For XHTML I agree, but HTML is looser and does "allow" it.
>>>
>>> The browsers may allow it, but that doesn't make it valid.
>>
>> Which is unfortunate as it can be useful. I use it inside a <span> to mark
>> text for special processing. Well, two custom attributes.
>>
>> The user selects some text in a JavaScript text editor (Xinha), then clicks
>> on a button. The button surrounds the selected text with a <span> which
>> contains a custom attribute.
>>
>> On the server side I parse for the span/attributes, then do the processing
>> on the text. I then save the original and the processed text into a DB.
>>
>> When showing the two texts, the text inside the <span> is in a different
>> CSS class. So the user can see the selected text plus what the processing
>> did.
>>
>> Um, somewhat terse, but I have an NDA...
>>
>> The alternative would be to subvert and mis-use some standard attributes.
>>
>
> Why can't you just use a semantic CSS class?
There is more there than just UI. The text between the <span> and
</span> is replaced.
--
Wojtek :-)
|
|
|
Powered by
FUDForum. Page generated in 0.03999 seconds