I am using VB6.0(Sorry the system needs that) to write a xml template. But I can not add xsi:schemeLocation = "If I add : inside, then the report can not be generated, I can only get xsischemeLocation
What I should do.
My codes:
Dim objDom As DOMDocument
Dim objopsReports As IXMLDOMElement
Set objopsReports = objDom.createElement("opsReports")
objDom.appendChild objopsReports
Dim objopsReportsAttribute1 As IXMLDOMAttribute
Dim opsReportName As String
Dim specialSignal As String
specialSignal = ":"
opsReportName = "xsi" & specialSignal & "schemaLocation"
Dim opsReportURL As String
opsReportURL = " ../obj_opsReport.xsd"
Set objopsReportsAttribute1 = objDom.createAttribute(opsReportName)
objopsReports.Attributes.setNamedItem objopsReportsAttribute1
objopsReportsAttribute1.Value = opsReportURL
Dim objopsReportsAttribute2 As IXMLDOMAttribute
Dim opsReportName2 As String
opsReportName2 = "version"
Dim opsReportVersion As String
opsReportVersion = "1.3.1.1"
Set objopsReportsAttribute2 = objDom.createAttribute(opsReportName2)
objopsReports.Attributes.setNamedItem objopsReportsAttribute2
objopsReportsAttribute2.Value = opsReportVersion
Highly appreciated your help
What I should do.
My codes:
Dim objDom As DOMDocument
Dim objopsReports As IXMLDOMElement
Set objopsReports = objDom.createElement("opsReports")
objDom.appendChild objopsReports
Dim objopsReportsAttribute1 As IXMLDOMAttribute
Dim opsReportName As String
Dim specialSignal As String
specialSignal = ":"
opsReportName = "xsi" & specialSignal & "schemaLocation"
Dim opsReportURL As String
opsReportURL = " ../obj_opsReport.xsd"
Set objopsReportsAttribute1 = objDom.createAttribute(opsReportName)
objopsReports.Attributes.setNamedItem objopsReportsAttribute1
objopsReportsAttribute1.Value = opsReportURL
Dim objopsReportsAttribute2 As IXMLDOMAttribute
Dim opsReportName2 As String
opsReportName2 = "version"
Dim opsReportVersion As String
opsReportVersion = "1.3.1.1"
Set objopsReportsAttribute2 = objDom.createAttribute(opsReportName2)
objopsReports.Attributes.setNamedItem objopsReportsAttribute2
objopsReportsAttribute2.Value = opsReportVersion
Highly appreciated your help