toc.xml generator [message #437667] |
Fri, 30 September 2005 19:08 |
Eclipse User |
|
|
|
Originally posted by: shashireo.hotmail.com
Is there a tool (plugin/API) which can generate toc.xml files from an
html source tree?
We'd like to be able to pull our html from a version control system, use
some tool and automatically package the help into a plugin. If such a
tool doesn't exist I think a good solution would be to insert custom xml
tags into html documents that a parser can interpret and generate
toc.xml out of.
A related question therefore is: how does eclipse generate the
plugin.xml files? Is it possible to use this API (which I can't seem to
find!) for generating the toc.xml?
Thanks for your help.
Shashi
|
|
|
Re: toc.xml generator [message #437679 is a reply to message #437667] |
Sat, 01 October 2005 14:17 |
Alex Blewitt Messages: 946 Registered: July 2009 |
Senior Member |
|
|
There isn't a tool that you can use to generate the toc.xml files directly. You won't be able to use the editor for plugin.xml files because ... well, it's a completely different type of file. Yes, they're both XML, but they are as similar as Atom files are to Microsoft Office XML format.
One way would be to write a simple command-line tool using utilities such as 'grep' to find out what the HTML title was. If you're writing well-formed XHTML, you could even use something like xsltproc to query the documents (if you knew enough about XSLT).
However, one thing that any automated tool won't be able to tell you is which order they should appear in the toc. That's why the toc files are usually created by hand, unless you've got some kind of naming convention in the files (e.g. 01_Welcome.html, 02_Overview.html) that you can use.
Although of little use (if you've already got large amounts of documentation) it's also possible to generate Eclipse help documentation from DocBook source material, which can then also be used to generate HTML, PDF, XSL-FO etc.:
http://www.xml.com/lpt/a/2003/08/13/docbook-eclipse.html
http://cvs.sf.net/viewcvs.py/docbook/xsl/eclipse/
http://docbook.sourceforge.net/projects/xsl/index.html
FYI the Plugin.xml file is not 'generated' as such; rather, the plugin.xml file is parsed and presented as an Editor. Changes in the UI (e.g. clicking on an 'add dependency' results in a new entry being inserted into the document.
|
|
|
Re: toc.xml generator [message #437680 is a reply to message #437679] |
Sat, 01 October 2005 15:23 |
Eclipse User |
|
|
|
Originally posted by: shashireo.hotmail.com
Very useful information. Thank you.
As regards this:
>> FYI the Plugin.xml file is not 'generated' as such; rather, the
>> plugin.xml file is parsed and presented as an Editor. Changes in the
>> UI (e.g. clicking on an 'add dependency' results in a new entry being
>> inserted into the document.
I was wondering how this 'insertion' is performed. Are they somewhat
hard-wired into the code? Or is it possible to create a class that gets
instantiated with an XML schema and then can be used to insert sections
of XML? Guess I can read the source to find out...
Shashi
Alex Blewitt wrote:
> There isn't a tool that you can use to generate the toc.xml files
> directly. You won't be able to use the editor for plugin.xml files
> because ... well, it's a completely different type of file. Yes,
> they're both XML, but they are as similar as Atom files are to
> Microsoft Office XML format.
>
> One way would be to write a simple command-line tool using utilities
> such as 'grep' to find out what the HTML title was. If you're writing
> well-formed XHTML, you could even use something like xsltproc to
> query the documents (if you knew enough about XSLT).
>
> However, one thing that any automated tool won't be able to tell you
> is which order they should appear in the toc. That's why the toc
> files are usually created by hand, unless you've got some kind of
> naming convention in the files (e.g. 01_Welcome.html,
> 02_Overview.html) that you can use.
>
> Although of little use (if you've already got large amounts of
> documentation) it's also possible to generate Eclipse help
> documentation from DocBook source material, which can then also be
> used to generate HTML, PDF, XSL-FO etc.:
>
> http://www.xml.com/lpt/a/2003/08/13/docbook-eclipse.html
> http://cvs.sf.net/viewcvs.py/docbook/xsl/eclipse/
> http://docbook.sourceforge.net/projects/xsl/index.html
>
> FYI the Plugin.xml file is not 'generated' as such; rather, the
> plugin.xml file is parsed and presented as an Editor. Changes in the
> UI (e.g. clicking on an 'add dependency' results in a new entry being
> inserted into the document.
|
|
|
|
Re: toc.xml generator [message #437687 is a reply to message #437684] |
Sun, 02 October 2005 02:43 |
Eclipse User |
|
|
|
Originally posted by: shashireo.hotmail.com
Thanks for that link. XOM looks like it might serve our needs very well.
Shashi
Alex Blewitt wrote:
>>>FYI the Plugin.xml file is not 'generated' as such; rather, the
>>>plugin.xml file is parsed and presented as an Editor. Changes in the
>>>UI (e.g. clicking on an 'add dependency' results in a new entry being
>>>inserted into the document.
>>
>>I was wondering how this 'insertion' is performed. Are they somewhat
>>hard-wired into the code? Or is it possible to create a class that gets
>>instantiated with an XML schema and then can be used to insert sections
>>of XML? Guess I can read the source to find out...
>
>
> You might be interested in looking into EMF (the Eclipse Modelling Framework) that allows data to be modelled as classes. There's an oldish article on the EMF at:
>
> http://www.eclipse.org/articles/Article-Using%20EMF/using-em f.html
>
> I don't think the PDE uses EMF to edit the plugin.xml file. It's possible to serialise documents generated from EMF into an xml file, but the format is an EMF-specific one (though it wouldn't be hard to translate it to/from your own XML schema if you wanted to).
>
> If you're looking for XML processing libraries, I can recommend the Xml Object Model at http://www.xom.nu -- it allows documents to be parsed, manipulated, and saved in a very object oriented way (with less verbosity than either using SAX or DOM).
|
|
|
|
Powered by
FUDForum. Page generated in 0.03408 seconds