[英]Render XML document with XSL to a HTML page
I have a xml document like below and I need to render it into HTML page. 我有一个如下所示的xml文档,我需要将其呈现为HTML页面。 When I browse the XML from IE the HTML is rendered as expected with styling.
当我从IE浏览XML时,HTML会以样式呈现。 If I load the xml document from c# code and pass to HTML page it just renders as plain text.
如果我从c#代码加载xml文档并传递到HTML页面,它将仅呈现为纯文本。 What am I missing here?
我在这里想念什么?
XML XML
<?xml-stylesheet type='text/xsl' href='xslsheet.xsl'?>
<Document xmlns="org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
....
</Document>
C# C#
XDocument doc = XDocument.Load(@"C\SampleDocument.xml");
var result = doc.ToString();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.