IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

XSLT1 adding line feeds Options · View
RobertB
Posted: Tuesday, June 10, 2014 11:14:09 PM
Rank: Member

Joined: 3/23/2013
Posts: 12
Location: Denver
Hi,

I am nearing completion of a project but I need to be able to add a line feed. I know xslt users have it easy with code_to_string but I cannot use XSLT2 for this project so I am limited in doing it the hard way.

I want to join multiple strings together, but I need to add a line feed into one of the Concat values.

I searched the forum, but the closest answer I could get is generating a custom library.

This is some of the code I came up with but it seems to be giving me errors:

Code:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:fn="http://www.w3.org/2005/xpath-functions"
   xmlns:msxsl="urn:schemas-microsoft-com:xslt"
   xmlns:user="http://mycompany.com/mynamespace">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template name="char-from-code">
<xsl:param name="value" />
<xsl:value-of select="fn:codepoints-to-string(xs:integer(xs:decimal($value)))"/>
</xsl:template>
</xsl:stylesheet>



Error I am getting :

Code:

    XSLT Transformation failed: Error in XPath expression (Unknown function - Name and number of arguments do not match any function signature in the static context - 'http://www.w3.org/2005/xpath-functions:codepoints-to-string' - fn:codepoints-to-string)
Error occurred in file 'C:\Users\Librairies\Char_From_Code.xslt' in statement 'select="fn:codepoints-to-string(xs:integer(xs:decimal($value)))"'.


Any idea on what I am missing to make this work? Seems it does not recognize "codepoints-to-string" function even when adding the xpath function xmlns:fn="http://www.w3.org/2005/xpath-functions"

Many thanks!

Robert
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.