Quantcast
Channel:
Viewing all articles
Browse latest Browse all 43909

Forum Post: Accessing XML Files In WinForms App

$
0
0
Hi could anyone point me in the right direction as I'm trying to read an XML document into a Windows Forms application with little success? I currently have the following code (which gives compilation errors)-   working-storage section. 01  reader                type System.Xml.XmlTextReader . 01  nodetype              type System.Xml.XmlNodeType . method-id cmdProcess_Click final private . procedure division using by value sender as object e as type System.EventArgs .       set reader to type XmlTextReader :: New ( openFileDialog1 :: FileName ).     perform until ( reader :: EOF ())        invoke reader :: Read ()         Evaluate reader :: NodeType                   When nodetype :: Element                        do some processing                  When nodetype :: Text                       do some processing                      When nodetype :: EndElement                       do some processing              When Other                       do some processing          End-Evaluate       end-perform   Compilation errors are COBCH0888 Illegal comparison for this type COBCH0829 Could not find method 'Element' with this signature ditto for Text & EndElement    Any help much appreciated Nigel P Richardson             end method . method-id cmdProcess_Click final private .        procedure division using by value sender as object e as type System.EventArgs .                   set reader to type XmlTextReader :: New ( openFileDialog1 :: FileName ).                       perform until ( reader :: EOF ())               invoke reader :: Read ()                             Evaluate reader :: NodeType                        When nodetype :: Element                            Display "Process Element" upon console                        When nodetype :: Text                           display "Process Text" upon console                        When nodetype :: EndElement                           display "pROCESS End Element" upon console               End-Evaluate                           end-perform                    end method .

Viewing all articles
Browse latest Browse all 43909

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>