Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


newLine issue when using XSLCompiledTransform.Transform()

From: Zest4Quest@-----------.---------.---
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




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent