Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » how to extend HTML tags/attributes?
how to extend HTML tags/attributes? [message #217885] Mon, 21 July 2008 15:50 Go to next message
Michael Spector is currently offline Michael SpectorFriend
Messages: 110
Registered: July 2009
Senior Member

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 #217949 is a reply to message #217885] Tue, 22 July 2008 09:09 Go to previous messageGo to next message
Philippe Marschall is currently offline Philippe MarschallFriend
Messages: 121
Registered: July 2009
Senior Member
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
Re: how to extend HTML tags/attributes? [message #217974 is a reply to message #217949] Tue, 22 July 2008 14:14 Go to previous messageGo to next message
Eclipse UserFriend
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 #217982 is a reply to message #217974] Tue, 22 July 2008 14:26 Go to previous messageGo to next message
Philippe Marschall is currently offline Philippe MarschallFriend
Messages: 121
Registered: July 2009
Senior Member
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.

Cheers
Philippe
Re: how to extend HTML tags/attributes? [message #218013 is a reply to message #217982] Tue, 22 July 2008 18:40 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

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 Go to previous messageGo to next message
Eclipse UserFriend
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 #218032 is a reply to message #218025] Wed, 23 July 2008 06:56 Go to previous messageGo to next message
Philippe Marschall is currently offline Philippe MarschallFriend
Messages: 121
Registered: July 2009
Senior Member
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?

Cheers
Philippe
Re: how to extend HTML tags/attributes? [message #218068 is a reply to message #218032] Wed, 23 July 2008 14:47 Go to previous message
Eclipse UserFriend
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 :-)
Previous Topic:Seems too difficult to remove jars from web project library set?
Next Topic:Buggy 'New Web Project' dialogue
Goto Forum:
  


Current Time: Thu Apr 25 07:25:28 GMT 2024

Powered by FUDForum. Page generated in 0.03246 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top