Kurt,
>...xml parse error and a dutch error message like 'invalid on the highest level of the document'
As Sergey already posted, it could be a missing 512 flag on XMLTOCURSOR() -- if you are feeding the function a filename as the first parameter. However, you can also get that error if you have the XML in a var and put the varname inside quotes.
The error means that XMLTOCURSOR is reading the first parameter as a string and looking for the XML header line and not finding it in the first line. The first parameter should be either:
1) a filename (inside quotes)
2) a literal string containing the xml (inside quotes)
3) the name of a memvar or other expression like a function call, etc that returns XML (NOT INSIDE QUOTES).
CURSORTOXML("test", "cXML", 1, 0, 0, "1")
? cxml
CLOSE DATABASES all
XMLTOCURSOR("cxml", "mytest")
XMLTOCURSOR(cxml, "mytest")
From part of the help file about XMLTOCURSOR's first parameter -- this is for the eExpression option, not the filename option:
eExpression
Specifies the XML text or an expression that evaluates to valid XML data. The eExpression parameter can be a Visual FoxPro memory variable, memo field contents, the return from an HTTP request, the return result from a SOAP method call, XML from the XMLDOM, or an ADO stream.
Note:
XMLCURSOR( ) generates an error if eExpression is not found or if eExpression does not parse to valid XML.