You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Rich Morin <rd...@cfcl.com> on 2007/04/07 15:28:59 UTC
Pouring HTML into Cocoon?
Background
I have been asked to put together a publication tool
chain that can generate both HTML and PDF from XML
source documents. Cocoon seems like a good match for
this project, but I am concerned about the amount of
effort that the "start-up" phase will require.
We are starting from a pair of documents. One (the
tutorial) exists as XML files; it has been published
using AurigaDoc. The other (the manual) exists as a
few hundred HTML files.
Questions:
What standard (or at least common :-) flavors of XML
markup are used in the Cocoon community? I've seen a
few references to DocBook; is it a reasonable choice?
What tool(s) exist to convert random HTML into Cocoon-
friendly XML? HTML Tidy is a good start, but XHTML
isn't (for example) DocBook...
Any advice, comments, or pointers would be appreciated.
-r
--
http://www.cfcl.com/rdm Rich Morin
http://www.cfcl.com/rdm/resume rdm@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841
Technical editing and writing, programming, and web development
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
DocBook
Posted by Robin Rigby <ro...@gondolier.org.uk>.
The DocBook sample in version 2.2 is the same as in 2.1. You need a pointer
to sdocbook.dtd to make it work. The sample makes this clear and refers to
the version 2.1 documentation which in turn refers to cocoon.xconf and
WEB-INF/classes. These do not appear in a standard block in 2.2.
The 2.2 sample seems to have moved CatalogManager.properties to
src/main/resources but otherwise it is unchanged. It also contains copies
of dtds and schemas in src/main/resources/META-INF/cocoon/entities.
So far, so good but it is not working. Cocoon cannot find sdocbook.dtd.
I have copied the sample code to a new block with CatalogManager.properties,
which I have edited to point to my catalog file (which works well in version
2.1)
catalogs=file:d:/linux/usr/local/sgml/xml-catalog.xml
What else do I need, please?
Robin
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Building NekoHTML on Unix?
Posted by Ralph Goers <Ra...@dslextreme.com>.
Try looking at blocks.properties.
Rich Morin wrote:
> Thanks; that's useful information. Looking at
>
> .../cocoon-2.1.10/INSTALL.txt
>
> I see that
>
> Blocks provide services that you might not need,
> therefore the build system allows you to remove
> them from the build.
>
> This seems to imply that the default build includes
> (pretty much) everything. So, I may already have
> the html block in place. However, a quick look at
>
> .../cocoon-2.1.10/build.properties
>
> doesn't tell me whether this is the case. Pending
> further feedback, I'll assume that this is so.
>
>
> Getting back to the question of the samples that
> Bertrand linked me to, I'm still unable to get to
> any useful information there. Specifically,
>
> http://cocoon.zones.apache.org/demos/release/samples/blocks/html/welcome
>
> contains several links labeled "Cocoon News Website".
> The one under "NekoHTMLGenerator" takes me to
>
>
> http://cocoon.zones.apache.org/demos/release/samples/blocks/html/apache-neko
>
> This page contains several links. Clicking on the
> most recent, I'm taken to a "Cocoon News" page at
>
>
> http://cocoon.apache.org/news/#Released+Cocoon+2.1.10+%2821+December+2006%29
>
> This page tells me that there are several Cocoon
> releases, and contains several on-page links, but it
> has no links (that I can see) to anything useful. I
> tried this under both OmniWeb and Firefox, in case I
> was encountering a browser problem, but no luck.
>
> Am I missing some vital clue?
>
> -r
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Building NekoHTML on Unix?
Posted by Jason Johnston <co...@lojjic.net>.
Rich Morin wrote:
> Thanks; that's useful information. Looking at
>
> .../cocoon-2.1.10/INSTALL.txt
>
> I see that
>
> Blocks provide services that you might not need,
> therefore the build system allows you to remove
> them from the build.
>
> This seems to imply that the default build includes
> (pretty much) everything. So, I may already have
> the html block in place. However, a quick look at
>
> .../cocoon-2.1.10/build.properties
>
> doesn't tell me whether this is the case. Pending
> further feedback, I'll assume that this is so.
>
>
> Getting back to the question of the samples that
> Bertrand linked me to, I'm still unable to get to
> any useful information there. Specifically,
>
> http://cocoon.zones.apache.org/demos/release/samples/blocks/html/welcome
>
> contains several links labeled "Cocoon News Website".
> The one under "NekoHTMLGenerator" takes me to
>
> http://cocoon.zones.apache.org/demos/release/samples/blocks/html/apache-neko
OK, stop here. This page IS the live sample. In the background, Cocoon
is grabbing the HTML from http://cocoon.apache.org/news, feeding that to
the NekoHTMLGenerator, transforming it with an XSLT stylesheet, and
serializing as XHTML. You can see this in the sitemap for that sample:
<map:match pattern="apache-neko">
<map:generate type="nekohtml" src="http://cocoon.apache.org/news"/>
<map:transform src="stylesheets/apache-no-namespace.xsl"/>
<map:serialize type="xhtml"/>
</map:match>
The rest of the samples behave similarly; check out the sitemap.xmap
from the html block's samples (under src/blocks/html/samples in the
Cocoon source code) for the rest.
>
> This page contains several links. Clicking on the
> most recent, I'm taken to a "Cocoon News" page at
>
>
> http://cocoon.apache.org/news/#Released+Cocoon+2.1.10+%2821+December+2006%29
>
> This page tells me that there are several Cocoon
> releases, and contains several on-page links, but it
> has no links (that I can see) to anything useful. I
> tried this under both OmniWeb and Firefox, in case I
> was encountering a browser problem, but no luck.
>
> Am I missing some vital clue?
>
> -r
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Building NekoHTML on Unix?
Posted by Ralph Goers <Ra...@dslextreme.com>.
Also this page has some useful info on it for installing
http://cocoon.apache.org/2.1/installing/index.html
Rich Morin wrote:
> Thanks; that's useful information. Looking at
>
> .../cocoon-2.1.10/INSTALL.txt
>
> I see that
>
> Blocks provide services that you might not need,
> therefore the build system allows you to remove
> them from the build.
>
> This seems to imply that the default build includes
> (pretty much) everything. So, I may already have
> the html block in place. However, a quick look at
>
> .../cocoon-2.1.10/build.properties
>
> doesn't tell me whether this is the case. Pending
> further feedback, I'll assume that this is so.
>
>
> Getting back to the question of the samples that
> Bertrand linked me to, I'm still unable to get to
> any useful information there. Specifically,
>
> http://cocoon.zones.apache.org/demos/release/samples/blocks/html/welcome
>
> contains several links labeled "Cocoon News Website".
> The one under "NekoHTMLGenerator" takes me to
>
>
> http://cocoon.zones.apache.org/demos/release/samples/blocks/html/apache-neko
>
> This page contains several links. Clicking on the
> most recent, I'm taken to a "Cocoon News" page at
>
>
> http://cocoon.apache.org/news/#Released+Cocoon+2.1.10+%2821+December+2006%29
>
> This page tells me that there are several Cocoon
> releases, and contains several on-page links, but it
> has no links (that I can see) to anything useful. I
> tried this under both OmniWeb and Firefox, in case I
> was encountering a browser problem, but no luck.
>
> Am I missing some vital clue?
>
> -r
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Building NekoHTML on Unix?
Posted by Bertrand Delacretaz <bd...@apache.org>.
On 4/8/07, Rich Morin <rd...@cfcl.com> wrote:
> ...Getting back to the question of the samples that
> Bertrand linked me to, I'm still unable to get to
> any useful information there. Specifically,
>
> http://cocoon.zones.apache.org/demos/release/samples/blocks/html/welcome
>
> contains several links labeled "Cocoon News Website"....
You're probably missing the relationship between these samples and the
corresponding source code, which is not much more than a sitemap and a
few XSLT transforms.
Basically, if a sample from the Cocoon blocks has a URL of
samples/blocks/html/...
you'll find the corresponding code under
src/blocks/html/samples
in the Cocoon 2.1.x download.
In this case, the source code is here (in SVN, or under a similar path
if you've downloaded Cocoon):
https://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/html/samples/
For basic info about sitemaps, you might want to look at the
Supersonic Tour either online:
http://cocoon.zones.apache.org/demos/release/samples/blocks/tour/intro/docs/index.html
or via the samples page if you're running Cocoon locally.
HTH,
-Bertrand
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Building NekoHTML on Unix?
Posted by Rich Morin <rd...@cfcl.com>.
Thanks; that's useful information. Looking at
.../cocoon-2.1.10/INSTALL.txt
I see that
Blocks provide services that you might not need,
therefore the build system allows you to remove
them from the build.
This seems to imply that the default build includes
(pretty much) everything. So, I may already have
the html block in place. However, a quick look at
.../cocoon-2.1.10/build.properties
doesn't tell me whether this is the case. Pending
further feedback, I'll assume that this is so.
Getting back to the question of the samples that
Bertrand linked me to, I'm still unable to get to
any useful information there. Specifically,
http://cocoon.zones.apache.org/demos/release/samples/blocks/html/welcome
contains several links labeled "Cocoon News Website".
The one under "NekoHTMLGenerator" takes me to
http://cocoon.zones.apache.org/demos/release/samples/blocks/html/apache-neko
This page contains several links. Clicking on the
most recent, I'm taken to a "Cocoon News" page at
http://cocoon.apache.org/news/#Released+Cocoon+2.1.10+%2821+December+2006%29
This page tells me that there are several Cocoon
releases, and contains several on-page links, but it
has no links (that I can see) to anything useful. I
tried this under both OmniWeb and Firefox, in case I
was encountering a browser problem, but no luck.
Am I missing some vital clue?
-r
--
http://www.cfcl.com/rdm Rich Morin
http://www.cfcl.com/rdm/resume rdm@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841
Technical editing and writing, programming, and web development
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Building NekoHTML on Unix?
Posted by Jason Johnston <co...@lojjic.net>.
Rich Morin wrote:
> Although Bertrand Delacretaz prefers NekoHTML, he also
> mentioned JTidy. So, I tried downloading and building
> that, in order to maintain forward momentum. However,
> this got me no further than before.
I really don't think you need to fight with compiling your own JTidy and
NekoHTML, because they're already shipped with Cocoon. You'll just need
to build Cocoon with the 'html' block enabled, and then you can use
either HTMLGenerator (uses JTidy) or NekoHTMLGenerator (uses NekoHTML)
in your sitemap. The Cocoon samples webapp contains examples of them in
action, so you can look at the source code for those samples as your
guide; that is what Bertrand linked you to earlier.
Hope that helps clear things up.
--Jason
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Building NekoHTML on Unix?
Posted by Michael Wechner <mi...@wyona.com>.
Rich Morin wrote:
>Although Bertrand Delacretaz prefers NekoHTML, he also
>mentioned JTidy. So, I tried downloading and building
>that, in order to maintain forward momentum. However,
>this got me no further than before.
>
>Googling for JTidy, I got to
>
> http://jtidy.sourceforge.net/
> http://jtidy.sourceforge.net/download.html
> http://jtidy.sourceforge.net/howto.html
>
>It was a bit disconcerting to find that a very dusty
>(seven year old) development version was (apparently)
>the latest and greatest copy. Still, I persevered.
>
>However, after downloading the archive, I found that
>it, too, relied on a BAT file.
>
You might want to take a look at
http://svn.apache.org/repos/asf/lenya/branches/BRANCH_1_2_X/src/webapp/lenya/bin/util.xml
which you can use with ant: "ant -f src/webapp/lenya/bin/util.xml jtidy"
which is part of Lenya. Unfortunately you might also not like it,
because you basically have to download and build Lenya 1.2.x first which
is a bit overkill,
but in case you are interested to get into Java and Ant it might be a
start for you.
HTH
Michael
> Also, while the howto
>page instructs me to look for "jtidy-{version}.jar",
>no such file exists. The closest thing I could find
>was "build/Tidy.jar".
>
>So, stalled again. Maybe I should download HTML
>Tidy, after all...
>
>-r
>
>
--
Michael Wechner
Wyona - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
+41 44 272 91 61
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Building NekoHTML on Unix?
Posted by Rich Morin <rd...@cfcl.com>.
Although Bertrand Delacretaz prefers NekoHTML, he also
mentioned JTidy. So, I tried downloading and building
that, in order to maintain forward momentum. However,
this got me no further than before.
Googling for JTidy, I got to
http://jtidy.sourceforge.net/
http://jtidy.sourceforge.net/download.html
http://jtidy.sourceforge.net/howto.html
It was a bit disconcerting to find that a very dusty
(seven year old) development version was (apparently)
the latest and greatest copy. Still, I persevered.
However, after downloading the archive, I found that
it, too, relied on a BAT file. Also, while the howto
page instructs me to look for "jtidy-{version}.jar",
no such file exists. The closest thing I could find
was "build/Tidy.jar".
So, stalled again. Maybe I should download HTML
Tidy, after all...
-r
--
http://www.cfcl.com/rdm Rich Morin
http://www.cfcl.com/rdm/resume rdm@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841
Technical editing and writing, programming, and web development
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Building NekoHTML on Unix?
Posted by Rich Morin <rd...@cfcl.com>.
At 6:36 PM +0200 4/7/07, Bertrand Delacretaz wrote:
> NekoHTML usually does a better job than JTidy for me.
> Both are available as generators in the html block, see
> http://cocoon.zones.apache.org/demos/release/samples/blocks/html/welcome
> and the corresponding source code (under src/blocks/html/samples in
> the Cocoon source code).
Arrgh. Following the link above brought me to a nice-looking
page, but when I clicked on the links, the resulting "Cocoon
News" page gave me no useful information, but led only to other
(fancier, but still content-free) "Cocoon News" pages. Am I
doing something wrong?
Anyway, I Googled my way to
http://people.apache.org/~andyc/neko/doc/html/
which looked quite promising. I downloaded the tgz archive,
unpacked it, and read README_html. Unfortunately, it told me
to run the "build.bat" file. Given that I'm on a Unixish box
(Mac OS X), this is a non-starter for me.
Although the batch file looks fairly simple, I have no chops
in Ant, Java, or Windows. So, I am not eager to translate it.
Is there any chance that someone here could hack up a shell
script that performs the same functions as build.bat?
-r
--
http://www.cfcl.com/rdm Rich Morin
http://www.cfcl.com/rdm/resume rdm@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841
Technical editing and writing, programming, and web development
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Pouring HTML into Cocoon?
Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,
To use Cocoon for this, you'll usually only need to learn how to write
sitemaps (generation, aggregation, transformation), and XSLT if that's
what you're going to use, so it shouldn't be that difficult. Make sure
to avoid being lured by the many shiny things that Cocoon offers, at
least to start with ;-)
> ... What standard (or at least common :-) flavors of XML
> markup are used in the Cocoon community? I've seen a
> few references to DocBook; is it a reasonable choice?..
It is, but I usually tend to work with "augmented XHTML" files, that
is XHTML for the content parts, and custom models for metadata parts
(in the same document: some elements are XHTML-like, others are mine).
DocBook is good if you need to exchange content with others, or to use
DocBook-based tools, but if your content stays "internal" it might not
be worth the effort.
> ... What tool(s) exist to convert random HTML into Cocoon-
> friendly XML? HTML Tidy is a good start, but XHTML
> isn't (for example) DocBook.....
NekoHTML usually does a better job than JTidy for me. Both are
available as generators in the html block, see
http://cocoon.zones.apache.org/demos/release/samples/blocks/html/welcome
and the corresponding source code (under src/blocks/html/samples in
the Cocoon source code).
Hope this helps,
-Bertrand
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org