Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Wrox Announcements and Feedback > Forum and Wrox.com Feedback
Forum and Wrox.com Feedback Post your suggestions for improving the Forums or Wrox.com or questions for the staff here. "Where can I find the code for my book?"
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Forum and Wrox.com Feedback section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 12th, 2019, 01:14 PM
Friend of Wrox
Join Date: Apr 2013
Posts: 101
Thanks: 14
Thanked 0 Times in 0 Posts
Default How do I find the correct node among many nodes that matches value in strcourt

I am really stuck on this one even though it seems like what I want is simple.
I have ObjXmlSimpleTypeDoc object which have two EnumerationValue nodes. Each of EnumerationValue have child nodes.

I want to find the correct EnumerationValue. To find the correct EnumerationValue node, I use a variable strCourtNCIC. If the value in strCourtNCIC (in this case MN010015J. This value can be some other value) matches a EnumerationValue@code, that is the EnumerationValue node I need.
For this question strCourtNCIC hold a value MN010015J.

How do I do this in VB.NET? My VB.NET code returns Nothing for objXmlEnumerationValueNode even though I am expecting to see the node with @code = MN010015J

Here is the objXmlSimpleTypeDoc object where I need to find EnumerationValue with @code = strCourtNCIC (MN010015J)
<SimpleTypeCompanion enumerates="CourtLocationTextType">
	<EnumerationValue code="MN010015J">
		<Text>Emily County</Text>
		<AssociatedValue type="MNCISNodeID">
		<AssociatedValue type="CountyName">
		<AssociatedValue type="PhoneNumber">
	<EnumerationValue code="DC19DAKDC">
		<Text>Pope County</Text>
		<AssociatedValue type="MNCISNodeID">
		<AssociatedValue type="CountyName">
Here is the VB.NET code that I need help with to just get the correct EnumerationValue that matches strCourtNCIC (MN010015J).

strCourtNCIC = objXmlMNCISData.DocumentElement.SelectSingleNode("Case/Court/CourtNCIC").InnerText
'Access the CourtLocationTextType simple type. 
objXmlSimpleTypeDoc = Msc.Integration.CourtXml.Library.v4.SimpleType.GetCompanionFile("CourtLocationTextType")

'Get the correct EnumerationValue node that has @code =MN010015J string value
objXmlEnumerationValueNode = objXmlSimpleTypeDoc.SelectSingleNode("/SimpleTypeCompanion/EnumerationValue[@code=" + strCourtORI + "]/@code")
Reply With Quote

Similar Threads
Thread Thread Starter Forum Replies Last Post
Select nodes whose attribute matches another node's attribute? nikolai XSLT 5 April 18th, 2018 11:30 AM
How to delete node that matches combobox? QuadFather XML 2 April 8th, 2010 08:40 AM
Select correct child node richieWolf XSLT 4 September 24th, 2008 08:53 AM
Select first child node that matches criteria priya81 XSLT 4 July 3rd, 2007 10:32 AM
Select node whose child value matches Fantmx XSLT 5 February 16th, 2007 04:54 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.