首页 | 本学科首页   官方微博 | 高级检索  
     

利用扩展方法改进LINQ to XML数据读取
引用本文:董宁.利用扩展方法改进LINQ to XML数据读取[J].电脑编程技巧与维护,2012(18):68-69.
作者姓名:董宁
作者单位:武汉软件工程职业学院,武汉,430205
摘    要:在读取XML文件中的数据时经常会碰到数据类型不正确或元素属性不完整的情况。这会导致一系列的问题,如果正在利用序列化数据创建对象,碰到XML文件不完整的话,整个对象将无法创建。讨论了利用扩展方法侦测XML文件中缺失的元素,或属性避免因为部分数据丢失而整个对象都无法创建的情况。

关 键 词:XML  LINQ  to  XML  扩展方法

Improvement of Data Reading in LINQ to XML Using Extension Methods
DONG Ning.Improvement of Data Reading in LINQ to XML Using Extension Methods[J].Computer Programming Skills & Maintenance,2012(18):68-69.
Authors:DONG Ning
Affiliation:DONG Ning (Wuhan Vocational College of Software and Engineering,Wuhan 430205,China)
Abstract:Incorrect data type or incomplete element attribute is often encountered when reading data in XML files.It will lead to a series of problems.When creating objects with serialized data,if XML file is incomplete,the entire object cannot be created.It is issued how to detect the missing element or attribute by using extension methods,in order to avoid the situation that entire object cannot be created because of missing part of data.
Keywords:XML  LINQ to XML  Extension methods
本文献已被 CNKI 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号