注释掉xml节点 [英] comment out an xml node
本文介绍了注释掉xml节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图注释掉一个xml节点,但不确定如何。
我能够改变它节点内的属性。
XML格式为:
Hi,
I am trying to comment out an xml node but not sure how to.
I am able to change the attributes inside the node.
The XML format is:
<Main>
<Services>
<Service name="01">
<Uses>
<Use type="front">
<Member name="01"/>
</Use>
</Uses>
</Service>
</Services>
<Adaptors>
<Adaptor name="cash" start="true"/>
</Adaptors>
</Main>
我想做的是用cash这个名称注释掉适配器。
有什么想法吗?
从下面的评论复制的其他信息
抱歉,不要我认为我的问题很清楚。
我正在使用vb.net。
我将xml文件作为新的XmlDocument加载。
我正在执行以下操作:
What I would like to do is to comment out the adaptor with the name "cash".
Any ideas?
Additional information copied from comment below
Sorry, don''t think my question was very clear.
I am using vb.net.
Im loading the xml file as a new XmlDocument.
I am then doing the following:
attr = MyXML.SelectSingleNode("/Main/Adaptors/Adaptor[@name='cash']")
能够使用vb.net?
Am able to comment the node using vb.net?
推荐答案
评论节点使用标准注释字符。 例如,如果你要注释掉适配器节点,
Use the standard comment characters. For example, if you want to comment out the ''Adapters'' node,
<Main>
<Services>
<Service name="01">
<Uses>
<Use type="front">
<Member name="01"/>
</Use>
</Uses>
</Service>
</Services>
<Adaptors>
<!-- <Adaptor name="cash" start="true"/> -->
</Adaptors>
</Main>
这篇关于注释掉xml节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文