内容简介:翻译自:https://stackoverflow.com/questions/16917703/how-to-define-xsd-to-allow-any-element
我想为参数元素定义一个xsd,这将允许我以下列方式定义参数
<parameter name="save.type" value="attribute" />
要么
<parameter name="payload">
<p:AdderProcessRequest xmlns:p="http://wso2.org/bps/sample">
<!--Exactly 1 occurrence -->
<x xmlns="http://wso2.org/bps/sample">{@xvalue}</x>
<!--Exactly 1 occurrence -->
<y xmlns="http://wso2.org/bps/sample">{@yvalue}</y>
</p:AdderProcessRequest>
</parameter>
在第二种方法中,参数元素中的xml内容事先是未知的,因此它可以是任何内容.
以下是我创建的xsd但它似乎不起作用.
<xs:element name="parameter" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0"/>
</xs:sequence>
<xs:attribute type="xs:string" name="name" use="optional"/>
<xs:attribute type="xs:string" name="value" use="optional"/>
</xs:complexType>
</xs:element>
任何有关这方面的帮助将不胜感激.
提前致谢
经过在这里发布的规格,我能够弄明白,所以其他人可能需要它:).您必须添加processContents =“skip”,以便不会处理内容.
<xs:element name="parameter" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:any processContents="skip" minOccurs="0"/>
</xs:sequence>
<xs:attribute type="xs:string" name="name" use="optional"/>
<xs:attribute type="xs:string" name="value" use="optional"/>
</xs:complexType>
翻译自:https://stackoverflow.com/questions/16917703/how-to-define-xsd-to-allow-any-element
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- c – 强制允许取消引用NULL指针
- html – 如果需要,我如何允许文字包装一个字?
- Microsoft Teams 升级机制允许黑客执行任意文件
- 允许root访问,另一个Linux内核缺陷浮出水面
- Kubernetes爆发严重Bug允许任何用户访问管理控件
- OpenStack允许 root 用户使用 ssh key 登录
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Web 2.0 Architectures
Duane Nickull、Dion Hinchcliffe、James Governor / O'Reilly / 2009 / USD 34.99
The "Web 2.0" phenomena has become more pervasive than ever before. It is impacting the very fabric of our society and presents opportunities for those with knowledge. The individuals who understand t......一起来看看 《Web 2.0 Architectures》 这本书的介绍吧!