This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

xalan 0.19 Why am I getting alot of blank lines in output


Hello,

I am using C++ xerces 1.1.0 and xalan 0.19 from apache running on NT 4.0 sp6
building with VC++ 6.0.  

Does anyone know why I am getting so many blank lines in my output file ?  I
have also tried this with Microsoft's and it also produces many blank lines.

I thought the following template would prevent the blank lines.
<xsl:template match="text()"/>

Output File:
data ULAS,2,"TEST_PKT_UB_ITEM"
    rawValue = 0




end ULAS
data AS64,3,"TEST_PKT_SB_ITEM"
    rawValue = 0




end AS64

INPUT FILE:
<?xml version="1.0" standalone="no" ?>

<DATABASE NAME="TEST_DB" xmnls="x-schema:sml.xml">
    <SECTION NAME="DB">
        <ULAS NAME="TEST_PKT_UB_ITEM" ID="2">
            <rawValue>0</rawValue>
        </ULAS>
        <AS64 NAME="TEST_PKT_SB_ITEM" ID="3">
            <rawValue>0</rawValue>
        </AS64>
    </SECTION>
</DATABASE>

XSL FILE:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"/>
<xsl:template match="/DATABASE/SECTION/*">
  <xsl:for-each select=".">
data <xsl:value-of select="name(.)"/>,<xsl:value-of
select="@ID"/>,"<xsl:value-of select="@NAME"/>"
    <xsl:for-each select="./*">
      <xsl:if test="name(.)='ARRAY'">
    numrecords = <xsl:value-of select="@LENGTH" /> <xsl:text>
    </xsl:text>
      </xsl:if>
      <xsl:if test="name(.)!='ARRAY'">
        <out><xsl:value-of select="name(.)"/> = <xsl:value-of
select="."/><xsl:text>
        </xsl:text></out>
      </xsl:if>
      <xsl:apply-templates/>
    </xsl:for-each>
end <xsl:value-of select="name(.)"/>
  </xsl:for-each>
</xsl:template>
<xsl:template match="comment()">
</xsl:template>
<xsl:template match="RECORD/*">
  <xsl:for-each select=".">
    <out><xsl:value-of select="name(.)"/> = <xsl:value-of
select="."/><xsl:text>
    </xsl:text></out>
  </xsl:for-each>
</xsl:template>
<xsl:template match="text()"/>
</xsl:stylesheet>


Thanks in advance,

_______________________________________________________________
Linda Derezinski
Interface & Control Systems

winmail.dat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]