- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
master.xsd:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.gworks.cn/waf_profile"
xmlns:tns="http://www.gworks.cn/waf_profile" elementFormDefault="qualified">
<element name="profile">
<complexType>
<sequence>
<element name="aspect">
<complexType>
<sequence minOccurs="1" >
<any processContents="strict" />
</sequence>
<attribute name="id" type="string" use="required"></attribute>
<attribute name="class" type="string" use="required"></attribute>
<attribute name="desc" type="string" use="optional"></attribute>
</complexType>
</element>
</sequence>
<attribute name="name" type="string" use="required"></attribute>
</complexType>
</element>
</schema>
我可以像这样针对这个模式写一个 XML 文件吗:
<?xml version="1.0" encoding="UTF-8"?>
<profile name="开发" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.gworks.cn/waf_profile"
xsi:schemaLocation="http://www.gworks.cn/waf_profile http://www.gworks.cn/waf_profile.xsd">
<aspect id="security" class="cn.gworks.waf.config.SecurityConfig" desc="安全配置">
<security xsi:schemaLocation="http://www.gworks.cn/config_security http://www.gworks.cn/config_security.xsd">
<authService impl="com.bgzchina.ccms.security.SSOAuthService" enabled="true">
<certificate>
<field name="Token" isKey="true" />
</certificate>
</authService>
<authService impl="com.bgzchina.ccms.security.NoAuthService" enabled="true">
<certificate>
<field name="username" isKey="true" />
</certificate>
</authService>
</security>
</aspect>
</profile>
其中子元素“security”定义了自己的模式。
最佳答案
因为XSD指定
<any processContents="strict" />
在aspect
的内容模型中,由于processContents="strict"
,你的XML是无效的,这要求XML处理器必须能够获取XSD 定义,在这种情况下,安全
并且必须能够验证它。
如果你把这个改成
<any processContents="lax" />
您的 XML 将是有效的,如果您要在 XSD 中定义 security
,该定义将在验证期间使用。 (如果找不到定义,您的文档仍将被视为有效。)这要求内容只有在 XML 处理器可以找到其定义时才有效。
如果你把这个改成
<any processContents="skip" />
您的 XML 将是有效的,XML 处理器将不会尝试验证aspect
下的子内容(除了要求它是一些 每个 sequence
约束的单个元素。
注意事项:
processContents
的默认值为 strict
。关于xml - processContents strict vs lax vs skip for xsd :any,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27420156/
我知道 Applicative类在范畴论中被描述为“松散的单曲面仿函数”,但我以前从未听说过“松散”这个词,the nlab page on lax functor一堆我根本不认识的东西,回复:双类别
我有一个通用架构,定义了这样的部分:
我在通过弹出脚本的 chrome 扩展处理 cookie 时遇到了一些问题。 popup.js 内容: document.addEventListener('DOMContentLoaded', ()
我在通过弹出脚本的 chrome 扩展处理 cookie 时遇到了一些问题。 popup.js 内容: document.addEventListener('DOMContentLoaded', ()
我阅读了 WiX 文档。 我在 WiX 文档中看到短语“任何属性 (namespace='##other' processContents='lax') WiX XML 架构中的扩展点。架构扩展可以在
谁能告诉我 和有什么区别? SameSite="松懈"和 SameSite="严格"通过一个很好的例子,因为我在这两者之间有点困惑? 最佳答案 Lax 允许在某些跨站点请求上发送 cookie,而 S
尝试使用 Xcode 6.1 中的 clang 版本(基于 LLVM 3.5svn 的 clang-600.0.54)编译以下代码,使用 -std=c++11 和 -stdlib =libc++ 给我
master.xsd:
您好,我有 Flask 后端和 vue 前端,但我无法在浏览器中设置 cookie。 此 set-cookie 被阻止,因为它具有 samesite=lax 属性但来自跨站点响应女巫不是对顶级导航的响
我公司的网站 (mercury.co) 通过电子邮件向用户发送密码重置链接。我们遇到了一些非常奇怪的行为,我们只能在与 SameSite Lax 属性相关的 Gmail iOS 应用程序中重现这些行为
用户在 site-a.com 上,并且有一个带有 site-b.com 的 iframe。 site-b.com 向 site-a.com 发出 GET 请求(在 iframe 内)。用于跨站点 GE
我一直在开发一个具有固定标题的移动版本的网站,我想在向下滚动隐藏导航时获得相同的效果,只有当您向上滚动超过 5 个像素时才显示它。 就像teehanlax.com .我已经使用我在网上找到的一些代码试
我有一个 XML 模式,其中包含许多 定义,即它允许插入其他命名空间的任意标签。 processContents="lax" 表示解析器应该尝试验证这些标签,如果它有相应的架构 (1) (2) .
我目前正在设置这样的 cookie(在中间件中): cookie()->queue("loginToken", $loginToken, 60*24*365*10); 如何指定 SameSite =
我有一个asp.net 站点,用户可以登录该站点,成员可以通过Ctrl+P 获取报告或打印页面。 最近当我的成员(member)在 IE 中打开我的网站并尝试打印时,他们被注销了! 为什么? 因为 I
我在 Ionic 框架 iframe 中添加到购物车时遇到问题,按钮卡在 Adding...无需将商品添加到购物车。 我注意到“网络”选项卡中有一些错误/警告。它说 SameSite cookie 被
我是一名优秀的程序员,十分优秀!