DataGridView XML文件帮助 [英] DataGridView XML file help
问题描述
大家好,
我正在使用DataGridView创建一个表,该表根据xml文件中的节点显示列.
像每个简单的xml一样,单元值都包含在每个节点中.
我遇到的问题是某些单元格值包含<",>"和其他可识别的xml符号.
这将阻止DataGridView显示格式化的xml文件.
任何帮助将不胜感激.
Hi All,
I am creating a table using DataGridView that displays columns based on the nodes in an xml file.
The cell values are contained within each node like simple xml.
The issue I am having is that some of the cells value contain ''<'',''>'', and other recognized xml symbols.
This is preventing the DataGridView to display the formatted xml file.
Any help would be greatly appreciated.
推荐答案
尝试查看此链接是否有帮助...
在javascript中加载xml文件
我觉得这跟你想要的一样
请记住,如果有帮助,请将其标记为答案;如果没有帮助,则将其取消标记.
问候,
Algem
Hi,
Try to see this link if it could help...
Getting an Exception in process of loading xml file in javascript
I think this is similar to what you want
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Regards,
Algem
根据XML特殊字符规则<必须以不同的方式处理.
考虑以下代码段
Under the rules of XML special characters line < have to be handled differently.
Consider this snippet
<place>MyHome</place>
现在,如果我要表示文本"MyHome> 1",则需要使用其他XML语法:
Now if I want to express the text "MyHome > 1" then a different XML syntax is required:
<place><![CDATA[MyHome > 1]]></place>
您如何解析它是一个设计问题.例如,在我的应用程序中,我不满足特殊字符的要求,但是如果我输入<![CDATA [MyHome> 1> 在文本框中,它将另存为有效XML并重新加载.
现在,如果我更需要该功能,则可以构建一些解析来检测特殊字符并提供CDATA包装/展开.
我已经通过使用Altova应用模式来验证了该示例,该格式格式正确且有效.]
How you parse it is a design issue. For example in my applications I don''t cater for special characters, but if I enter <![CDATA[MyHome > 1> in a text box it will save as valid XML and reload.
Now if I needed that feature more often I could build some parsing in to detect special characters and provide CDATA wrapping / unwrapping.
I have verified the example by applying a schema using Altova and it is both well formed and valid.]
这篇关于DataGridView XML文件帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!