如何获取此XML标记? [英] How to get this XML tag?

查看:65
本文介绍了如何获取此XML标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

而不是这种类型的标签:


<文件类型="条件">

< /文件>


我怎样才能得到这个:


< File Type =" Criteria" />


我只需要关闭标签,如果有元素或儿童

插入那里。


谢谢,

Brett

Rather than this type of tag:

<File Type="Criteria">
</File>

How can I get this:

<File Type="Criteria" />

I only need the closing tag if there will be elements or children
inserted there.

Thanks,
Brett

推荐答案

Brett Romero< ac ***** @ cygen。 COM>写道:
Brett Romero <ac*****@cygen.com> wrote:
而不是这种类型的标签:

<文件类型="条件">
< /文件>

我怎样才能得到这个:

< File Type =" Criteria" />

我只需要在那里插入元素或子元件时关闭标签。
Rather than this type of tag:

<File Type="Criteria">
</File>

How can I get this:

<File Type="Criteria" />

I only need the closing tag if there will be elements or children
inserted there.




你能说出来吗?我们更多关于背景?您是否正在尝试阅读

XML,写下来,什么?


-

Jon Skeet - < sk * **@pobox.com>
http://www.pobox.com/ ~Sibet 博客: http://www.msmvps.com/jon。双向飞碟

如果回复小组,请不要给我发邮件



Could you tell us a bit more about the context? Are you trying to read
the XML, write it, what?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too


你是什么意思?你的意思是什么时候保存DOM?两者相当于



" Brett Romero" <交流***** @ cygen.com>在消息中写道

news:11 ********************* @ z14g2000cwz.googlegro ups.com ...
What do you mean? Do you mean when you save the DOM? The two are
equivalent.

"Brett Romero" <ac*****@cygen.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
而不是这种类型的标签:

<文件类型="标准">
< /文件>

我怎样才能获得这个:

<文件类型="标准" />

我只需要在那里插入元素或子元件即可结束标签。

谢谢,
Brett
Rather than this type of tag:

<File Type="Criteria">
</File>

How can I get this:

<File Type="Criteria" />

I only need the closing tag if there will be elements or children
inserted there.

Thanks,
Brett



在C#中,当我创建一个元素时,它总是抛出结束标记,

我不想要。开头标签中的反斜杠是一个快捷方式,

这就是我想要的。


Brett

In C#, when I create an element, it always throws in the closing tag,
which I don''t want. The backslash in the opening tag is a shortcut,
which is what I want.

Brett


这篇关于如何获取此XML标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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