阅读 90

XSLT Transformation XML to JSON D365FO Data Management

Recently i was exploring an option for Transformation in Data Management framework, we do have this option of transforming the export file in different format than the default one. One more thing that triggers, D365fo doesn’t export JSON by default. However, it does export XML file format. After some research I found this XSLT code that transformed XML to JSON. 

   
   
        
        
           {  
             
           }  
        
        
             
                  
                            
                     ]  
                     ,   
                  
                  
                            
                          ,   
                  
                  
                     "" : [  
                          ,    
                  
                  
                     "" :   
                     ,   
                  
                  
                     "" : ""  
                     ,   
                  
             
        
        
           {  
                  
                ,   
                  
                  
                     "" : ""  
                  
                  
                     "text" : ""  
                  
           }  
           ,   
        
        
           "" : ""  
           ,  
        
        
             
             
                  
                  
                       
                       
                            
                       
                  
             
        
   

so now with the help of transformation we can convert default xml export file to json format during data management export process. Under the Data management workspace, open the Source data format form. Create new record called JSON and set the default extension to json.

  • File format = XML
  • XML Style = Attribute
  • Root element = Document (I left this as default)

Now click on the View map icon.Create a new Export and select your entity. In the Source data format, select JSON record that was created in the previous step.In the mapping form, click on the Transformations tab. Then upload the file you downloaded from the github. Once we click export on data management project, it applies the transformation and you will get a JSON file like this. This works very nicely and no development or extra transformation at the target.This is interesting because we can build different types of integrations like sending purchase order confirmation as Json export to file share.

原文:https://www.cnblogs.com/lingdanglfw/p/15202608.html

文章分类
代码人生
版权声明:本站是系统测试站点,无实际运营。本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 XXXXXXo@163.com 举报,一经查实,本站将立刻删除。
相关推荐