You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Carl Downs <ca...@convio.com> on 2000/04/27 03:10:15 UTC

supressing carriage returns in XSL output

Folks-

I'm using Xalan 1.0.1 and have a *simple* question
about controlling XSL translation output.

I am getting <CR> characters in my xml output
that I cannot seem to get rid of.  I've tried using
xsl:output, xsl:strip-space, etc., to try and quell
the carriage returns, but haven't had any luck.

Any help would be appreciated...

Thanks,
Carl

xml input
=========

<?xml version="1.0" encoding="UTF-8"?>
<RESULTSET count="4">
<COLUMN label="SITE_ID" name="SITE_ID" type="NUMBER" width="21"/>
<COLUMN label="DOMAIN" name="DOMAIN" type="VARCHAR2" width="64"/>
<COLUMN label="PREFIX" name="PREFIX" type="VARCHAR2" width="32"/>
<ROW id="1"><SITE_ID>1</SITE_ID><DOMAIN>carl1</DOMAIN><PREFIX/></ROW>
<ROW id="2"><SITE_ID>2</SITE_ID><DOMAIN>carl2</DOMAIN><PREFIX/></ROW>
</RESULTSET>


stylesheet
==========

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">

  <xsl:template match="RESULTSET/COLUMN">
      <xsl:value-of select="@label"/>,
  </xsl:template>

  <xsl:template match="RESULTSET/ROW">
     <xsl:for-each select="*">
       "<xsl:value-of select="."/>",
  </xsl:for-each>
  </xsl:template>

</xsl:stylesheet>


result file
============

SITE_ID,

DOMAIN,

PREFIX,


       "1",



       "carl1",



       "",




       "2",



       "carl2",



       "",