none
How do I add node values from one document to another? RRS feed

  • Question

  • I am really stuck on this one. I have ObjXmlSimpleTypeDoc object which have two EnumerationValues. Each of EnumerationValue have child nodes.

    I want to got values from child nodes of the correct EnumerationValue node.

    To find the correct EnumerationValue I use the value in the variable strCourtNCIC. If the value in strCourtNCIC matches a EnumerationValue @code, that is the EnumerationValue I need. For this question strCourtNCIC hold a value MN010015J. 

    How do I do this in VB.NET? 

    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">
    			<Text>111</Text>
    		</AssociatedValue>
    		<AssociatedValue type="CountyName">
    			<Text>Emily</Text>
    		</AssociatedValue>
    		<AssociatedValue type="PhoneNumber">
    			<Text>724-820-7123</Text>
    		</AssociatedValue>
    	</EnumerationValue>
    	<EnumerationValue code="DC19DAKDC">
    		<Text>Pope County</Text>
    		<AssociatedValue type="MNCISNodeID">
    			<Text>112</Text>
    		</AssociatedValue>
    		<AssociatedValue type="CountyName">
    			<Text>Pope</Text>
    		</AssociatedValue>
    	</EnumerationValue>
    </SimpleTypeCompanion>

    Here is the VB.NET code that I need help with to just get the correct EnumerationValue that matches strCourtNCIC (MN010015J).

    'CourtNCIC 
    
    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")
    




    • Edited by winkimjr2 Monday, August 12, 2019 3:53 PM
    Sunday, August 4, 2019 7:24 PM

All replies

  • Solution

    objXmlEnumerationValueNode = objXmlSimpleTypeDoc.SelectSingleNode("/SimpleTypeCompanion/EnumerationValue[@code='" + strCourtORI + "']")

    Tuesday, August 13, 2019 4:21 PM