Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

[RESOLVED] Creating XML Files in VBS

$
0
0
Hi,

So I am using vbs to output some stuff to XML, I got most of it figured out except one part. Here is something what my code looks like

Code:

        Dim xmlDoc,objroot,objIntro,objwire,objcable,data
        Set xmlDoc = _
                CreateObject("Microsoft.XMLDOM")
        Set data = _
                xmlDoc.createElement("Data") 
        xmlDoc.appendChild data
               
        Set objwire = _
                xmlDoc.createElement("WireData") 
        data.appendChild objwire
        Set objcable = _
                xmlDoc.createElement("CableData") 
        data.appendChild objcable
        Set objSignal = xmlDoc.createElement("Signal_Name")
                objSignal.Text = SigTab(i)
                objwire.appendChild objSignal

        Set objfromdev = xmlDoc.createElement("From_Device")
                objfromdev.Text = SigTab(i)
                objSignal.appendChild objfromdev
        Set objtodev = xmlDoc.createElement("To_Device")
                objtodev.Text = SigTab(i)
                objSignal.appendChild objtodev

And so on, that gives me an xml file that looks like this

Code:

- <Data>
- <WireData>
- <Signal_Name>
  1L1
  <From_Device>ffffff</From_Device>
  <To_Device>ggggg:1</To_Device>
  <Core_Name>1051</Core_Name>
  <Wire_Colour>BLK</Wire_Colour>
  <Wire_Size>AWG 10</Wire_Size>
  <Wire_Type>rrgr-95</Wire_Type>
  <Routing_Path>U3; U3; U61</Routing_Path>
  <Wire_Length>625</Wire_Length>
  <Completed>No</Completed>
  <Cable_Name>Wires</Cable_Name>
  <Cable_Id>r</Cable_Id>
  <Wire_Number>1051</Wire_Number>
  </Signal_Name>
- <Signal_Name>......................

Everything is perfect with the exception of the Signal Name, I would either like that to be displayed

Code:

<Signal_Name=1L1>
or
Code:

<1L1>
But I cant seem to find anywhere how to go about doing this. When I try the 2nd type, I get the error I am not allowed to have a name starting with '1'

Any help is appreciated. Thanks!

Viewing all articles
Browse latest Browse all 688

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>