Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to write xsi:schemeLocation = "http://www....." in xml

Status
Not open for further replies.

tian88129

Programmer
Feb 3, 2009
1
US
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
 
I am not sure you've instantiated the objDom in the first place. But that is in conflict with the problem you described as having.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top