Skip to content

Instantly share code, notes, and snippets.

@uncoded-ro
Created June 13, 2022 16:38
Show Gist options
  • Save uncoded-ro/8d4a292a4dda99e8705f96974c09fce9 to your computer and use it in GitHub Desktop.
Save uncoded-ro/8d4a292a4dda99e8705f96974c09fce9 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<!-- currency.xsd -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="numeric">
<xsd:union memberTypes="xsd:int xsd:float" />
</xsd:simpleType>
<xsd:element name="exchange">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="currencyFrom" type="currency" />
<xsd:element name="valueFrom">
<xsd:simpleType>
<xsd:union memberTypes="xsd:int xsd:float" />
</xsd:simpleType>
</xsd:element>
<xsd:element name="currencyTo" type="currency" />
<xsd:element name="valueTo" type="numeric" />
<xsd:element name="currencyFav" type="currencyFav" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="currency">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="3" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="currencyFav">
<xsd:list itemType="currency" />
</xsd:simpleType>
</xsd:schema>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment