xslt - Spaces in output -


i trying transform xml document document comma dlimited string. however, when transform see lot of spaces.

i not sure causing , should fix issue -

xml file input

    <file> <row>     <wid>wid0001</wid>     <xtn>leave record</xtn>     <status>in process</status>     <eid>e001</eid>     <amt>5000</amt> </row>   <row>     <wid>wid0003</wid>     <xtn>leave record</xtn>     <status>in process</status>     <eid>e005</eid>     <amt>3000</amt> </row>  <row>     <wid>wid0010</wid>     <xtn>leave record</xtn>     <status>in process</status>     <eid>e010</eid>     <amt>7000</amt> </row>   <row>     <wid>wid0007</wid>     <xtn>leave record</xtn>     <status>in process</status>     <eid>e010</eid>     <amt>0000</amt> </row>  <row>     <wid>wid0050</wid>     <xtn>leave record</xtn>     <status>in process</status>     <eid>e025</eid>     <amt>750000</amt> </row>  </file> 

and xslt -

<?xml version='1.0'?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"     xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:this="http://abogusurl.com">      <xsl:output indent="yes" method="xml" />          <xsl:template match="/file">             <widlist>                 <xsl:apply-templates />             </widlist>         </xsl:template>         <xsl:template match="row">             <xsl:value-of select="wid" />              <xsl:value-of select="','" />     </xsl:template>  </xsl:stylesheet> 

output

<?xml version="1.0"?> <widlist x xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:this="http://abogusurl.com"> wid0001,   wid0003,  wid0010,   wid0007,  wid0050,  </widlist> 

how eliminate spaces?

so think adding <xsl:strip-space elements="*"/> want.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -