Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to parse output of XmlListener?
Message
From
13/11/2006 08:55:22
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01169021
Message ID:
01169135
Views:
12
>>I am trying to use the output file created by XmlListener. I believe the schema is described in the VFP 9 help topic "Using VFP Report Output XML".
>>
>>I feel silly to ask, but how do I go about it? Since I will have to do with all the information in the file, not just a few bits, can I create cursors from the XML data? XMLTOCURSOR wouldn't work here, I presume.
>
>What are you trying to acomplish?

I am trying to obtain information to prepare an Excel sheet without creating a new listener class.

>>As long as I have your attention, what is the recommended way to extract data from xml othern than XMLtocursor?
>
>
>You can use XmaAdapter or MSXML (XMLDom or SAX).

Thank you very much, Sergey. My problem is "lack of ignorance" :) I have no idea how to use XMLDom or SAX.

I am trying the following code, which caused the error mentioned at the end:
loReportListener = NEWOBJECT('XmlDisplayListener', '_REPORTLISTENER.vcx')
loReportListener.targetfilename = 'xxx.xml'
loReportListener.QuietMode = .T.

REPORT FORM (tcReport) OBJECT loReportListener

loXMLadapter = NEWOBJECT('xmladapter') 
loXMLAdapter.XMLSchemaLocation='path\xmllistenerschema.xsd'  && Schema from "Using VFP Report Output XML" in help
lcXml = FILETOSTR(loReportListener.targetfilename)
loXMLAdapter.LoadXML(lcXml)   && Caused error below
loXMLAdapter.Tables.Item(1).ToCursor()
Error #1435 in Frx2excel_xmllistener line 32
"loXMLAdapter.LoadXML(lcXml)"
msxml4.dll : file:///c:/vpay931/contab/sosa/xmllistenerschema.xsd#/schema[1]/group[position() = 2 and @name = 'GroupedBands']/sequence[1]
The 'minOccurs' attribute is not supported in this context.
Previous
Reply
Map
View

Click here to load this message in the networking platform