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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML Parsing/Creation & VB6

Status
Not open for further replies.

dhealy

Programmer
Mar 1, 2001
7
0
0
CH
Here is a description of the system I am building:

i.) XML file sent by means of a CGI request to Apache
ii.) Apache calls VB program to parse XML file
iii.) Date interpreted and sent via serial port to device
iv.) Device responds to serial port with data
v.) Data recevied interpreted and XML file created
vi.) XML file sent returned to Apache and sent to client

Is this possible? What would I use to interpret/create the XML file -> MSXML? When the data is received from the serial port, can it be held in a text file that MSXML can interpret, using the DOM? Would it be easier to implement in C++? Any help is appreciated!

Thanks,
Dennis.
 
Dennis,

What a delightfully clear and concise post. Tek-Tips should put it on a flag and hang it from an E-Flag Pole :)

> Is this possible?

Absolutely. Have you been introduced to the SOAP standard yet? If not, it sounds like you should check it out.

> What would I use to interpret/create the XML file -> MSXML?

From inside of VB-code, yes that is probably your simplest solution, however there are other techniques you could use.

> When the data is received from the serial port, can it be held in
> a text file that MSXML can interpret, using the DOM?

First, the DOM can only interpret XML so... if the device is sending XML to the serial port then yes. If the device is sending data in a proprietary format then you will need code to transform it into XML so the DOM can process it. Actually you can use the DOM interfaces to create the XML nodes from the proprietary data.

Second, if the device is sending XML data to the serial port then you do not need to write it to disk. The MSXML control exposes an interface that can accept an in memory string of XML.

Hope this helps
-pete
 
Pete,

> Absolutely. Have you been introduced to the SOAP standard
> yet? If not, it sounds like you should check it out.

Thanks for your quick reply! It's funny that you mention SOAP, because this will be the next phase of our project, however, the immediate future sees us using CGI..

> First, the DOM can only interpret XML so... if the device
> is sending XML to the serial port then yes. If the device
> is sending data in a proprietary format then you will
> need code to transform it into XML so the DOM can process

The information being sent/received through the serial port will be strings, which tell the device what to do. Eventually, these devices will be able to handle XML data, but in the interim, strings will be used. Can you point me to some sample code that uses the DOM to translate a text file into XML or vice versa? We will have another XML file to cross reference the sent/received strings for the device, so I would need to see an example of DOM usage that cross-references a text file with an XML file.

Thanks for your help!

Regards,
Dennis.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top