Jeremy Quinn wrote:
> 
> I have been reading the dox for powerusers for the new XXE 2.3.
> Some very nice additions!
> 
> I would like to request a new feature which would help us enormously
> (or happily accept suggestions for a workaround ....).
> 
> Would it be possible to get a way of stripping a specific prefix and/or
> suffix (ideally setup in the config file) from the Paths returned by
> the 'file-name-field' widget?
> 
> Our XML documents contain application-specific path-stubs to other
> resources, in attributes and elements:
> 
> <image src="archive/project/asset.jpg"/>
>    which has the following absolute paths:
>      file:///Library/Apache2/htdocs/assets/archive/project/asset.jpg
>      http://www.server.org/assets/archive/project/asset.jpg
> 
> <href>season/soft/about</href>
>    which has the following absolute paths:
>      file:///Users/Shared/Site/Content/season/soft/about.xml
>      http://www.server.org/[command/]season/soft/about
> 
> <component src="archive/projects-menu"/>
>    which has the following absolute paths:
>      file:///Users/Shared/Site/Components/archive/projects-menu.xml
>         cocoon:/components/archive/projects-menu  (internal url for
> aggregation)
> 
> We use these partial paths because we serve our XML via Apache Cocoon
> (which excels at abstracting URLs from resources), using XSLT to
> manipulate these paths according to the WebApp's requirements. (We call
> this Application root addressed).
> 
> (I imagine those writing Static XHTML, who use aliases to serve images,
> would also face the same kind of issue.)
> 
> Currently, in the case of the <image src="blah"/> we use the attribute
> pane's file browser to locate the relevant image, hand-edit the
> spurious absolute path prefix and have it displayed with the following
> CSS:
> 
>         image {
>                 content: concatenate("image('http://dev.local/assets/";, 
> attr(src),
> "', attr(width), attr(height))");
>         }
> 
> This all works very well, except for the error-prone hand editing.

OK, I'll add 2 new boolean parameters to the file-name-field: basename
(default no) and extension (default yes).

basename=yes means that you just want the basename of the file (ex.
logo.jpeg) rather than its absolute or relative path.
extension=no means that you want to strip the extension (ex. .jpeg) from
the absolute or relative path or basename returned by the file chooser.

Reply via email to