Bug 28924 - [patch] Enable editing of XSLT and CSS stylesheets in authoring area
Summary: [patch] Enable editing of XSLT and CSS stylesheets in authoring area
Status: NEW
Alias: None
Product: Lenya
Classification: Unclassified
Component: Site Management (show other bugs)
Version: Trunk
Hardware: All All
: P3 enhancement
Target Milestone: 2.0.1
Assignee: Lenya Developers
Keywords: PatchAvailable
Depends on:
Reported: 2004-05-12 11:25 UTC by Chris Burdess
Modified: 2007-07-16 02:18 UTC (History)
1 user (show)

XSLT 1.0 Relax NG grammar (26.06 KB, text/xml)
2004-05-12 11:26 UTC, Chris Burdess

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Burdess 2004-05-12 11:25:43 UTC
Further to discussions on lenya-user, I would like to propose changes to the management of 
stylesheets, such that they can be edited and managed by Lenya just like any other resource.

CSS resources must be edited using the single-form editor, unless custom CSS editor integrations are 
envisaged. However, XSLT resources can be edited using the existing XML editor integrations and a 
suitable Relax NG grammar for XSLT. James Clark's XSLT 1.0 RNG grammar from


is attached to this issue.
Comment 1 Chris Burdess 2004-05-12 11:26:38 UTC
Created attachment 11520 [details]
XSLT 1.0 Relax NG grammar
Comment 2 Andreas Kuckartz 2004-05-12 21:54:06 UTC
The application of the appended patch should be considered for 1.2
Comment 3 edith 2004-05-14 13:17:44 UTC
Need some more reflexions; go to 1.4
Comment 4 Gregor J. Rothfuss 2004-10-29 03:15:19 UTC

are you still interested in this? if yes i would like to give this a shot soonish.
Comment 5 Chris Burdess 2004-10-29 08:18:50 UTC
I don't actually have a requirement for this myself. I was just commenting on the architecture.
Comment 6 Gregor J. Rothfuss 2005-06-02 04:54:04 UTC
solprovider wrote on the mailing list:

> All configuration files should be editable through the GUI.  Implement
> security so content editors cannot ruin the site structure, but add
> the ability to edit CSS, XSLTs, and maybe even XMAPs.  Try to remove
> reasons anyone would need access to the file system.

Comment 7 J 2007-01-04 05:30:13 UTC
i have implemented user-editable stylesheets recently for a customer project,
and it worked out nicely.
haven't looked at edith's patch, but basically what i did was:
* create an xslt doctype with the relax ng grammer edith pointed to
* add a custom metadata field "stylesheet" to allow other doctypes to reference
a custom stylesheet
* make it editable using DAV up/download.
* tweak the sitemaps of the "real document" doctypes to look up custom xslts if
specified and use them.
Comment 8 J 2007-01-04 06:15:37 UTC
you can look at the module here:

in the sitemap of the document type that is to use editable xslts, i add this:

      <map:match pattern="xmldb/*/*/*/*">
        <map:generate src="lenyadoc://{1}/{2}/{4}/{3}"/>
        <map:call resource="xmldb"/>

        <map:select type="parameter">
          <map:parameter name="parameter-selector-test"
          <map:when test=""/>
            <map:transform src="lenyadoc:/de/{stylesheet:stylesheet}">
              <map:parameter name="area" value="{2}"/>
              <map:parameter name="pub-id" value="{1}"/>

as you can see, i'm using a custom metadata field. it is declared in an xconf
patchfile in my publication:

    remove="/cocoon/meta-data/component-instance[@name =
  <component-instance name="http://stackingdwarves.net/meta"
    <element editable="true" name="stylesheet" multiple="false"/>

this could also be done by the module, but i felt uneasy about a module patching
a publication's metadata setup. but on second thought, it's probably ok and it
keeps everything in one place.