cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Stevens" <>
Subject RE: Accessing Global Variables As External File
Date Thu, 25 May 2006 00:25:53 GMT
>From: "Stewart, Gary" <>
>Date: Wed, 24 May 2006 16:57:42 +0100
>Hi there,
>I was wondering if it was possible to access the global-variables component 
>configuration as an external file? Basically there are some values in there 
>that change depending on which server I was using so I figured I could 
>separate that into a static XML file and not include that file in version 
>control so I could customise it depending on the server.
>Is there a way to do this or should I use something other than 
>global-variables to access these values in the sitemaps.

The way we do it is by defining an external entity in the internal DTD i.e.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map:sitemap [
  <!ENTITY environment SYSTEM "environment.ent">
<map:sitemap xmlns:map="">

where environment.ent is of the form


Possibly I should have included the global-variables tags in there too, but 
I figured I might want to specify some other variables directly in the 

The only drawback we've found with this approach is that, unlike when the 
sitemap changes, we have to restart the application for it to see any 
changes in the environment.ent file.

In the same way, I externalised the database configuration from 
cocoon.xconf, since that was the only part which differed between our 
development/testing/production environments.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message