开发者

Is there a shorter way to define a anything element?

开发者 https://www.devze.com 2023-01-19 14:05 出处:网络
I want to define a tag in my schema for anything. It should be 开发者_如何学Cable to contain any combination of tags and text.

I want to define a tag in my schema for anything. It should be 开发者_如何学Cable to contain any combination of tags and text. So far I've found

<xs:complexType name="customType" mixed="true">
  <xs:sequence>
    <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
  </xs:sequence>
  <xs:anyAttribute processContents="lax"/>
</xs:complexType>

I'm wondering if there is a shorter way. Something like

<xs:element name="custom" type="anything"/>

Thanks for your time.


Yes. In fact you can just write

<xsd:element name="XYZ"/>

Check here for info: http://www.w3.org/TR/xmlschema-0/#anyType

0

精彩评论

暂无评论...
验证码 换一张
取 消