本文介紹了如何創建通用 XSD 類型的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我有一個 java 應用程序,我可以將一個 XSD 類型映射到另一個具有相同類型的類型.現在我需要有一個 anyType xsd,我可以將任何類型映射到該 xsd.就像我們在 java 中有 Object 類型一樣,是否可以像在 XSD 中一樣創建.
I have a java application where i can map a XSD type to another with same type. Now i have requirement to have one anyType xsd to which i can map any type. Like as we have Object type in java, is it possible to create like in XSD.
在復雜類型級別是可能的.
At complex type level is it possible.
推薦答案
是的,有可能.類型是 xsd:anyType
.這是一個例子:
Yes, it's possible. The type is xsd:anyType
. Here's an example:
<xsd:element name="anything" type="xsd:anyType"/>
(取自primer)
這里有一個更復雜的例子:
Here's a more complex example:
<xsd:complexType>
<xsd:complexContent>
<xsd:restriction base="xsd:anyType">
<xsd:attribute name="currency" type="xsd:string"/>
<xsd:attribute name="value" type="xsd:decimal"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
(同樣來自入門書——值得一看)
(From the primer as well - it's worth looking at at it)
這篇關于如何創建通用 XSD 類型的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!