Как создать новый документ со значениями элементов?
Мне нужна помощь, чтобы создать сообщение xml GetCaseInformationResponseMessage ниже из XML-документа objXmlSimpleTypeDoc.
Я пытаюсь найти узел SimpleTypeCompanion/EnumerationValue/@code, который соответствует значению CourtNCIC.
Чтобы получить CourtNCIC, я передаю номер дела методу, который находит номер CourtNCIC.
Вот этот метод
objXmlMNCISData = Library.v4.Case.GetIxmlForCaseNumber(strCaseNumber, "CourtCaseHeaderGroup", False)
- Уберите Кортнсика с объекта
strCourtNCIC = objXmlMNCISData.Функцию documentelement.SelectSingleNode("Case/Court/CourtNCIC").Через свойство innerText
XML, который я хочу создать
<GetCaseInformationResponseMessage> <CourtLocation> <CourtName>McKnight County</CourtName> <ORINumber>MN010015J</ORINumber > <MNCISNodeID>222</MNCISNodeID> <PhoneNumber>800-001-7127</PhoneNumber> </CourtLocation> </GetCaseInformationResponseMessage>
XML-документ objXmlSimpleTypeDoc
<SimpleTypeCompanion enumerates="CourtLocationTextType"> <EnumerationValue code="DC27ZAPPY"> <Text>Zapy County</Text><!--/SimpleTypeCompanion/EnumerationValue[1]/Text--> <AssociatedValue type="MNCISNodeID"> <Text>130</Text> </AssociatedValue> <AssociatedValue type="CountyName"> <Text>Zapy</Text> </AssociatedValue> <AssociatedValue type="JudicialDistrict"> <Text>40th</Text> </AssociatedValue> </EnumerationValue> <EnumerationValue code="MN010015J"><!--/SimpleTypeCompanion/EnumerationValue[2]/@code--> <Text>McKnight County</Text> <AssociatedValue type="MNCISNodeID"> <Text>222</Text> </AssociatedValue> <AssociatedValue type="CountyName"> <Text>Passaic</Text> </AssociatedValue> <AssociatedValue type="JudicialDistrict"> <Text>11st</Text> </AssociatedValue> <AssociatedValue type="PhoneNumber"> <Text>800-001-7127</Text> </AssociatedValue> <AssociatedValue type="FaxNumber"> <Text>800-001-5555</Text> </AssociatedValue> <AssociatedValue type="Street1"> <Text>234 Stension St</Text> </AssociatedValue> <AssociatedValue type="City"> <Text>Spruce</Text> </AssociatedValue> <AssociatedValue type="State"> <Text>WY</Text> </AssociatedValue> <AssociatedValue type="Zip"> <Text>84327</Text> </AssociatedValue> </EnumerationValue> </SimpleTypeCompanion>
Что я уже пробовал:
VB.NET код, который я пробовал
Public Shared Sub ProcessGetCaseInformationRequestMessage(ByRef aobjBroker As ServiceCatalog.Library.v4.Broker, ByRef aobjXmlContentDoc As System.Xml.XmlDocument, ByRef aobjXmlNamespaceManager As System.Xml.XmlNamespaceManager) Dim objXmlMNCISData As XmlDocument Dim strCaseNumber As String Dim strCourtName As String Dim objXmlCourtLocationNode As XmlNode Dim objXmlResponseDoc As XmlDocument Dim strORINumber As String Dim strMNCISNodeID As String Dim strPhoneNumber As String Dim strCourtNCIC As String Dim objXmlSimpleTypeDoc As System.Xml.XmlDocument strCaseNumber = aobjXmlContentDoc.DocumentElement.SelectSingleNode("m:CourtFileNumber", aobjXmlNamespaceManager).InnerText 'Create the response message objXmlResponseDoc = New XmlDocument objXmlResponseDoc.AppendChild(objXmlResponseDoc.CreateElement("GetCaseInformationResponseMessage", aobjXmlNamespaceManager.LookupNamespace("m"))) Try objXmlMNCISData = Library.v4.Case.GetIxmlForCaseNumber(strCaseNumber, "CourtCaseHeaderGroup", False) 'Gets XML with CourtNCIC number 'CourtNCIC strCourtNCIC = objXmlMNCISData.DocumentElement.SelectSingleNode("Case/Court/CourtNCIC").InnerText 'Access the CourtLocationTextType simple type. objXmlSimpleTypeDoc = Msc.Integration.CourtXml.Library.v4.SimpleType.GetCompanionFile("CourtLocationTextType") 'Court location objXmlCourtLocationNode = objXmlResponseDoc.CreateElement("CourtLocation", aobjXmlNamespaceManager.LookupNamespace("m")) 'CourtName objXmlCourtLocationNode.AppendChild(objXmlResponseDoc.CreateElement("CourtName", aobjXmlNamespaceManager.LookupNamespace("m"))) objXmlSimpleTypeDoc.DocumentElement.SelectSingleNode("m:EnumerationValue[@code=" + strCourtNCIC]/Text", aobjXmlNamespaceManager).InnerText = strCourtName 'ORINumber objXmlCourtLocationNode.AppendChild(objXmlResponseDoc.CreateElement("ORINumber", aobjXmlNamespaceManager.LookupNamespace("m"))) objXmlSimpleTypeDoc.DocumentElement.SelectSingleNode("m:CourtName", aobjXmlNamespaceManager).InnerText = strORINumber 'MNCISNode ID SimpleTypeCompanion\EnumerationValue\AssociatedValue\Text objXmlCourtLocationNode.AppendChild(objXmlResponseDoc.CreateElement("CourtName", aobjXmlNamespaceManager.LookupNamespace("m"))) objXmlSimpleTypeDoc.DocumentElement.SelectSingleNode("m:CourtName", aobjXmlNamespaceManager).InnerText = strMNCISNodeID 'PhoneNumber objXmlCourtLocationNode.AppendChild(objXmlResponseDoc.CreateElement("PhoneNumber", aobjXmlNamespaceManager.LookupNamespace("m"))) objXmlSimpleTypeDoc.DocumentElement,SelectSingleNode("m:CourtName", aobjXmlNamespaceManager).InnerText = PhoneNumber End Sub
Maciej Los
Вы должны отправить этот вопрос поставщику "библиотеки"....
Member 11403304
Я задам этот вопрос в более упрощенном виде.