wwxml::ParseXMLToCursor

Low Level Input Method

This method takes the current XML object block and parses it into the currently selected cursor.

o.ParseXMLToCursor(oXMLCursorNode)

logical

Parameters

oXMLCursorNode
XML DOM node that corresponds to the cursor's root in the XML document (in Bold below).



****  
  
       
       
   

****  
  
       
       
   


To select the first node you'd use

lcXML = ... your cursor xml string

oDOM = CREATEOBJECT("Microsoft.XMLDOM")
oDOM.LoadXML(lcXML)  

loCursor = oDOM.SelectSingleNode("/docroot/cursor1")

SELECT Import
oXML.ParseXMLToCursor(loCursor)

Remarks

This method requires the IE 5 MSXML DOM parser.

Example

  • ** This example demonstrates importing multiple cursors stored

  • ** in a single XML document

  • ** XML structure

0111 SID000211 0112 SID001221 ... 0111 Strahl Rick 0112 Egger Markus ...

loXML = CREATE("wwXML") lcXML = loXML.LoadUrl("http://localhost/wconnect/somemulticursorXML.wwd")

  • ** Tables HAVE TO pre-exist in multi-cursor situations SELECT 0 CREATE CURSOR cService (ID c(8), serviceid c(8)) SELECT 0 CREATE CURSOR cPatients (ID c(8), fname c(15), lname c(20))

  • ** MSXML DOM Parser must be used oDOM = CREATEOBJECT("Microsoft.XmlDom")

  • ** Load the XML into the DOM oDOM.LoadXml(lcXML)

  • ** Select the Cursor level node loDOMCursor = oDOM.SelectSingleNode("/cursordemo/cservice") IF ISNULL(loDOMCursor) WAIT window "Node not found" RETURN ENDIF

SELECT cService

  • ** Start parsing from the cursor node into the open cursor oXML.ParseXMLToCursor(loDOMCursor) BROWSE LAST TITLE "Service Records"

loDOMCursor = oIEDOM.SelectSingleNode("/cursordemo/cpatients") IF ISNULL(loDOMCursor) WAIT window "Node not found" RETURN ENDIF

SELECT cPatients oXml.ParseXmlToCursor(loDOMCursor) BROWSE LAST TITLE "Patients"

See also

Class wwXML (High Level Methods)

© West Wind Technologies, 2025 • Updated: 2025-03-12
Comment or report problem with topic