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

    • 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