XML Parsing in rpgle using Data Structure

Source Code to parse all xml tag at once using a data structure







**Free                                                    
       DCL-S  FileName Varchar(500) INZ;                  
       DCL-S  Options varchar(500) INZ;                   
                                                          
       Dcl-ds ChannelInfo qualified;                      
             Name varchar(50);                            
             Email varchar(50);                           
             Blog varchar(50);                            
             Courses varchar (50);                        
       End-ds;                                            
                                                          
       FileName = '/home/SHARMIT/TechSharmit/Data.xml';   
                                                          
       options = 'case=any doc=file ';                    
                                                          
       xml-into ChannelInfo %xml(FileName:options);       
                                                          
       DSPLY ChannelInfo.Name;                            
       DSPLY ChannelInfo.Email;        

       DSPLY ChannelInfo.Blog;     
       DSPLY ChannelInfo.Courses;  
       *INLR = *on;                            

Thanks for reading

Please watch the video given below for the same topic.


Subscribe Tech Sharmit for more videos on RPGLE 






Comments

Popular posts from this blog

Dynamic XMl file creation in IFS using RPGLE Program - IBMI / AS400

Compile Time Data Array in RPGLE - IBM i / AS400

Numeric Data type in RPGLE free format - IBM i / AS400