【问题标题】:How to include xml file in xml ? <xi : include does not work如何在 xml 中包含 xml 文件? <xi : 包含不起作用
【发布时间】:2017-08-04 13:15:13
【问题描述】:

我正在尝试在另一个 xml 文件中包含一些 xml 文件。为此,我使用了:

<example xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2001/XInclude">

        <xi:include href="file1.xml" parse="xml" />
        <xi:include href="file2.xml" parse="xml" />

    </types>

</example>

但我得到了这个错误:意外的属性'xmlns:xi'

我不明白为什么......

提前致谢!

(我正在使用Node js并尝试连接到DDS顺便说一句)

【问题讨论】:

    标签: xml xinclude


    【解决方案1】:

    您需要检查您的 XML 解析器是否有扩展 xi:include 指令的选项。默认情况下不太可能完成,如果您可能需要配置该功能。

    如果没有,您也许可以找到一个独立的 XInclude 处理器,但我怀疑您在 Node.js 上的选择有点有限。

    对于人们实际上在 99% 的时间内使用的极小 XInclude 子集,编写一个 XSLT 转换来进行扩展是非常简单的:它只有六行代码。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-10-02
      • 1970-01-01
      • 1970-01-01
      • 2016-08-05
      • 1970-01-01
      • 1970-01-01
      • 2016-09-24
      相关资源
      最近更新 更多