Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: newLine issue when using XSLCompiledTransform.Transform() newLine issue when using XSLCompiledTransform.Transform()To: NULL Date: 5/13/2009 1:43:00 PM 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.
XslCompiledTransform xslTransform = new XslCompiledTransform();
xslTransform.Load(xSLTFileName);
XsltArgumentList xslArg = new XsltArgumentList();
xslArg.AddParam("PresentTime", "", PresentTime);
xslTransform.Transform(new XPathDocument(new
StringReader(sXML)), xslArg, result);
return result.ToString();
The header of the XSLt used is also given below.
<?xml version="1.0" encoding="utf-8"?>
<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"
xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:dt="urn:schemas-microsoft-com:datatypes">
<xsl:param name="Signature"/>
<xsl:param name="PresentTime"/>
<xsl:param name="IsAdult"/>
<xsl:output method="text" indent="yes"/>
<xsl:template match="/">
<xsl:text>{\rtf1{\fonttbl{\f0\fnil\fcharset0
Arial;}}\viewkind4\uc1\pard\lang1033\fs18</xsl:text>
Any help would be very much appreciated...
Thanks
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
