Altova Mailing List Archives


RE: [xsl] xsl:function

From: "Dominic Blythe" <dblythe@------------------>
To:
Date: 6/18/2002 6:03:00 AM
thanks everyone - i also pulled an example of the *recursive* 
method suggested by Mike from the list archives which I'll
be looking into as some of the fixed widths are 500 chars...

i think Mike should look at "expr" in the Saxon docs...

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of 
> Andrew Welch
> Sent: 18 June 2002 14:49
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: [xsl] xsl:function
> 
> 
> 
> The syntax is tripping you up again - because its a string you need to
> enclose it in single quotes:
> 
> <xsl:variable name="x"
> 	expr="'&#32;&#32;&#32;&#32;&#32;.....'">
>             ^                              ^
> 
> cheers
> andrew
> 
> 
> 
> this works nicely as
> <xsl:value-of
> select="concat(TITLE,substring('&#32;&#32;&#32;&#32;etc...',
> 							   1, 60 -
> string-length(TITLE)))"/>
> 
> but as
> <xsl:variable name="x"
> 	expr="&#32;&#32;&#32;&#32;&#32;.....">
> <xsl:value-of select="concat(TITLE,substring($x,1, 60 -
> string-length(TITLE)))"/>
> 
> no extra spaces are added.
> do i need to go read Mike's book again?
> 
> >
> > Unless your fixed length fields are really long it's easier to do
> > padding just using
> > concat($theString,substring($x, 1, $fixedLength -
> > string-length($theString)))
> > where $x is a sufficiently long string of space characters.
> >
> > David
> >
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 
> 
> 
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/2002
>  
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/2002
>  
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.