Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BuildCursorFromXML
Message
De
20/05/2003 12:20:32
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
West Wind Web Connection
Titre:
BuildCursorFromXML
Divers
Thread ID:
00790575
Message ID:
00790575
Vues:
49
Wconnect V4.3

I am creating a multi-cursor xml package using a technique similar to the example in the docs. I corrected the typos in the example and am getting an error when re-creating the first cursor.
lotype is not an object
at line: 36 in wwxml.buildcursorfromxml
Code: laFields[lnX,2] = THIS.XMLTypeToFoxType(loType.TEXT)
executing:oXML.BuildCursorFromXml(loPackage,"package")
My test program is:
clear
CLOSE ALL
DO WCONNECT
#INCLUDE WCONNECT.h

CREATE CURSOR package (filename c(20))
INSERT INTO package (filename) VALUES ('sub_cde_bak')
INSERT INTO package (filename) VALUES ('dep_cde_bak')

LOCAL oXML as wwXML
oXML = CREATEOBJECT('wwXML')

*** Generate Package XML and Schema
lcSchema = oXML.CreateDataStructureSchema()	&&"package","package")
lcXML = oXML.CreateCursorXML()	&&"package","package")

*** Generate customer XML and Schema
use DEP_CDE_BAK
lcSchema = lcSchema + oXML.CreateDataStructureSchema("dep_cde_bak","dep_cde_bak")
lcXML = lcXML + oXML.CreateCursorXML("dep_cde_bak","dep_cde_bak")

*** Append banner file XML and schema to each
use SUB_CDE_BAK
lcSchema = lcSchema + oXML.CreateDataStructureSchema("sub_cde_bak","sub_cde_bak")
lcXML = lcXML +  oXML.CreateCursorXML("sub_cde_bak","sub_cde_bak")

*** Now add a header and root document node 
lcXML = oXML.cXMLHeader + "<root>" + CRLF + lcSchema + lcXML + "</root>"

*SHOWXML(lcXML)

STRTOFILE(lcXml,'multixml.xml')

CLOSE DATABASES

WAIT WINDOW 'No we will parse out the files'

LOCAL oDom as MSXML2.DOMDocument, oNode as MSXML2.DOMDocument.XmlNode, nodeList
oDom = CREATEOBJECT("MSXML2.DOMDocument")
oDOM.Async = .F.
oDOM.LoadXML(lcXML)
IF !EMPTY(oDOm.parseError.reason)
  ? oDOm.parseError.reason
  RETURN
ENDIF

loPackage = oDOM.selectSingleNode("//root/package")

IF !ISNULL(loPackage)
   oXML.BuildCursorFromXml(loPackage,"package")
   oXML.ParseXMLToCursor(loPackage)
   BROWSE
ENDIF

return
Please help. I need to package multiple cursors for an important project. I know with VFP there are many ways to accomplish this, but I would rather not use a workaround, but rather use the tools specifically designed for this purpose.

Thanks

Glenn





Répondre
Fil
Voir

Click here to load this message in the networking platform