在VB.NET中扫描XML数据项
我有一些XML数据需要检查,以便传递到我正在构建的VB.NET表单。下面是XML文档的示例在VB.NET中扫描XML数据项,xml,vb.net,Xml,Vb.net,我有一些XML数据需要检查,以便传递到我正在构建的VB.NET表单。下面是XML文档的示例 <icIntegrationConfiguration> <icServer hostname="icserver" username="icadmin" password="1234" useNtAuth="false"/> <lyncFarm ucmaAppId="InteractionCenterLyncIntegrationService" ucmaUserAge
<icIntegrationConfiguration>
<icServer hostname="icserver" username="icadmin" password="1234" useNtAuth="false"/>
<lyncFarm ucmaAppId="InteractionCenterLyncIntegrationService" ucmaUserAgent="icUcmaUser" ucmaAppName="InteractionCenterLyncIntegrationService" ucmaVersion="3"/>
<profiles>
<!-- Enterprise Voice synchronizes only if an Interaction Center client is logged in. -->
<profile scope="Global" qualifier="EnterpriseVoice">
<augmentationConfigurations>
<augmentationConfiguration name="Default" order="1" enableIcToLyncSync="true" enableLyncToIcSync="true" addInQueueText="true">
<conditions>
<condition name="UserState">
<qualifications>
<qualification argument="LoggedInToClient" value="True"/>
</qualifications>
</condition>
<condition name="UserType">
<qualifications>
<qualification argument="EnterpriseVoice" value="True"/>
</qualifications>
</condition>
</conditions>
<presenceMap>
<presenceMapping icStatus="Available" lyncPresenceFromIc="3500" direction="TwoWay"/>
<presenceMapping icStatus="Available, Follow-Me" lyncPresenceFromIc="3500" direction="TwoWay"/>
<presenceMapping icStatus="Available, Forward" lyncPresenceFromIc="3500" direction="TwoWay"/>
<presenceMapping icStatus="Available, No ACD" lyncPresenceFromIc="3500" direction="TwoWay"/>
非常感谢您的提示。以下是语法,请尝试
Dim Nodes As XmlNodeList = YourXMLDocument.DocumentElement.SelectNodes("/ParentNode/ChildNode")
For Each node As XmlNode In Nodes
If node.Attributes("YourNodeName").Value = Something
Do stuff
End if
Next
您可以在节点中循环。为每个循环使用一个。没有现成的语法,但它会像每一个ND在类型感谢这一点。我要试一试。我对XML术语不太熟悉,原因是什么?
Dim Nodes As XmlNodeList = YourXMLDocument.DocumentElement.SelectNodes("/ParentNode/ChildNode")
For Each node As XmlNode In Nodes
If node.Attributes("YourNodeName").Value = Something
Do stuff
End if
Next