Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Using a custom DTD with the HTML Editor
Using a custom DTD with the HTML Editor [message #225217] Fri, 12 December 2008 18:02 Go to next message
Jim Kremens is currently offline Jim Kremens
Messages: 8
Registered: July 2009
Junior Member
Hi all,

I'm trying to extend the HTML Editor to allow some custom tags and
attributes. My understanding of how to best do this has evolved...
The XML editor allows you to point to a custom DTD, but the HTML editor
does not. Instead it seems to refer to a DTD baked into a jar in the
wst.standard.schemas folder. (See Preferences/XML/XMLCatalog to
verify...)
I've looked through the source code and I can't find where this DTD is
picked up. If I can find out how that is accomplished, I can build my
own html editor and be off to the races.
Anyone have any ideas?

Thanks,

Jim Kremens
--
Re: Using a custom DTD with the HTML Editor [message #225221 is a reply to message #225217] Fri, 12 December 2008 18:38 Go to previous messageGo to next message
Jim Kremens is currently offline Jim Kremens
Messages: 8
Registered: July 2009
Junior Member
"If I can find out how that is accomplished, I can build my own html
editor and be off to the races. "
I don't mean that! Rebuilding the whole thing would be a big pain, of
course. What I mean is that I can hopefully extend and reconfigure in
the right places to achieve what I'm looking for. Finding those places is
proving to be difficult!
Thanks....
--
Re: Using a custom DTD with the HTML Editor [message #225224 is a reply to message #225221] Fri, 12 December 2008 20:42 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2235
Registered: July 2009
Senior Member
Jim Kremens wrote:
> "If I can find out how that is accomplished, I can build my own html
> editor and be off to the races. "
> I don't mean that! Rebuilding the whole thing would be a big pain, of
> course. What I mean is that I can hopefully extend and reconfigure in
> the right places to achieve what I'm looking for. Finding those places is
> proving to be difficult!
> Thanks....

I would have thought the previous thread, "Should I use modelHandler
or modelQueryExtensions extension point for enhanced content
assist?" would have led you in the right direction. The model query
extension isn't just used by content assist, after all, it's used by
the property sheet, outline, and even by validation. While adding
valid attributes is made possible with the
ModelQuery.INCLUDE_ATTRIBUTES flag, the
ModelQuery.INCLUDE_CHILD_NODES flag handles adding valid elements.
Otherwise you'll be dealing with replacing
org.eclipse.wst.html.core.internal.modelquery.HTMLModelQuery CMProvider,
and that gets very complicated very quickly.

--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Using a custom DTD with the HTML Editor [message #225239 is a reply to message #225224] Sat, 13 December 2008 10:29 Go to previous messageGo to next message
Eclipse User
Originally posted by: dcarver.starstandard.org

Ideally, the HTML editor should be able to work like the XML Editor if
it doesn't in handling Grammars. The reason for this is that there are
numerous scenarios where Microformats
(http://en.wikipedia.org/wiki/Microformats) are added in with HTML, and
these are backed by grammars.

The HTML editor should still load the grammar specified by the DOCType
and if it is using XHTML, should be able to load XHTML content from
either a DTD or preferably the XML Schema.

If it doesn't do this, an enhancement request should be be made. Since
the HTML editor extends the XML editor, it might just be a matter of
replacing the relative modelQuery handler with the one from XML. But
that might not be that simple.

Dave

Nitin Dahyabhai wrote:
> Jim Kremens wrote:
>> "If I can find out how that is accomplished, I can build my own html
>> editor and be off to the races. "
>> I don't mean that! Rebuilding the whole thing would be a big pain, of
>> course. What I mean is that I can hopefully extend and reconfigure in
>> the right places to achieve what I'm looking for. Finding those
>> places is
>> proving to be difficult!
>> Thanks....
>
> I would have thought the previous thread, "Should I use modelHandler or
> modelQueryExtensions extension point for enhanced content assist?" would
> have led you in the right direction. The model query extension isn't
> just used by content assist, after all, it's used by the property sheet,
> outline, and even by validation. While adding valid attributes is made
> possible with the ModelQuery.INCLUDE_ATTRIBUTES flag, the
> ModelQuery.INCLUDE_CHILD_NODES flag handles adding valid elements.
> Otherwise you'll be dealing with replacing
> org.eclipse.wst.html.core.internal.modelquery.HTMLModelQuery CMProvider,
> and that gets very complicated very quickly.
>
Re: Using a custom DTD with the HTML Editor [message #225257 is a reply to message #225239] Tue, 16 December 2008 01:42 Go to previous message
Eclipse User
Originally posted by: david_williams.linux.vnet.ibm.com

David Carver wrote:
>
> The HTML editor should still load the grammar specified by the DOCType
> and if it is using XHTML, should be able to load XHTML content from
> either a DTD or preferably the XML Schema.
>
The HTML editor does handle other doctypes, beside the "standard" ones
shipped with WTP. I just checked by trying the MathML one from
http://www.w3.org/QA/2002/04/valid-dtd-list.html#DTD and content assist
and validation worked.

I seem to recall, from long ago, some people having problems
creating/using their own Modular XHTML ... but, if I recall correctly,
that was partially due to it being so hard to create valid Modular XHTML!
Previous Topic:Generating WS Client for RCP applications
Next Topic:Howto ignore javascript errors?
Goto Forum:
  


Current Time: Fri Jul 25 14:16:15 EDT 2014

Powered by FUDForum. Page generated in 0.02718 seconds