是否有一个XmlEncode / XmlDecode for .NET? [英] Is there an XmlEncode / XmlDecode for .NET?

查看:157
本文介绍了是否有一个XmlEncode / XmlDecode for .NET?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在.NET中是否使用编码解码 XML 的方法?我似乎找不到他们,并且想知道为什么他们不在那里,而是使用什么?



我需要对一个XML文档进行编码并将其传递给Web服务上的字符串参数。

解决方案

如果您是指XML名称的编码/解码,则有 XmlConvert.EncodeName DecodeName


$ b或者您正在谈论使用 XmlDeclaration XDeclaration ? (我以为这是照顾了 encoding < a>为我们)


Are there methods for encoding and decoding XML in .NET? I can't seem to find them and am wondering why they aren't there and what to use instead?

I need to encode an XML document and pass it through to a string parameter on a web service. It then needs to be decoded at the other end.

解决方案

If you are referring to encoding/decoding of XML names, there is XmlConvert.EncodeName and DecodeName.

Or are you talking about specifying the encoding/decoding of the whole XML document using XmlDeclaration or XDeclaration? (I thought this took care of encoding for us)

这篇关于是否有一个XmlEncode / XmlDecode for .NET?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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