"swapna guddanti [MSFT]" <sw*****@microsoft.com> wrote in message
news:43********@news.microsoft.com...
"Buddy Ackerman" <bu**********@buddyackerman.com> wrote in message
news:eQ**************@TK2MSFTNGP10.phx.gbl... Apparently .NET strips these white space characters (MSXML doesn't)
regardless of what the output method is set to. I'm using
<xsl:text> </xsl:text> to output a tab character and
<xsl:text>
</xsl:text> to output a carriage return and line
feed but they get stripped at some point. I'm passing a StringWriter to the
XslTransform.Transform method. Anyway to get this to actually output
the tab and carriage and line feed characters?
If you include whitespace or carriage return inside <xsl:text> constructs,
this is considered significant whitespace and will not get stripped unless
you have a <xsl:strip-space> in your xslt file.I'm not able to repro this
scenario with StringWriter. Could you please provide more details.
thanks,
swapna
What other detail would you like? I'm tranforming like this:
StringWriter xsw = new StringWriter();
m_Transform.Transform(m_DataDocument, null, xsw, null);
It strips my characters everytime and I've tried different xsl:output
settings to get it to preserve them. I don not have <xsl:strip-space> in my
document.
Here's the full stylesheet:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:aspdnsf="http://www.aspdotnetstorefront.com">
<xsl:output method="text" omit-xml-declaration="yes" indent="no"
encoding="utf-8"/>
<xsl:template match="/">
<xsl:apply-templates select="root/Products/Product" />
</xsl:template>
<xsl:template match="Product">
<xsl:value-of select="SKU" />
<xsl:text> </xsl:text>
<xsl:value-of select="Manufacturer" />
<xsl:text> </xsl:text>
<xsl:value-of select="''" />
<xsl:text> </xsl:text>
<xsl:value-of select="ProductName" />
<xsl:if test="VariantName!=''">
<xsl:value-of select="concat(' - ', VariantName)" />
</xsl:if>
<xsl:text> </xsl:text>
<xsl:choose>
<xsl:when test="FroogleDescription!=''">
<xsl:value-of select="FroogleDescription" />
</xsl:when>
<xsl:when test="ProductFroogleDescription=''">
<xsl:value-of select="ProductFroogleDescription" />
</xsl:when>
<xsl:when test="/root/configs/config/UseDecr='true' and
VariantDescr!=''">
<xsl:value-of select="VariantDescr" />
</xsl:when>
<xsl:when test="/root/configs/config/UseDecr='true' and
ProductDescr!=''">
<xsl:value-of select="ProductDescr" />
</xsl:when>
</xsl:choose>
<xsl:value-of select="price" />
<xsl:text> </xsl:text>
<xsl:value-of select="/root/System/StoreUrl" />(!ProductLink
ProductID='<xsl:value-of select="ProductID"/>''
IncludeATag='false' !)
<xsl:text> </xsl:text>
(!ImageUrl Type='product' ID='<xsl:value-of
select="ProductID"/>' Size='icon' FullUrl='true' !)
<xsl:text> </xsl:text>
<xsl:value-of select="'Auto Parts and Accessories'" />
<xsl:text> </xsl:text>
<xsl:value-of select="'Y'" />
<xsl:text> </xsl:text>
<xsl:value-of select="'Ships 2-4 days'" />
<xsl:text> </xsl:text>
<xsl:value-of select="ShippingCharge" />
<xsl:text> </xsl:text>
<xsl:value-of select="weight" />
<xsl:text> </xsl:text>
<xsl:value-of select="'91304'" />
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>