无法读取架构文档[XSD],因为

问题描述 投票:1回答:2

我收到以下错误消息:

无法读取架构文档'ofbiz.apache.org/dtds/widget-screen.xsd',因为1)找不到文件; 2)无法读取文件; 3)根元素文档的不是<xsd:schema>

我有一个如下的XML文件:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
    <screen name="ShippingAgreement">
        <section>
            <actions>
                <set field="selectedMenuItem" value="facilityShipment"/>
                <set field="selectedSubMenuItem" value="ShippingContract"/>
            </actions>
            <widgets>
                <decorator-screen name="DelysCommonDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">

                    </decorator-section>
                </decorator-screen>
            </widgets>
       </section>
    </screen>
</screens>

为什么不能针对XSD文件http://ofbiz.apache.org/dtds/widget-screen.xsd验证它?

xml xsd xml-validation ofbiz
2个回答
1
投票

我能够从浏览器访问http://ofbiz.apache.org/dtds/widget-screen.xsd。假设您也可以访问xsi:noNamespaceSchemaLocation指定的XSD,请从XML中删除以下行

<!DOCTYPE xml>

并且您的XML将针对给定的XSD有效。


0
投票

我遇到了同样的问题。然后我使用的是Netbeans IDE 11.1,后来安装了11.2,现在可以使用了。您还可以检查Fix for web.xml errors在我的网上搜索过程中发现它是否足智多谋:)

© www.soinside.com 2019 - 2024. All rights reserved.