Re: [docbook-apps] trim space off tag contents

From
Gabor Hojtsy <>
Date
2003-04-27T10:25:22+00:00
ID
Thread
Re: [docbook-apps] trim space off tag contents
> > We used to have a DSSSL customized DocBook sheet, but are migrating to
> > XSL based customizations. There are only a few things which are currently
> > not correctly handled by the XSL sheets.
> >
> > One of those is that we would like to strip the space from the begining
> > of and from the end of some tags. In DSSSL we simply used
> > 'process-children-trim', which trimmed the leading and ending whitespace
> > from the child tag processed.
> >
> > It is obvious that xslt does not provide any direct solution for this. I
> > have also looked into the DocBook lib, but find nothing useful for this.
> > Has anyone solved such a problem using XSLT?
>
> The normalize-space() function in XSL removes leading
> and trailing spaces, and replaces internal sequences
> of whitespace with a single space character.
> If you are working with a string at that point, it could
> help.

I have checked this out before, but we are working with sourcecode fragments 
presented in <programlisting>s, which contain spacing for readability, 
therefore only the leading and trailing spaces should be removed. 
normalize-space() is not an option for us.

Thanks for the tip, by the way :)
Goba