You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Jeff Turner <je...@apache.org> on 2003/10/01 12:47:31 UTC

Storing DTDs in zips (Re: [PATCH] Docbook 4.1.2 support)

On Tue, Sep 30, 2003 at 08:39:32PM +0200, Juan Jose Pablos wrote:
> 
> Hi,
> 
> Some Editors like Open Office writer and Abiword export docbook format 
> using version 4.1.2. Forrest is using 4.2 which is the current version 
> suggested.
> 
> To simplify the integration of such editors plus some that I am not 
> aware, I created this patch.
> 
> This patch allow a support for docbook format version 4.1.2 as well as 4.2.
> 
> But this means that we increase our distribution around 60 Kb.

378k.

Given that published DTDs don't change, and are very compressible, how
about we store them zipped?  According to a comment in Catalog.java, the
code could fish the DTD out of zips:

<public publicId="-//OASIS//DTD Simplified DocBook XML V1.0//EN"
        uri="jar:docbook412.zip!/sdocbook/1.0/sdocbook.dtd"/>


--Jeff

> 
> Cheers,
> Cheche



Re: Storing DTDs in zips (Re: [PATCH] Docbook 4.1.2 support)

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Jeff Turner wrote:

...
> Given that published DTDs don't change, and are very compressible, how
> about we store them zipped?  According to a comment in Catalog.java, the
> code could fish the DTD out of zips:
> 
> <public publicId="-//OASIS//DTD Simplified DocBook XML V1.0//EN"
>         uri="jar:docbook412.zip!/sdocbook/1.0/sdocbook.dtd"/>

It would be excellent. It also prevents us from changing a DTD that we 
should not change, in case we commit something wrong.

Juan, could you give it a try? It would be really cool.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------



Re: Storing DTDs in zips (Re: [PATCH] Docbook 4.1.2 support)

Posted by Nicola Ken Barozzi <ni...@apache.org>.
David Crossley wrote:
...
> Where would the DTDs be stored? I mean do they come directly
> from the home site, e.g. OASIS, or do we store a copy somewhere.
> Looking for ways to make it less breakable.

My idea was to do as the skins, which means that they would be stored in 
the bundle with the stylesheet.

> One other thought to throw in the melting pot ...
> There is probably a way to map the stylesheets to some identifier
> that the Catalog Entity Resolver can deal with. Does that help?
> Can it even be done?

I want to map the private-id to the filename of the stylesheets. If it's 
not enough we can put in a normalized version of the public-id too.

As for the entity resolver we would need to enhance create the xml of 
the resolver with an Ant task/target before validation.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------



Re: Storing DTDs in zips (Re: [PATCH] Docbook 4.1.2 support)

Posted by David Crossley <cr...@indexgeo.com.au>.
Nicola Ken Barozzi wrote:
> Jeff Turner wrote:
> > Nicola Ken Barozzi wrote:
> ...
>  >>any case, the zip solution has other benefits too, so I favor it in
> >>any case (ie I don't see the size as an issue but like the idea 
> >>nevertheless).
> > 
> > I'm having second-thoughts.. (sorry:), since DTD-aware editors want to be
> > pointed to the DTDs, not a .zip of them.
> 
> I thought about it too, and have second-thought too, but of slightly 
> different nature ;-)

I too worried about that. I had started testing anyway, and the
.zip method didn't seem to work ... will try some more for the sake
of feedback.

> What about doing (I propose myself for the job :-) a thing similar to 
> the one done with skins?

Great idea, +1 ... actually i recall that we talked about this
on forrest-dev a while ago.

> I mean, we have skinpacks now, we can have DTD packs. Each DTD pack 
> contains the DTDs and the stylesheets that Forrest needs to transform 
> the source format to the documentDTD format (adaptor).
> 
> How to make the Forrest sitemap use them? Simple, we make an action or 
> something that automatically maps DTDs to these adapter stylesheets.
> 
> Example:
> 
>    <public publicId="-//APACHE//DTD Changes V1.2//EN"
>            uri="dtd/changes-v12.dtd"/>
> 
> Will use for this stylesheet:
> 
>    blahblah/stylesheets/changes-v12.dtd.xsl
> 
> As for the download and install I can use exactly the same scripts we 
> use for skins with some adjustments (to se what used DTDs are needed to 
> be downloaded).
> 
> How does this sound?

Excellent.

Where would the DTDs be stored? I mean do they come directly
from the home site, e.g. OASIS, or do we store a copy somewhere.
Looking for ways to make it less breakable.

One other thought to throw in the melting pot ...
There is probably a way to map the stylesheets to some identifier
that the Catalog Entity Resolver can deal with. Does that help?
Can it even be done?

--David



Re: Storing DTDs in zips (Re: [PATCH] Docbook 4.1.2 support)

Posted by David Crossley <cr...@indexgeo.com.au>.
Jeff Turner wrote:
<snip/>
> We haven't exactly been swamped with requests for supporting obscure
> DTDs, so I don't really see the need.

It would be a nice capability though.

> Also, DTDs we bundle are our contract with the world.  They are
> fundamental to Forrest.  Why would we want to maintain them externally?

I agree, we still need to ship a core set of DTDs and other schemas.
At some stage we will have xhtml2 stuff too.

However, we need to draw a line somewhere and having DocBook 4.1.2
(in addition to DocBook 4.2) is getting close to it. So this
capability could be provided so that projects can define and get
whatever they need.

Actually my enthusiasm is starting to waver as i write. This task
could get rather complex. Our other possibility is to just enhance
our documentation. We already describe how to configure their
own stuff.

--David





Re: Storing DTDs in zips (Re: [PATCH] Docbook 4.1.2 support)

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Jeff Turner wrote:
> On Thu, Oct 02, 2003 at 11:44:03AM +0200, Nicola Ken Barozzi wrote:
> 
>>Jeff Turner wrote:
>>
>>>On Wed, Oct 01, 2003 at 02:11:57PM +0200, Nicola Ken Barozzi wrote:
>>...
>>What about doing (I propose myself for the job :-) a thing similar to 
>>the one done with skins?
>>
>>I mean, we have skinpacks now, we can have DTD packs. Each DTD pack 
>>contains the DTDs and the stylesheets that Forrest needs to transform 
>>the source format to the documentDTD format (adaptor).
>>
>>How to make the Forrest sitemap use them? Simple, we make an action or 
>>something that automatically maps DTDs to these adapter stylesheets.
>>
>>Example:
>>
>>  <public publicId="-//APACHE//DTD Changes V1.2//EN"
>>          uri="dtd/changes-v12.dtd"/>
>>
>>Will use for this stylesheet:
>>
>>  blahblah/stylesheets/changes-v12.dtd.xsl
> 
> The SourceTypeAction does exactly that.
> 
>  <sourcetype name="changes-v12">
>    <document-declaration public-id="-//APACHE//DTD Changes V1.2//EN" />
>  </sourcetype>
>  ...
>  <map:when test="changes-v12">
>    <map:transform src="resources/stylesheets/changes2document.xsl" />
>  </map:when>

That's not what I had in mind. In the current case you need to specify 
the style in the sitemap, I had something like this in mind instead:

   <get-private-sourcetype property = "private-id"/>
   ...
   <map:transform src="resources/stylesheets/{private-id}.xsl" />

>>As for the download and install I can use exactly the same scripts we 
>>use for skins with some adjustments (to se what used DTDs are needed to 
>>be downloaded).
>>
>>How does this sound?
> 
> We haven't exactly been swamped with requests for supporting obscure
> DTDs, so I don't really see the need.

Many have asked how to do a certain thing, and invariably the answer has 
been to touch the sitemap. I don't want users touching sitemaps if 
possible, as those are *not* our contracts with the world (also replying 
to the following point).

The DocumentDTD *is* our contract, and by doing this we ensure that 90% 
of the needed extra features can be done with 10% the hassle.

IT will also make it easier for us to maintain xsls and DTDs, as we 
don't need to touch the sitemaps ourselves.

> Also, DTDs we bundle are our contract with the world.  They are
> fundamental to Forrest.  Why would we want to maintain them externally?

We would not maintain ours externally, we would still keep thsm locally. 
What we would enable is for others to add theirs, exactly like the skins.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------



Re: Storing DTDs in zips (Re: [PATCH] Docbook 4.1.2 support)

Posted by Jeff Turner <je...@apache.org>.
On Thu, Oct 02, 2003 at 11:44:03AM +0200, Nicola Ken Barozzi wrote:
> Jeff Turner wrote:
> 
> >On Wed, Oct 01, 2003 at 02:11:57PM +0200, Nicola Ken Barozzi wrote:
> ...
> >>any case, the zip solution has other benefits too, so I favor it in
> >>any case (ie I don't see the size as an issue but like the idea 
> >>nevertheless).
> >
> >I'm having second-thoughts.. (sorry:), since DTD-aware editors want to be
> >pointed to the DTDs, not a .zip of them.
> 
> I thought about it too, and have second-thought too, but of slightly 
> different nature ;-)
> 
> What about doing (I propose myself for the job :-) a thing similar to 
> the one done with skins?
> 
> I mean, we have skinpacks now, we can have DTD packs. Each DTD pack 
> contains the DTDs and the stylesheets that Forrest needs to transform 
> the source format to the documentDTD format (adaptor).
> 
> How to make the Forrest sitemap use them? Simple, we make an action or 
> something that automatically maps DTDs to these adapter stylesheets.
> 
> Example:
> 
>   <public publicId="-//APACHE//DTD Changes V1.2//EN"
>           uri="dtd/changes-v12.dtd"/>
> 
> Will use for this stylesheet:
> 
>   blahblah/stylesheets/changes-v12.dtd.xsl

The SourceTypeAction does exactly that.

 <sourcetype name="changes-v12">
   <document-declaration public-id="-//APACHE//DTD Changes V1.2//EN" />
 </sourcetype>
 ...
 <map:when test="changes-v12">
   <map:transform src="resources/stylesheets/changes2document.xsl" />
 </map:when>

> As for the download and install I can use exactly the same scripts we 
> use for skins with some adjustments (to se what used DTDs are needed to 
> be downloaded).
> 
> How does this sound?

We haven't exactly been swamped with requests for supporting obscure
DTDs, so I don't really see the need.

Also, DTDs we bundle are our contract with the world.  They are
fundamental to Forrest.  Why would we want to maintain them externally?


--Jeff


> -- 
> Nicola Ken Barozzi                   nicolaken@apache.org
>             - verba volant, scripta manent -
>    (discussions get forgotten, just code remains)
> ---------------------------------------------------------------------
> 
> 

Re: Storing DTDs in zips (Re: [PATCH] Docbook 4.1.2 support)

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Jeff Turner wrote:

> On Wed, Oct 01, 2003 at 02:11:57PM +0200, Nicola Ken Barozzi wrote:
...
 >>any case, the zip solution has other benefits too, so I favor it in
>>any case (ie I don't see the size as an issue but like the idea 
>>nevertheless).
> 
> I'm having second-thoughts.. (sorry:), since DTD-aware editors want to be
> pointed to the DTDs, not a .zip of them.

I thought about it too, and have second-thought too, but of slightly 
different nature ;-)

What about doing (I propose myself for the job :-) a thing similar to 
the one done with skins?

I mean, we have skinpacks now, we can have DTD packs. Each DTD pack 
contains the DTDs and the stylesheets that Forrest needs to transform 
the source format to the documentDTD format (adaptor).

How to make the Forrest sitemap use them? Simple, we make an action or 
something that automatically maps DTDs to these adapter stylesheets.

Example:

   <public publicId="-//APACHE//DTD Changes V1.2//EN"
           uri="dtd/changes-v12.dtd"/>

Will use for this stylesheet:

   blahblah/stylesheets/changes-v12.dtd.xsl

As for the download and install I can use exactly the same scripts we 
use for skins with some adjustments (to se what used DTDs are needed to 
be downloaded).

How does this sound?

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------



Re: Storing DTDs in zips (Re: [PATCH] Docbook 4.1.2 support)

Posted by Jeff Turner <je...@apache.org>.
On Wed, Oct 01, 2003 at 02:11:57PM +0200, Nicola Ken Barozzi wrote:
> Juan Jose Pablos wrote:
> 
> >Jeff Turner wrote:
> >
> >>On Tue, Sep 30, 2003 at 08:39:32PM +0200, Juan Jose Pablos wrote:
> >>
> >>>
> >>>But this means that we increase our distribution around 60 Kb.
> ...
> >>378k.
> >
> >we do not distributed our software on plain text do we?
> 
> Given that many of our users are still getting Forrest from CVS, it's a
> distro ;-)

But then CVS has a '-z compression-level' option which I hope most people
use, bringing it back to 60k.

> In any case, the zip solution has other benefits too, so I favor it in 
> any case (ie I don't see the size as an issue but like the idea 
> nevertheless).

I'm having second-thoughts.. (sorry:), since DTD-aware editors want to be
pointed to the DTDs, not a .zip of them.


--Jeff

> -- 
> Nicola Ken Barozzi                   nicolaken@apache.org
>             - verba volant, scripta manent -
>    (discussions get forgotten, just code remains)
> ---------------------------------------------------------------------
> 
> 

Re: Storing DTDs in zips (Re: [PATCH] Docbook 4.1.2 support)

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Juan Jose Pablos wrote:

> Jeff Turner wrote:
> 
>> On Tue, Sep 30, 2003 at 08:39:32PM +0200, Juan Jose Pablos wrote:
>>
>>>
>>> But this means that we increase our distribution around 60 Kb.
...
>> 378k.
> 
> we do not distributed our software on plain text do we?

Given that many of our users are still getting Forrest from CVS, it's a 
distro ;-)

In any case, the zip solution has other benefits too, so I favor it in 
any case (ie I don't see the size as an issue but like the idea 
nevertheless).

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------



Re: Storing DTDs in zips (Re: [PATCH] Docbook 4.1.2 support)

Posted by Juan Jose Pablos <ch...@che-che.com>.
Jeff Turner wrote:
> On Tue, Sep 30, 2003 at 08:39:32PM +0200, Juan Jose Pablos wrote:
>>
>>But this means that we increase our distribution around 60 Kb.
                                       ^^^^^^^^^^^^
> 
> 
> 378k.
> 

we do not distributed our software on plain text do we?

Cheche