Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - newLine issue when using XSLCompiledTransform.Transform() >Thread Next - Re: newLine issue when using XSLCompiledTransform.Transform() Re: newLine issue when using XSLCompiledTransform.Transform()To: NULL Date: 5/14/2009 1:47:00 PM Zest4Quest wrote: > Hi, > I have an xml in the following format > <?xml version="1.0" encoding="utf-16"?><Assessment > xmlns:i="http://www.w3.org/2001/XMLSchema-instance" > > <ObGyn> > <OBGYNNotes>a > b > c > d > e > </OBGYNNotes> > </ObGyn> > </Assessment> > > The characters in "abcde" all are in seperate lines which is picked up from > the UI. > > Now when i transform this xml to an RTF format the "abcde" instead of > retaining the newline effect comes out as "abcde" as if its one word. The > code that i am using to do the conversion is given below. The sXML holds the > above xml. How are you looking at the transformation result? I can't reproduce the problem with a simple console application. The XSLT is as follows: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" > <xsl:output method="text" indent="yes"/> <xsl:template match="/"> <xsl:value-of select="concat('|', Assessment/ObGyn/OBGYNNotes, '|')"/> </xsl:template> </xsl:stylesheet> The console code simply does string xml = @"<?xml version=""1.0"" encoding=""utf-16""?><Assessment xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" > <ObGyn> <OBGYNNotes>a b c d e </OBGYNNotes> </ObGyn> </Assessment>"; XslCompiledTransform proc = new XslCompiledTransform(); proc.Load(@"..\..\XSLTFile1.xslt"); proc.Transform(new XPathDocument(new StringReader(xml)), null, Console.Out); the output on the console is |a b c d e | So I am not sure where the problem comes from. -- Martin Honnen --- MVP XML http://msmvps.com/blogs/martin_honnen/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
