【问题标题】:Reading XML file using DXL(DOORS Scripting) and exporting to EXCEL dynamically使用 DXL(DOORS 脚本)读取 XML 文件并动态导出到 EXCEL
【发布时间】:2025-12-06 07:05:01
【问题描述】:

我需要使用 DXL 脚本和导出到 EXCEl 读取 XML 文件。

DXL 中是否有任何脚本可用? 请帮帮我。 谢谢, 斯里

【问题讨论】:

  • 可以,但是DXL没有内置快速读取XML的功能,你必须自己构建。通过转到逗号分隔值或使用 OLE 方法也可以导出到 Excel。
  • @SteveValliere 为什么不使用您的评论作为答案?

标签: ibm-doors


【解决方案1】:

可以,但 DXL 没有内置快速功能来读取 XML,您必须自己构建。通过转到逗号分隔值或使用 OLE 方法也可以导出到 Excel。

【讨论】:

    【解决方案2】:

    Mathias Mamtsch创建了一个库,使用它你可以从输入字符串xml创建DOM,然后读取、写入属性、值、迭代属性、标签等等。

    http://sourceforge.net/projects/dxlstandardlib
    

    DXL 世界中,您必须自己编写所有内容。

    它使用了一些辅助 dxl 文件,因此要使用它,您必须使用多个额外的 dxl 文件。

    例如那里的功能之一:

    /*! \memberof XMLDocument 
        \return true - if the XML document could be loaded and parsed correctly. 'false' if there was an error loading the document.
        \param xd The XMLDocument into which the contents shall be loaded. 
        \param s the contents of the XML document to load
        \brief This function loads the XML content of a string into an XMLDocument object.     
    */  
    bool loadXML (XMLDocument xd, string s) {
        bool result = false
        checkOLE (  oleMethod (getOleHandle_ xd, "LoadXML", oleArgs <- s, result)  )
        return result
    }
    

    这些函数使用 OLE 对象,所以我认为它们是特定于 Windows 的,在 Linux 下代码将无法工作。但不确定。

    【讨论】: