Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Style adaptor for XML Documents
Style adaptor for XML Documents [message #184304] Sun, 10 December 2006 16:02 Go to next message
Eclipse User
Originally posted by: eric.services.ideoform.org

Is there any support for the xml-stylesheet processing instruction in
WTP, specifically as a style adapter? I've found a couple of adapters
related to style for HTML documents, but none for XML. If I need to add
one, is there an extension point I would use? Can someone point me to
some the right aspect of the HTML CSS support as an example?

Thanks.
Re: Style adaptor for XML Documents [message #184445 is a reply to message #184304] Mon, 11 December 2006 23:03 Go to previous messageGo to next message
Eclipse User
Originally posted by: eric.services.ideoform.org

It looks like there is a lot of code in the htmlcss package that could
be factored out to be shared for html & xml. Does anyone else agree? I'm
talking about the LinkElementAdapter, the HTMLStyleSelectorAdapter, etc.

Eric Woodruff wrote:
> Is there any support for the xml-stylesheet processing instruction in
> WTP, specifically as a style adapter? I've found a couple of adapters
> related to style for HTML documents, but none for XML. If I need to add
> one, is there an extension point I would use? Can someone point me to
> some the right aspect of the HTML CSS support as an example?
>
> Thanks.
Re: Style adaptor for XML Documents [message #184506 is a reply to message #184445] Tue, 12 December 2006 12:32 Go to previous messageGo to next message
Craig Salter is currently offline Craig Salter
Messages: 169
Registered: July 2009
Senior Member
Hi Eric,

Maybe you can educate us a litle on how you'd like to use these classes
and how you envision the end user working? Typically when we're dealing
with XML stylesheet we're using them in conjuction with XSL and simply add
a <?xml-stylesheet type="text/xsl" href=""?> tag to the top of the XML
file. BTW, the xml source editor will content assist you for that magic
tag which is very handy.

Eric Woodruff wrote:

> It looks like there is a lot of code in the htmlcss package that could
> be factored out to be shared for html & xml. Does anyone else agree? I'm
> talking about the LinkElementAdapter, the HTMLStyleSelectorAdapter, etc.

> Eric Woodruff wrote:
>> Is there any support for the xml-stylesheet processing instruction in
>> WTP, specifically as a style adapter? I've found a couple of adapters
>> related to style for HTML documents, but none for XML. If I need to add
>> one, is there an extension point I would use? Can someone point me to
>> some the right aspect of the HTML CSS support as an example?
>>
>> Thanks.
Re: Style adaptor for XML Documents [message #184514 is a reply to message #184506] Tue, 12 December 2006 13:37 Go to previous messageGo to next message
Eclipse User
Originally posted by: eric.services.ideoform.org

Hi Craig,

I'm developing an Eclipse DocBook editor using WTP and GEF and would
like to style sheets like CSS to control the look of the editor. WTP is
a great project and it gives me a huge head start, there are a lot of
nice things to take advantage of. The major driving goal of my project
is to add team support (CVS/SVN, etc) and support rendered, XML source
and structured comparison of DocBook documents. (But there are other
Eclipse-isms to support as well like refactoring, project natures,
Snippets, etc).

(By the way, what are the guidelines for things marked 'internal' or
'provisional'? There is a lot of useful code to build off of in WST, but
it gives the impression that I shouldn't be depending on it.)

craig wrote:
> Hi Eric,
>
> Maybe you can educate us a litle on how you'd like to use these classes
> and how you envision the end user working? Typically when we're dealing
> with XML stylesheet we're using them in conjuction with XSL and simply
> add a <?xml-stylesheet type="text/xsl" href=""?> tag to the top of the
> XML file. BTW, the xml source editor will content assist you for that
> magic tag which is very handy.
>
> Eric Woodruff wrote:
>
>> It looks like there is a lot of code in the htmlcss package that could
>> be factored out to be shared for html & xml. Does anyone else agree? I'm
>> talking about the LinkElementAdapter, the HTMLStyleSelectorAdapter, etc.
>
>> Eric Woodruff wrote:
>>> Is there any support for the xml-stylesheet processing instruction in
>>> WTP, specifically as a style adapter? I've found a couple of adapters
>>> related to style for HTML documents, but none for XML. If I need to add
>>> one, is there an extension point I would use? Can someone point me to
>>> some the right aspect of the HTML CSS support as an example?
>>>
>>> Thanks.
>
Re: Style adaptor for XML Documents [message #184639 is a reply to message #184514] Wed, 13 December 2006 21:48 Go to previous messageGo to next message
Craig Salter is currently offline Craig Salter
Messages: 169
Registered: July 2009
Senior Member
I see, so you want to provide a GUI to configure your XSL that will
simulate the way CSS applies HTML ... is that correct? If so I don't
think we designed the CSS stuff to be reusable... so you're welcome to
describe how you like us to refactor things and we can consider. In
general WTP has been pretty conservative about defining API. Mainly this
because we have a limited amount of developer resource working on this.
Getting feedback from the community about what they want to use is very
useful so please open an enhancement request with your suggestions. If
you'd like to help us define API and write Javadoc we'd be happy to accept
contributions!

Eric Woodruff wrote:

> Hi Craig,

> I'm developing an Eclipse DocBook editor using WTP and GEF and would
> like to style sheets like CSS to control the look of the editor. WTP is
> a great project and it gives me a huge head start, there are a lot of
> nice things to take advantage of. The major driving goal of my project
> is to add team support (CVS/SVN, etc) and support rendered, XML source
> and structured comparison of DocBook documents. (But there are other
> Eclipse-isms to support as well like refactoring, project natures,
> Snippets, etc).

> (By the way, what are the guidelines for things marked 'internal' or
> 'provisional'? There is a lot of useful code to build off of in WST, but
> it gives the impression that I shouldn't be depending on it.)

> craig wrote:
>> Hi Eric,
>>
>> Maybe you can educate us a litle on how you'd like to use these classes
>> and how you envision the end user working? Typically when we're dealing
>> with XML stylesheet we're using them in conjuction with XSL and simply
>> add a <?xml-stylesheet type="text/xsl" href=""?> tag to the top of the
>> XML file. BTW, the xml source editor will content assist you for that
>> magic tag which is very handy.
>>
>> Eric Woodruff wrote:
>>
>>> It looks like there is a lot of code in the htmlcss package that could
>>> be factored out to be shared for html & xml. Does anyone else agree? I'm
>>> talking about the LinkElementAdapter, the HTMLStyleSelectorAdapter, etc.
>>
>>> Eric Woodruff wrote:
>>>> Is there any support for the xml-stylesheet processing instruction in
>>>> WTP, specifically as a style adapter? I've found a couple of adapters
>>>> related to style for HTML documents, but none for XML. If I need to add
>>>> one, is there an extension point I would use? Can someone point me to
>>>> some the right aspect of the HTML CSS support as an example?
>>>>
>>>> Thanks.
>>
Re: Style adaptor for XML Documents [message #184648 is a reply to message #184639] Thu, 14 December 2006 00:47 Go to previous message
Eclipse User
Originally posted by: eric.services.ideoform.org

Maybe I have a misunderstanding about how the style adapters in the HTML
editor work. My assumption is that there is a WYSIWYG HTML editor that
knows how to render an HTML document using CSS styles specified in an
external CSS stylesheet. I imagine that in that case, there is an
extension of INodeAdapter that allows a style adapter to be attached to
IDOMNode instances so that each node can be decorated with the style as
determined from the stylesheet. I also suspect that the style adapter
would be attached to each respective DOM node when the document was
loaded (or hopefully when someone added or modified an
<?xml-stylesheet.. ?> PI), I think the HTMLModelLoader may be playing a
part in this? Then when displaying the document the WYSIWYG HTML editor
would get the style information for each node using node.getAdapter
(ISomeCSSOrStyleAdapter).

I want to do the same thing, it just happens to be an XML document
instead. If it is only a matter of extending a model loader and/or a
document loader, then it doesn't seem that big of a deal. However, CSS
does apply to XML as much as HTML so it should be something that is just
done automatically by the XMLModelLoader (or whatever class should be
responsible). For example:
http://en.wikipedia.org/wiki/Cascading_Style_Sheets#Example_ of_applying_CSS_to_.27plain.27_XML

Also, in the WTP 2.0 plan there is mention about white-space formatting,
and DocBook is specifically mentioned. It might be a stretch, but do you
think that a DocBook editor would be an appropriate WTP subproject? The
project I'm working on is very much an extension of the SSE. (To take
full advantage of the SSE I've even considered the possibility of syntax
checking code segments in DocBook programlisting elements. For example,
a block of Java code that is an example in a DocBook article could take
advantage of syntax highlighting, if JDT were installed.)

craig wrote:
> I see, so you want to provide a GUI to configure your XSL that will
> simulate the way CSS applies HTML ... is that correct? If so I don't
> think we designed the CSS stuff to be reusable... so you're welcome to
> describe how you like us to refactor things and we can consider. In
> general WTP has been pretty conservative about defining API. Mainly
> this because we have a limited amount of developer resource working on
> this. Getting feedback from the community about what they want to use
> is very useful so please open an enhancement request with your
> suggestions. If you'd like to help us define API and write Javadoc we'd
> be happy to accept contributions!
>
> Eric Woodruff wrote:
>
>> Hi Craig,
>
>> I'm developing an Eclipse DocBook editor using WTP and GEF and would
>> like to style sheets like CSS to control the look of the editor. WTP
>> is a great project and it gives me a huge head start, there are a lot
>> of nice things to take advantage of. The major driving goal of my
>> project is to add team support (CVS/SVN, etc) and support rendered,
>> XML source and structured comparison of DocBook documents. (But there
>> are other Eclipse-isms to support as well like refactoring, project
>> natures, Snippets, etc).
>
>> (By the way, what are the guidelines for things marked 'internal' or
>> 'provisional'? There is a lot of useful code to build off of in WST,
>> but it gives the impression that I shouldn't be depending on it.)
>
>> craig wrote:
>>> Hi Eric,
>>>
>>> Maybe you can educate us a litle on how you'd like to use these
>>> classes and how you envision the end user working? Typically when
>>> we're dealing with XML stylesheet we're using them in conjuction with
>>> XSL and simply add a <?xml-stylesheet type="text/xsl" href=""?> tag
>>> to the top of the XML file. BTW, the xml source editor will content
>>> assist you for that magic tag which is very handy.
>>>
>>> Eric Woodruff wrote:
>>>
>>>> It looks like there is a lot of code in the htmlcss package that could
>>>> be factored out to be shared for html & xml. Does anyone else agree?
>>>> I'm
>>>> talking about the LinkElementAdapter, the HTMLStyleSelectorAdapter,
>>>> etc.
>>>
>>>> Eric Woodruff wrote:
>>>>> Is there any support for the xml-stylesheet processing instruction in
>>>>> WTP, specifically as a style adapter? I've found a couple of adapters
>>>>> related to style for HTML documents, but none for XML. If I need to
>>>>> add
>>>>> one, is there an extension point I would use? Can someone point me to
>>>>> some the right aspect of the HTML CSS support as an example?
>>>>>
>>>>> Thanks.
>>>
>
Previous Topic:Running the Properties View Example gives NoClassDefFound Error
Next Topic:Using Eclipse to debug javascript in web pages
Goto Forum:
  


Current Time: Wed Aug 20 22:24:09 EDT 2014

Powered by FUDForum. Page generated in 0.01935 seconds