在加密或解密数据时如何在xml中插入空null [英] how to insert empty null in xml while encrypting or decrypting the data

查看:64
本文介绍了在加密或解密数据时如何在xml中插入空null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,这里我想知道如何在xml中插入空值,数据类型为ineger.如果它是字符串,则不成问题.但是在进行合并时,xml模式不会返回空值

示例:


桌子
empid> 423课程名称>政治软件管理文凭<主题名称>政治科学,SharePoint,超级主题,超级主题
持续时间> 2状态>未完成

但是现在我希望xml应该是


Dear Friends Here i want to know how to insert null values in xml,Datatype is ineger.If it is string not a problem.But while comes to interger the xml schema not returning null values

Example:


table
empid>423 coursename>Diploma In Political Software Management <subjectname>Political Science,SharePoint,Super Subject,Power Subject
duration>2 status>Not Completed

But now i want xml should be


<table>
    empid />
    coursename>Diploma In Political Software Management
    subjectname>Political Science,SharePoint,Super Subject,Power Subject
    uration>2
    tatus>Not Completed
 </table>



该emp id应该显示为空

请更正它.



That emp id should display empty

please rectify it......

推荐答案

您可以发明任何表示null的自定义方式,但是有一种标准方式.使用以下模式进行描述:
http://www.w3.org/2001/XMLSchema-instance [type",noNamespaceSchemaLocation,"schemaLocation"和"noNamespaceSchemaLocation".
您应该使用i:nil="true"表示null(其中i是引用上面显示的名称空间的某些名称空间前缀,它可以是任何唯一的有效标识符).

有关用法的一些示例,您可以了解数据合约的工作原理,更确切地说是System.Runtime.Serialization.DataContractSerializer.它可以序列化由合同定义的任何对象图,其中的任何成员包括null;空值表示为上面显示的内容.您可以尝试使用它来查看其工作原理.请参阅:
http://msdn.microsoft.com/en-us/library/ms733127.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system. runtime.serialization.datacontractserializer.aspx [ ^ ].

—SA
You can invent any custom ways of representing null, but there is a standard way. It is described with this schema:
http://www.w3.org/2001/XMLSchema-instance[^].

Please take a look. Basically, it describes just 4 attributes: "type", noNamespaceSchemaLocation, "schemaLocation" and "noNamespaceSchemaLocation".

You should use i:nil="true" to express null (where i is some namespace prefix referencing the namespace shown above, it can be any unique valid identifier).

For some example of the usage, you can see how Data Contract works, more exactly System.Runtime.Serialization.DataContractSerializer. It can serialize any object graph defined by a contract, with any members including null; and the null is expressed as I''ve shown above. You can try using it to see how it works. Please see:
http://msdn.microsoft.com/en-us/library/ms733127.aspx[^],
http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractserializer.aspx[^].

—SA


这篇关于在加密或解密数据时如何在xml中插入空null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆