cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject [Fwd: Re: C2: Sitemaps and DTD's]
Date Thu, 03 May 2001 13:41:24 GMT
Here is an issue that was brought up by someone on the Cocoon Users list.

They have a DTD that they want a document to use (because of ENTITY declarations
and such).  The tool they are using to create the XML documents uses absolute
paths so it is difficult to move these documents from one machine to another.

The solution I gave him will work, but the cost is pretty high (look below).
Is there anyway, we can configure an EntityResolver with pre-mapped DTDs?
IOW can we initialize the Parser to use local copies of a DTD without opening
a port to the same server and using network protocols to obtain a local DTD?

I don't know if this would promote EntityResolver to a Component Status, but
it might be useful:

<entity-resolver>
  <dtd uri="http://www.server.com/my.dtd" src="context://dtd/my.dtd"/>
</entity-resolver>


> Thanks Berin,
> All hope is not lost!
> Regarding validation - As the files have been created with a DTD-aware tool, I don't
want Server validation to occur anyway as all
> I've done is copy them from one place to another.
> 
> Will entities still be create OK?

If Xerces finds the DTD, yes.  It will always read the DTD (which is one level of
performance loss).  Xerces doesn't have any way to turn this feature off.

> Cheers
> Mark
> 
> -----Original Message-----
> From: Berin Loritsch [mailto:bloritsch@apache.org]
> Sent: 03 May 2001 13:57
> To: cocoon-users@xml.apache.org
> Subject: Re: C2: Sitemaps and DTD's
> 
> > Mark Owens wrote:
> >
> > Hi,
> > Using C2/Tomcat4/Xalan_2_0_1/Xerces_1_3_1/Linux. (The mail archives are currently
down)
> > I'm not sure if this is a nonsense question but is there any way I can get a dtd
location mapped via the sitemap?
> >
> > I'm comitting files created under Windows (using XMetaL) to CVS on my Server. From
there, they are loaded into my Tomcat/cocoon
> 
> > webapp space.
> >
> > Trouble is, the dtd locations on Windows don't work under Cocoon - e.g. they use
full paths to dtd's. Also, can't simply strip
> out
> 
> > the DOCTYPE line as the DTD also declares entities.
> >
> > Ideally, I'd like to leave the XML files alone and map the dtd file via Cocoon.
> >
> > I'd appreciate any advice on how this issue could be resolved.
> 
> Yes you can.  There are two issues however:
> 
> 1) you need to specify the location of the DTD as http://server/file.dtd
>    which means that Xerces will open a socket to find it (very heavy).
> 2) Validation is expensive.  It will affect the performance of Cocoon.
> 
> You would map the dtd like this in the sitemap:
> 
> <map:match pattern="*.dtd">
>   <!-- If DTDs have a unique mime type, then substitute that -->
>   <map:read type="file" src="{1}.dtd" mime-type="text/plain"/>
> </map:match>
> 
> In this manner, You should be able to tell XMetaL to point to the web server for the
> DTD files.  XMetaL should populate the DOCTYPE declaration with the web server version.
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message