straUnexpected output xsl:value-of

Viewed 15

Havin a strange issue again. I am tryinodo a simple value- of of field CRETIM:

        <CREDAT>20220628</CREDAT>
        <CRETIM>112159</CRETIM>



        <xsl:attribute name="timestamp">
            

        
                <xsl:value-of select="EDI_DC40/CRETIM" disable-output-escaping="yes"/>
a
        </xsl:attribute>

Output looks as follows:

enter image deOutputscription here First6 characterrs are ok, but no idea what happened to th rest.Any idea whats wrong here and how this can be fixed?

Thank you!

1 Answers

If that is XSLT 2 I wonder why you don't use the select attribute on xsl:attribute e.g. <xsl:attribute name="timestamp" select="EDI_DC40/CRETIM"/>.

If you use xsl:value-of wrapped into xsl:attribute make sure you have stray data (like that a letter) inside of xsl:attribute. If the sole a letter is intentional then use e.g. <xsl:attribute name="timestamp" select="concat(EDI_DC40/CRETIM, 'a')"/> or <xsl:attribute name="timestamp"><xsl:value-of select="EDI_DC40/CRETIM"/>a</xsl:attribute>.

Related