XML开始文档和结束文档问题 [英] XML Start Document and End Document issue
问题描述
我有一台设备可以查看XML文件中的数据,但是它不会像这里显示的那样.
<?xml version ="1.0" encoding ="utf-8"?>
< movies>里奥·布拉沃(Rio Bravo)//movies>
它想要的是什么.
< xml>
< movies>里奥·布拉沃(Rio Bravo)//movies>
</xml>
问题是关闭和打开xml标记.
任何建议都很好.
I have a device that views XML file for data but it will not take it as show here.
<?xml version="1.0" encoding="utf-8"?>
<movies>Rio Bravo</movies>
What it want is this.
<xml>
<movies>Rio Bravo</movies>
</xml>
It is the closing and opening xml tags that are the problem.
Any suggestions would be great.
推荐答案
有人可以在这里提出什么建议?这里没有任何问题.目前尚不清楚什么似乎是问题,但这是不同的问题.
只需学习如何使用XML,就可以了.
了解有关XML本身的一些信息:
http://en.wikipedia.org/wiki/XML [ http://www.w3.org/XML/ [ http://www.w3.org/TR/REC-xml/ [
What can anyone suggest here? There is no any problem here. It''s not clear what seems to be a problem, but this is different issue.
Just learn how to work with XML, that''s is.
Learn a bit about XML itself:
http://en.wikipedia.org/wiki/XML[^],
http://www.w3.org/XML/[^],
http://www.w3.org/TR/REC-xml/[^].
Learn about using XML in .NET:
- 使用
System.Xml.XmlDocument
类.它实现了DOM接口;如果文档太大,则这种方法最简单,也足够好.
请参见 ^ ]. - 使用类
System.Xml.XmlTextReader/XmlWriter
;这是最快的读取方法,尤其是您需要跳过一些数据.
请参见 http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx [ http://msdn.microsoft.com/en-us/library/system.xml.xmlwriter.aspx [ http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx [http://msdn.microsoft.com/en-us/library/bb387063.aspx [
- Use
System.Xml.XmlDocument
class. It implements DOM interface; this way is the easiest and good enough if the size if the document is not too big.
See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^]. - Use the classes
System.Xml.XmlTextReader/XmlWriter
; this is the fastest way of reading, especially is you need to skip some data.
See http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx[^], http://msdn.microsoft.com/en-us/library/system.xml.xmlwriter.aspx[^]. - Use the class
System.Xml.Linq.XDocument
; this is the most adequate way similar to that ofXmlDocument
, supporting LINQ to XML Programming.
See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^], http://msdn.microsoft.com/en-us/library/bb387063.aspx[^].
更好的是,相反,所有这些详细信息都学习了如何使用数据协定进行XML 序列化:http://msdn.microsoft.com/en-us/library/ms733127.aspx [
Better yet, instead all of these details learn how to use Data Contract for XML serialization: http://msdn.microsoft.com/en-us/library/ms733127.aspx[^].
感谢伙计们
找到了解决方案,在设备上进行了更新,并且可以与XML 1.0版一起正常工作
Thanks Guys
Found the solution, did an update on the device and works fine with xml version 1.0
这篇关于XML开始文档和结束文档问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!