xsl-list
[Top] [All Lists]

[xsl] Fwd: Your posting to XSL-List

2018-07-21 10:33:50
Hi Experts,

I need to print a newline character in text file generated from XSLT. I
have to use this text output in SAP environment. As per my understanding we
have to use 
 for this.

Below is the XSLT 2.0 code that i am using but it is not giving me the
required output:-

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns:xs="
http://www.w3.org/2001/XMLSchema"; exclude-result-prefixes="xs" version="2.0"


    <xsl:character-map name="nl">
        <xsl:output-character character="&#xD;" string="&#xD;"/>
    </xsl:character-map>

    <xsl:output method="text" use-character-maps="nl"/>

    <xsl:variable name="line1" select="'This is first line'"/>
    <xsl:variable name="line2" select="'This is second line'"/>
    <xsl:variable name="line3" select="'This is second line'"/>
    <xsl:variable name="line4" select="'This is second line'"/>

    <xsl:template match="/">
        <xsl:value-of select="$line1"/>
        <xsl:text>&#xD;&#xA;</xsl:text>
        <xsl:value-of select="$line2"/>
        <xsl:text>&#xD;&#xA;</xsl:text>
        <xsl:value-of select="$line3"/>
        <xsl:text>&#xD;&#xA;</xsl:text>
        <xsl:value-of select="$line4"/>
        <xsl:text>&#xD;&#xA;</xsl:text>
    </xsl:template>

</xsl:stylesheet>

We can test the generated output at https://www.onlinehexeditor.com/ and it
should show the two hexacode 0d 0a instead it is showing only 0a.

I have a text file of expected output that i have checked online and
showing the hexacode 0d 0a which is fine and i need the same using xslt.

I have also attached the snapshot of the online test that I actually need.

Please suggest!

Best Regards,
Vishnu






-- 
Vishnu Singh | http://marklogicgd.blogspot.in/




======================================================================
B. Tommie Usdin                        
mailto:btusdin(_at_)mulberrytech(_dot_)com
<btusdin(_at_)mulberrytech(_dot_)com>
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                           Phone: 301/315-9631
Suite 207                                    Direct Line: 301/315-9634
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in XML and SGML

======================================================================
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>
  • [xsl] Fwd: Your posting to XSL-List, VISHNU SINGH svishnu(_dot_)singh4(_at_)gmail(_dot_)com <=