我已经从.NET 2.0升级到.NET 4.0的Webforms应用程序中有一个System.Web.UI.WebControls.Xml控件(Xml1)
... Dim ds As DataSet = app.Getobjects Dim xmlDoc As New System.Xml.XmlDataDocument(ds) Xml1.Document = xmlDoc Xml1.TransformSource = "~/xslt/admin_objectslist.xslt" ...
从第二行我得到警告:
‘System.Xml.XmlDataDocument’ is obsolete: ‘XmlDataDocument class will be removed in a future release.’.
从第三行我得到警告:
‘Public Property Document As System.Xml.XmlDocument’ is obsolete: ‘The recommended alternative is the XPathNavigator property. Create a System.Xml.XPath.XPathDocument and call CreateNavigator() to create an XPathNavigator.
为什么推荐使用.NET 4.0替代?
解决方法
d.我也遇到了这个问题,3.5.这是我想出来的:
XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(ds.GetXml()); xml1.XPathNavigator = xmlDoc.CreateNavigator(); xml1.TransformSource = @"~/XSLT/LogEntryTransform.xslt";
希望它有帮助.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。