xml - XSLT newline not working in MS Build task -


i'm trying transform xml file textfile ms build xsltransformationtask (https://msdn.microsoft.com/en-us//library/ff598688.aspx).

my problem can print new lines if combine them other (non-space) text. example <xsl:text>&#10;</xsl:text> not produce newline, <xsl:text>&#10;sampletext</xsl:text> does. tried other variants <xsl:text>&#xd;</xsl:text> , <xsl:text>&#xa;</xsl:text> same result.

ms build task:

<target aftertargets="build" name="test"> <xsltransformation xslinputpath="config.xslt" xmlinputpaths="config.schema.xml" outputpaths="out.txt" /> </target> 

xslt doc:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method='text' />  <xsl:template match="/root/properties">  <xsl:for-each select="./*">  <!--working new line character:--> <xsl:text>&#10;name: </xsl:text> <xsl:value-of select="name(.)" />  <!--not working:--> <xsl:text>&#10;</xsl:text>  </xsl:for-each>  </xsl:template>  <xsl:template match="text()" /> </xsl:stylesheet> 

hope helps

<xml>     <property>1</property>     <property>2</property>     <property>3</property> </xml> 

sample xsl

<?xml version="1.0" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method='text' />  <xsl:template match="/">     <xsl:for-each select='//property'>         <xsl:if test='position() > 1 '><xsl:text>&#xd;</xsl:text></xsl:if>         <xsl:value-of select='.'/>     </xsl:for-each> </xsl:template> 

creates

1 2 3 

Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -