在SAP ABAP中解析XML [英] Parsing XML within SAP ABAP

查看:739
本文介绍了在SAP ABAP中解析XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的公司正在研究一个需要在SAP ABAP中读取XML文件的项目。

My company is working on a project that needs to read XML files within SAP ABAP.


  1. 当XML文件中没有用于

  2. 某些标签是自动关闭的。例如< tag />

SAP开发人员说,要读取XML文档,他首先将文档解析为ABAP XML结构。此过程在点2上失败。然后,他必须创建XSLT将该数据转换为内部数据结构,并且在点1上失败,因此使该任务在ABAP中很难实现。
确实是这种情况,然后没有办法读取我们需要的特定字段吗?

The SAP developer says that to read the XML document he first parses the document into an ABAP XML structure. This process fails on point 2. He must then create an XSLT to turn that data into an internal data structure, and that fails on point 1 therefore making the task very difficult to achieve within ABAP. Is that definitely the case and is there then no way of reading the specific fields that we need?

推荐答案

在ABAP中开始XML解析的最佳位置是 SAP XML库

The best place to start with XML parsing in ABAP is the SAP XML Library.

尝试编写自己的解析算法可能是一个非常糟糕的主意-让其他人(在这种情况下为SAP)来完成艰苦的工作为你。

It is arguably a really bad idea to try and write your own parsing algorithm - let someone else (SAP, in this case) do the hard work for you.

这篇关于在SAP ABAP中解析XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆