Thank you very much

I tried it and can read it, though it does not give me the field names. I 
guess I will have to interpret the output.

One question, ¿is there a limit to the number of records the xml can have? 
What I mean is this:

the xml I get is the result of filling up a sales order, by reading the 
items code directly from the shelf, saving in the data collector's memory 
the item bar code and the quantity picked, as per the order.

I need to get two fields (item with the bar code for the item) and quantity 
(with the quantity picked) That is what the xml I get from the collector 
will contain.

I the order has, say 100 items, the xml I'll get will be rather large. The 
question is, ¿does the string I get have a limit? Because if there is a 
limit, I will have to do additional work to break the xml into several parts 
( a real PITA !!! )

BTW, I understand that the xmladapter class can also read this, but, I never 
really used it, except to create an xml variable from a vfp table, as in 
this example:

local oXML
use mytable
oXML = Createobject("XMLAdapter")
oXML.AddTableSchema('mytable')
oXML.ToXML("cXML")

do form myform with 'cXML'

the above is then read with XMLTOCURSOR, in myform, as follows:

**init event

lparameter tcXML

xmltocursor(tcXML,'mycursor',4)

How can I use the XMLAdapter class to read the xml file, so as not to use 
the dom example you so kindly provided?

Any others can help me?

Rafael



----- Original Message ----- 
From: Bill Arnold
To: [EMAIL PROTECTED]
Sent: Saturday, June 09, 2007 5:28 AM
Subject: RE: xmltocursor



Rafael,

The MSXML parser might be what you want. Below I've pasted a prg I had
found a while back to test with (but then switched to using VFP commands
for the limited case I needed to work with).

For the current version of the parser, search the MS website for MSXML.


Bill


*           This is a simple example that shows how to return values
from an XML
*           document using Microsoft Visual FoxPro.
*
*
*           MORE INFORMATION
*           This example uses the Microsoft XML (MSXML) parser to move
data from
*           an XML document to a FoxPro table. The parser is available
at:
*             http://msdn.microsoft.com/xml/default.asp
*           NOTE: The Microsoft XML parser is not yet a released
product.
*
*           The following code creates the Microsoft MSXML ActiveX
object to
*           accesses information contained in an XML document and
displays it:
*             Install the MSXML parser.
*
*
*             Create the XML document by copying the sample XML code
below to a
*             text file and name the file with the extension .
*
*
*             Create a FoxPro program file with the following code and
run the
*             program:
*

PUBLIC oXML


oXML=CREATEOBJECT('msxml.domdocument')  && This creates the parser
object
oXML.LOAD("myxmldoc.xml")   && This gets and loads
the XML document.

*** The following gives the basename / RootElemant of the XML document ?
oXml.DocumentElement.Basename

*** The following gives the number of nodes (or records)
? oXML.documentelement.childnodes.LENGTH

*** REMEMBER that the object model is in base zero.
*** Therefore use the following in looping expressions
? oXML.documentelement.childnodes.LENGTH - 1

*** The following returns the number of child nodes contained under
*    the first Item
*** This is useful for looping through a childes elements
*** FOR ichild = 0
*    TO oXML.documentelement.childnodes.ITEM(0).childnodes.LENGTH - 1

? oXML.documentelement.childnodes.ITEM(0).childnodes.LENGTH - 1

*** The following returns the nodename of the childnode
* oxml.documentelement.childnodes.item(0).childnodes(0).nodename
? oxml.documentelement.childnodes.item(0).childnodes(1).nodename

* oxml.documentelement.childnodes.item(1).childnodes(0).nodename
? oxml.documentelement.childnodes.item(1).childnodes(1).nodename

* oxml.documentelement.childnodes.item(2).childnodes(0).nodename
? oxml.documentelement.childnodes.item(2).childnodes(1).nodename

*** The following returns the data contained in the childnode
? oXML.documentelement.childnodes.ITEM(0).childnodes(0).TEXT

*** Returns a string of all the data contained in the second child /
record ? oXml.documentelement.childnodes.item(1).nodetypedvalue
? oXml.documentelement.childnodes.item(2).nodetypedvalue
? oXml.documentelement.childnodes.item(3).nodetypedvalue
? oXml.documentelement.childnodes.item(4).nodetypedvalue
? oXml.documentelement.childnodes.item(5).nodetypedvalue
? oXml.documentelement.childnodes.item(6).nodetypedvalue
? oXml.documentelement.childnodes.item(7).nodetypedvalue



[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to