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

时间:2015-03-25 10:15:00

标签: xml xsd xml-validation ofbiz

我收到以下错误消息:

  

无法读取架构文档   &#39; 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验证它?

2 个答案:

答案 0 :(得分:1)

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

<!DOCTYPE xml>

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

答案 1 :(得分:0)

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

相关问题