xml文件中的换行符 [英] new line character in xml file

查看:1189
本文介绍了xml文件中的换行符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.
我已经开发了一个用户控件.该注释是从备忘编辑控件输入的,并显示在Web浏览器控件上.输入的注释或文本使用xslt格式化. xslt的输入是xml字符串.
将收集对象转换为字符串的代码是:

hi.
i have developed a user control. the comment is entered from memo edit control and displayed on web browser control. the comment or text entered is formatted using xslt. the input to xslt is xml string.
the code for converting collection object to string is:

Public Function TOXML(ByVal o As Comments) As String
       
            Dim x As New XmlDocument
            Dim xs As New Xml.Serialization.XmlSerializer(o.GetType)
            Dim ms As New IO.MemoryStream
            xs.Serialize(ms, o)
            ms.Position = 0
            x.Load(ms)
            Return x.InnerXml
           End Function
End Class



如果我写的话现在在这里

你怎么样

考虑到换行符,我的字符串显示了它,但xml文件未读取换行符.它在一行中显示注释

hihow r u

xslt也是如此.我想在用户输入时考虑换行符的情况下,在Web浏览器控件中按原样显示文本.

在哪里应该进行哪些更改?



now here if i write
hi
how r u

my string displays it considering the new line character but the xml file is not reading the new line character. it displays the comment in one line

hihow r u

and so does the xslt. i want to display the text in web browser control as it is as the user enters considering the new line character.

what changes should be made n where?

how can i make xml file to read the new line character?

推荐答案

我认为< br/>标签对您来说效果很好.试试吧.
I think <br /> tag will work fine for you. Try it.


这篇关于xml文件中的换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆