- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
在使用命名空间时引用模式的正确语法是什么?
问题
使用给定的模式创建 XML 文档。
错误
.xml:9.20: Element '{http://example/buildings/1.0}old_buildings': No matching global declaration available for the validation root.
oldbuildings.xml - invalid
Problem
XML 文件
<p></p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<buildings:old_buildings xmlns:buildings="http://example/buildings/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://example/buildings/1.0 oldbuildings_schema.xsd">
<building>
<name>Name</name>
<year_built era="BC">2000</year_built>
<story>...<story>
</building>
</buildings:old_buildings>
</code></pre>
<p></p>
XSD 文档
<?xml version="1.0" encoding="UTF-8"?> <xs:schema targetNamespace="http://example/buildings/1.0/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://example/buildings/1.0/"> <xs:element name="old_buildings"> <xs:complexType> <xs:sequence> <xs:element ref="building"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="building" type="buildingType"></xs:element> <xs:complexType name="buildingType"> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="year_built" type="yearType"/> <xs:element name="story" type="xs:string"/> </xs:sequence> </xs:complexType> <xs:complexType name="yearType"> <xs:simpleContent> <xs:extension base="xs:positiveInteger"> <xs:attribute name="era" type="xs:string"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:schema>
最佳答案
在您的 xml 文件中,尝试使用
xmlns:buildings="http://example/buildings/1.0/"
使用/final,如在您的 xsd 声明中:xs:schema targetNamespace="http://example/buildings/1.0/"
关于XML + 模式 + 命名空间。没有可用于验证根的匹配全局声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15174174/
我正在使用 Gunicorn 为 Django 应用程序提供服务,它工作正常,直到我将其超时时间从 30 秒更改为 900000 秒,我不得不这样做,因为我有一个用例需要上传和处理一个巨大的文件(过程
我有一个带有非常基本的管道的Jenkinsfile,它可以旋转docker容器: pipeline { agent { dockerfile { args '-u root' } } stag
在学习 MEAN 堆栈的过程中,我遇到了一个问题。每当我尝试使用 Passport 验证方法时,它都不会返回任何响应。我总是收到“localhost没有发送任何数据。ERR_EMPTY_RESPONS
在当今的大多数企业堆栈中,数据库是我们存储所有秘密的地方。它是安全屋,是待命室,也是用于存储可能非常私密或极具价值的物品的集散地。对于依赖它的数据库管理员、程序员和DevOps团队来说,保护它免受所
是否可以创建像图片上那样的边框?只需使用 css 边框属性。最终结果将是没 Angular 盒子。我不想添加额外的 html 元素。我只想为每个 li 元素添加 css 边框信息。 假设这是一个 ul
我是一名优秀的程序员,十分优秀!