XML结束标记

编程入门 行业动态 更新时间:2024-10-23 15:25:42
本文介绍了XML结束标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有这样的问题。我正在创建一个XML文档,当没有值avalaible => 1时,我需要有以下两种形式:<参数/> 2.<参数> < /参数> 在一种情况下,我需要第一种,在某些情况下我需要第二种。我应该如何填充该xml元素的值,以便获得第二种类型?我正在尝试string.empty或"""但是它仍然是第一个类型返回给我的是提前谢谢。

解决方案

这两种形式在语义上是等价的,所以对所有形式都无关紧要XML解析器。 如果你真的需要获得第二种类型,你可以参考这篇文章找到解决方案:social.msdn.microsoft/Forums/en-US/xmlandnetfx/thread/3a04e78b-3663-4b50-b4e4- 0b05a7633a06 。

Hi, I have this kind of problem. I am creating an XML document and I need to have following two forms, when there is no value avalaible => 1. <Parameter /> 2. <Parameter></Parameter> In one case I need first one and under certain circumstances i need second one. How should I fill the value of that xml element, so I will get second type? I was trying string.empty or "" but it still returned me first type Thanks in advance.

解决方案

The two forms are semantically equivalent, so it does not matter for all XML parsers.In case you really need to get the second type, you can refer to this post for the solution: social.msdn.microsoft/Forums/en-US/xmlandnetfx/thread/3a04e78b-3663-4b50-b4e4-0b05a7633a06.

更多推荐

XML结束标记

本文发布于:2023-11-12 12:37:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581512.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:标记   结束   XML

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!