In my visual basic code, I have an object (objXmlCaseDoc) containing xml document. I want to add a variable (strPoNumber) into this object at the beginning of the xml document.
I would like to add the code for the variable where I have a comment in vb code which says 'Tranform case information into the output format
After adding the strPoNumber my object objXmlCaseDoc first line of the xml output should look like this:

 <Integration xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tsg="http://tsgweb.com" xmlns:IXML="http://tsgweb.com" xmlns:CMCodeQueryHelper="urn:CMCodeQueryHelper" protectionOrderNumber="1400042">

VB code

 Option Strict On
    Option Explicit On
    Imports System.Xml
    Public Class BcaPoRequests
        Shared Sub Main()
            Dim objMessageProcessor As New MessageProcessor
            Dim objSchemasCollection As New Msc.Integration.MessageBroker.Library.v4.SchemasCollection
            Dim objTransformsCollection As New Msc.Integration.MessageBroker.Library.v4.TransformsCollection
            objMessageProcessor.ProcessInputQueue(False, False, objSchemasCollection, objTransformsCollection)
        End Sub
        Private Class MessageProcessor
            Inherits Msc.Integration.ServiceCatalog.Library.v4.SoapMessageProcessor
            Protected Overrides Sub ProcessMessage(ByRef aobjBroker As ServiceCatalog.Library.v4.Broker, ByRef aobjXMLInputSoapEnvelopeDoc As System.Xml.XmlDocument, ByRef aobjInstantiatedObjectsCstrollection As Microsoft.VisualBasic.Collection, ByRef aobjConsumer As ServiceCatalog.Library.v4.Consumer)
                MyBase.ProcessMessage(aobjBroker, aobjXMLInputSoapEnvelopeDoc, aobjInstantiatedObjectsCollection, aobjConsumer)

                Dim objXmlMessageDoc As XmlDocument
                Dim objXmlMessageNode As XmlNode
                Dim objNameTable As NameTable
                Dim objXMLNameSpaceManager As XmlNamespaceManager
                Dim objXMLSchemaException As Xml.Schema.XmlSchemaException
                Dim strCaseNumber As String
                Dim strPoNumber As String
                Dim objXmlCaseDoc As XmlDocument

                'create a namespace manager used for queries into inputmessage (because of namespace)
                objNameTable = New NameTable
                objXMLNameSpaceManager = New XmlNamespaceManager(objNameTable)
                objXMLNameSpaceManager.AddNamespace("ext", "http://www.courts.state.mn.us/ProtectionOrderExtension/1.0")
                objXMLNameSpaceManager.AddNamespace("exc", "http://www.courts.state.mn.us/ProtectionOrderQuery/1.0")
                objXMLNameSpaceManager.AddNamespace("soap", "http://www.w3.org/2003/05/soap-envelope")
                objXMLNameSpaceManager.AddNamespace("wsa", "http://schemas.xmlsoap.org/ws/2004/08/addressing")

                objXmlMessageNode = aobjXMLInputSoapEnvelopeDoc.DocumentElement.SelectSingleNode("soap:Body/exc:ProtectionOrderQueryRequest", objXMLNameSpaceManager)
                objXmlMessageDoc = New XmlDocument

                objXmlMessageDoc.LoadXml(objXmlMessageNode.OuterXml)

                'Check authorization

                'Validate the input message
                objXMLSchemaException = aobjBroker.ValidateXmlDocument(objXmlMessageDoc, "ProtectionOrderQuery_1_0.xsd", "NiemExchanges\ProtectionOrders\Exchange", , False)

                If Not objXMLSchemaException Is Nothing Then
                    'return fault if invalid
                    aobjBroker.Reply(aobjBroker.CreateSoapFault(Msc.Integration.Utility.Library.v4.Soap.udtSoapCodes.Sender, Msc.Integration.Utility.Library.v4.Xml.FormatXmlSchemaValidationErrorText(objXMLSchemaException), Msc.Integration.Utility.Library.v4.Soap.udtSoapRoles.RoleUltimateReceiver, aobjXMLInputSoapEnvelopeDoc, "soap:InvalidMessage", "soap:Body", Msc.Integration.Utility.Library.v4.Soap.GetReplyEndpointReference(aobjXMLInputSoapEnvelopeDoc), aobjXMLInputSoapEnvelopeDoc.DocumentElement.SelectSingleNode("soap:Header/wsa:MessageID", objXMLNameSpaceManager).InnerText, aobjConsumer))
                    Exit Sub
                End If

                'Get the case number and the PO number from the input message
                strCaseNumber = objXmlMessageDoc.DocumentElement.SelectSingleNode("ext:CourtFileNumber", objXMLNameSpaceManager).InnerText
                strPoNumber = objXmlMessageDoc.DocumentElement.SelectSingleNode("ext:ProtectionOrderID", objXMLNameSpaceManager).InnerText


                'Get the case information from Mncis

                'Code for calling the case
                objXmlCaseDoc = Msc.Integration.Mncis.Library.v4.Case.GetIxmlForCaseNumber(strCaseNumber, "CourtCaseHeader,ProtectionOrder,SubjectParties,HearingTrialSetting", False)

                'Tranform case information into the output format
            End Sub
        End Class
    End Class

I resolved this by adding this to my vb code:

 objXmlCaseDoc.DocumentElement.SetAttribute("protectionOrderID", strPoNumber)

How do I run my xslt using vb? I want to add code so it can run the code (xml) found in the objXmlCaseDoc

This article has been dead for over six months. Start a new discussion instead.