Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Transforming XML to text (and output tab and new line characters [Thread Next] Re: Transforming XML to text (and output tab and new line charactersTo: NULL Date: 12/7/2005 9:05:00 PM The problem is not in .Transform() but in the way how you call .Load(). Nost likely you load XSLT to XPathDocument or XmlDocument and it strips all white space nodes. To disable WS stripping in XPathDocument you can pass it XmlSpace.Preserve as an argulemt. To verify that WS stripping is the root of the problem add xml:space="preserve" attribute into <xsl:text> element. Sergey "Buddy Ackerman" <buddy_N0SPAM@b...> wrote in message news:%23sEPG8r8FHA.3200@T...... > > > > "swapna guddanti [MSFT]" <swapnag@m...> wrote in message > news:438207aa$1@n...... >> >> "Buddy Ackerman" <buddy_N0SPAM@b...> wrote in message >> news:eQS26H86FHA.3276@T...... >> > 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> > > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
