Krishn60 Posted January 14, 2009 Share Posted January 14, 2009 I have an output from XML to plain Text. But in the result output, I am getting blank lines. Can anybody help me on how to remove them. Here is the sample of the output.----------------------------------------------RLO|^~\&||||||||7|PPBB|||01-01-79Z2R||||XNE||MASS DISAPPEARED WHEN PUNCTURED BY NEEDLE.|RLO|^~\&||||||||7|PPBB||98-98-98Z2R||||RLO|^~\&||||||||7|PPBB|||65-43-21Z2R||||RLO|^~\&||||||||7|PPBB|||34-34-34Z2R||||RLO|^~\&||||||||7|PPBB|||34-34-34Z2R||||------------------------- Link to comment Share on other sites More sharing options...
boen_robot Posted January 14, 2009 Share Posted January 14, 2009 What's the XSLT you're using? Link to comment Share on other sites More sharing options...
Krishn60 Posted January 14, 2009 Author Share Posted January 14, 2009 Sorry, I am very new to XSLT. Are you asking for the version. If so, it is 1.0 Link to comment Share on other sites More sharing options...
boen_robot Posted January 14, 2009 Share Posted January 14, 2009 Sorry, I am very new to XSLT. Are you asking for the version. If so, it is 1.0Um... no. I'm asking about the actual stylesheet you're using. You know... the file with <xsl:...> stuff in it? That file's contents. What is it? Link to comment Share on other sites More sharing options...
Krishn60 Posted January 14, 2009 Author Share Posted January 14, 2009 <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text" indent="no" xml:space="default" /> <xsl:variable name="Cartt" select="document('Cartoon')/Recommendations/Recommendation"></xsl:variable> <xsl:template match="Design"><xsl:apply-templates/></xsl:template> <xsl:template match="DesignData"> RLO|^~\&|||||||||7|P PBB||<xsl:value-of select="@BRDD"/> Z2R|1||<xsl:value-of select="BBNumb"/>|||||||||||||||||||||"F"| </xsl:template> <xsl:template match="BuildinComment"> <xsl:for-each select="."> XNE||<xsl:value-of select="@Comment"/>| </xsl:for-each> </xsl:template> <xsl:template match="DocDesignFindings"> <xsl:for-each select="."> BBRK5|<xsl:value-of select="../Veripath/@PathNumEXT"/>|<xsl:value-of select="../Solvent/Character/@RecNumEXT"/ </xsl:for-each> </xsl:template> </xsl:stylesheet> Link to comment Share on other sites More sharing options...
boen_robot Posted January 14, 2009 Share Posted January 14, 2009 Try to add <xsl:template match="text()" /> at the bottom (before </xsl:stylesheet>) and see how that goes.If that doesn't work out, instead place this at the top (after <xsl:stylesheet>): <xsl:strip-space elements="*" /> Link to comment Share on other sites More sharing options...
Krishn60 Posted January 14, 2009 Author Share Posted January 14, 2009 Great. That works closer to my need. But I still need to remove those spaces. This is what I am getting when I did both the options individually. I still get one line space. I don't need any line space.RLO|^~\&||||||||7|PPBB|||01-01-79Z2R||||XNE||MASS DISAPPEARED WHEN PUNCTURED BY NEEDLE.|RLO|^~\&||||||||7|PPBB||98-98-98Z2R||||RLO|^~\&||||||||7|PPBB|||65-43-21Z2R||||RLO|^~\&||||||||7|PPBB|||34-34-34Z2R||||RLO|^~\&||||||||7|PPBB|||34-34-34Z2R|||| Link to comment Share on other sites More sharing options...
boen_robot Posted January 14, 2009 Share Posted January 14, 2009 Remove the spaces in the rest of your templates. Something like this for example: <xsl:template match="DesignData">RLO|^~\&|||||||||7|PPBB||<xsl:value-of select="@BRDD"/>Z2R|1||<xsl:value-of select="BBNumb"/>|||||||||||||||||||||"F"|</xsl:template><xsl:template match="BuildinComment"><xsl:for-each select=".">XNE||<xsl:value-of select="@Comment"/>| </xsl:for-each></xsl:template><xsl:template match="DocDesignFindings"><xsl:for-each select=".">BBRK5|<xsl:value-of select="../Veripath/@PathNumEXT"/>|<xsl:value-of select="../Solvent/Character/@RecNumEXT"/</xsl:for-each></xsl:template> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.