Skip to content

Instantly share code, notes, and snippets.

@mcanvar
Created January 21, 2016 16:51
Show Gist options
  • Save mcanvar/4e7cf9cb89b354af945c to your computer and use it in GitHub Desktop.
Save mcanvar/4e7cf9cb89b354af945c to your computer and use it in GitHub Desktop.
XML Schema: xsd çalışma örneklerim.
<?xml version="1.0" encoding="utf-8" ?>
<!-- author: [email protected] -->
<Currencies Tarih="2015-11-13" Date="2015-11-13" Time="15:30:00" Bulten_No="2015/216"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="currencies.xsd" xmlns="http://tempuri.org/currencies.xsd">
<Currency CrossOrder="0" Kod="USD" CurrencyCode="USD">
<Unit>1</Unit>
<Name Lang="tr">ABD DOLARI</Name>
<Name Lang="en">US DOLLAR</Name>
<ForexBuying>2.8686</ForexBuying>
<ForexSelling>2.8738</ForexSelling>
<BanknoteBuying>2.8666</BanknoteBuying>
<BanknoteSelling>2.8781</BanknoteSelling>
<CrossRateUSD>1</CrossRateUSD>
<Country State="Virginia" />
<Country State="Kentucky" />
<Country State="Nevada" />
<IsAlive>true</IsAlive>
<Date>2015-13-11</Date>
<Time>15:30:00</Time>
<DateTime>2015-13-11T15:30:00</DateTime>
<Interval>P1D</Interval>
<tribute_year>1995</tribute_year>
<birth_mont>--12</birth_mont>
<leap_day>--02-29</leap_day>
<ides>---15</ides>
</Currency>
<Currency CrossOrder="9" Kod="EUR" CurrencyCode="EUR">
<Unit>1</Unit>
<Isim>EURO</Isim>
<CurrencyName>EURO</CurrencyName>
<ForexBuying>3.1904</ForexBuying>
<ForexSelling>3.1962</ForexSelling>
<BanknoteBuying>3.1882</BanknoteBuying>
<BanknoteSelling scope="0-100">3.201</BanknoteSelling>
<CrossRateUSD></CrossRateUSD>
<CrossRateOther>1.0955</CrossRateOther>
<using_from>
Greece
France
Germany
Slovenia
Italy
</using_from>
<description>
<body></body>
<title></title>
</description>
<history>
<title></title>
<body></body>
</history>
<extra_info id="0"></extra_info>
<img src="" />
</Currency>
<Currency CrossOrder="1" Kod="AUD" CurrencyCode="AUD">
<Unit>1</Unit>
<Name Lang="tr">AVUSTRALYA DOLARI</Name>
<Name Lang="en">AUSTRALIAN DOLLAR</Name>
<ForexBuying>2.0426</ForexBuying>
<ForexSelling>2.0559</ForexSelling>
<BanknoteBuying>2.0332</BanknoteBuying>
<BanknoteSelling>2.0682</BanknoteSelling>
<CrossRateUSD>1.4011</CrossRateUSD>
</Currency>
<Currency CrossOrder="2" Kod="DKK" CurrencyCode="DKK">
<Unit>1</Unit>
<Name Lang="tr">DANİMARKA KRONU</Name>
<Name Lang="en">DANISH KRONE</Name>
<ForexBuying>0.41349</ForexBuying>
<ForexSelling>0.41552</ForexSelling>
<BanknoteBuying>0.4132</BanknoteBuying>
<BanknoteSelling>0.41648</BanknoteSelling>
<CrossRateUSD>6.9269</CrossRateUSD>
</Currency>
<Currency CrossOrder="10" Kod="GBP" CurrencyCode="GBP">
<Unit>1</Unit>
<Name Lang="tr">İNGİLİZ STERLİNİ</Name>
<Name Lang="en">POUND STERLING</Name>
<ForexBuying>4.3582</ForexBuying>
<ForexSelling>4.381</ForexSelling>
<BanknoteBuying>4.3551</BanknoteBuying>
<BanknoteSelling>4.3876</BanknoteSelling>
<CrossRateUSD>
</CrossRateUSD>
<CrossRateOther>1.5219</CrossRateOther>
<Country State="England" />
<Country State="Scotland" />
</Currency>
<Currency CrossOrder="3" Kod="CHF" CurrencyCode="CHF">
<Unit>1</Unit>
<Name Lang="tr">İSVİÇRE FRANGI</Name>
<Name Lang="en">SWISS FRANK</Name>
<ForexBuying>2.854</ForexBuying>
<ForexSelling>2.8723</ForexSelling>
<BanknoteBuying>2.8497</BanknoteBuying>
<BanknoteSelling>2.8766</BanknoteSelling>
<CrossRateUSD>1.0028</CrossRateUSD>
</Currency>
<Currency CrossOrder="4" Kod="SEK" CurrencyCode="SEK">
<Unit>1</Unit>
<Name Lang="tr">İSVEÇ KRONU</Name>
<Name Lang="en">SWEDISH KRONA</Name>
<ForexBuying>0.32968</ForexBuying>
<ForexSelling>0.33309</ForexSelling>
<BanknoteBuying>0.32945</BanknoteBuying>
<BanknoteSelling>0.33386</BanknoteSelling>
<CrossRateUSD>8.6642</CrossRateUSD>
</Currency>
<Currency CrossOrder="6" Kod="CAD" CurrencyCode="CAD">
<Unit>1</Unit>
<Name Lang="tr">KANADA DOLARI</Name>
<Name Lang="en">CANADIAN DOLLAR</Name>
<ForexBuying>2.1555</ForexBuying>
<ForexSelling>2.1652</ForexSelling>
<BanknoteBuying>2.1475</BanknoteBuying>
<BanknoteSelling>2.1734</BanknoteSelling>
<CrossRateUSD>1.329</CrossRateUSD>
</Currency>
<Currency CrossOrder="11" Kod="KWD" CurrencyCode="KWD">
<Unit>1</Unit>
<Name Lang="tr">KUVEYT DİNARI</Name>
<Name Lang="en">KUWAITI DINAR</Name>
<ForexBuying>9.3906</ForexBuying>
<ForexSelling>9.5135</ForexSelling>
<BanknoteBuying>9.2497</BanknoteBuying>
<BanknoteSelling>9.6562</BanknoteSelling>
<CrossRateUSD>
</CrossRateUSD>
<CrossRateOther>3.292</CrossRateOther>
</Currency>
<Currency CrossOrder="7" Kod="NOK" CurrencyCode="NOK">
<Unit>1</Unit>
<Name Lang="tr">NORVEÇ KRONU</Name>
<Name Lang="en">NORWEGIAN KRONE</Name>
<ForexBuying>0.32964</ForexBuying>
<ForexSelling>0.33186</ForexSelling>
<BanknoteBuying>0.32941</BanknoteBuying>
<BanknoteSelling>0.33262</BanknoteSelling>
<CrossRateUSD>8.681</CrossRateUSD>
</Currency>
<Currency CrossOrder="8" Kod="SAR" CurrencyCode="SAR">
<Unit>1</Unit>
<Name Lang="tr">SUUDİ ARABİSTAN RİYALİ</Name>
<Name Lang="en">SAUDI RIYAL</Name>
<ForexBuying>0.76493</ForexBuying>
<ForexSelling>0.76631</ForexSelling>
<BanknoteBuying>0.75919</BanknoteBuying>
<BanknoteSelling>0.77206</BanknoteSelling>
<CrossRateUSD>3.7502</CrossRateUSD>
</Currency>
<Currency CrossOrder="5" Kod="JPY" CurrencyCode="JPY">
<Unit>100</Unit>
<Name Lang="tr">JAPON YENİ</Name>
<Name Lang="en">JAPENESE YEN</Name>
<ForexBuying>2.3326</ForexBuying>
<ForexSelling>2.3481</ForexSelling>
<BanknoteBuying>2.324</BanknoteBuying>
<BanknoteSelling>2.357</BanknoteSelling>
<CrossRateUSD>122.68</CrossRateUSD>
</Currency>
<Currency CrossOrder="12" Kod="BGN" CurrencyCode="BGN">
<Unit>1</Unit>
<Name Lang="tr">BULGAR LEVASI</Name>
<Name Lang="en">BULGARIAN LEV</Name>
<ForexBuying>1.5709</ForexBuying>
<ForexSelling>1.5915</ForexSelling>
<CrossRateUSD>1.8159</CrossRateUSD>
</Currency>
<Currency CrossOrder="13" Kod="RON" CurrencyCode="RON">
<Unit>1</Unit>
<Name Lang="tr">RUMEN LEYİ</Name>
<Name Lang="en">NEW LEU</Name>
<ForexBuying>0.69172</ForexBuying>
<ForexSelling>0.70077</ForexSelling>
<CrossRateUSD>4.1238</CrossRateUSD>
</Currency>
<Currency CrossOrder="14" Kod="RUB" CurrencyCode="RUB">
<Unit>1</Unit>
<Name Lang="tr">RUS RUBLESİ</Name>
<Name Lang="en">RUSSIAN ROUBLE</Name>
<ForexBuying>0.04283</ForexBuying>
<ForexSelling>0.04339</ForexSelling>
<CrossRateUSD>66.61</CrossRateUSD>
</Currency>
<Currency CrossOrder="15" Kod="IRR" CurrencyCode="IRR">
<Unit>100</Unit>
<Name Lang="tr">İRAN RİYALİ</Name>
<Name Lang="en">IRANIAN RIAL</Name>
<ForexBuying>0.00952</ForexBuying>
<ForexSelling>0.00964</ForexSelling>
<CrossRateUSD>29964</CrossRateUSD>
</Currency>
<Currency CrossOrder="16" Kod="CNY" CurrencyCode="CNY">
<Unit>1</Unit>
<Name Lang="tr">ÇİN YUANI</Name>
<Name Lang="en">CHINESE RENMINBI</Name>
<ForexBuying>0.44755</ForexBuying>
<ForexSelling>0.45341</ForexSelling>
<CrossRateUSD>6.3737</CrossRateUSD>
</Currency>
<Currency CrossOrder="17" Kod="PKR" CurrencyCode="PKR">
<Unit>1</Unit>
<Name Lang="tr">PAKİSTAN RUPİSİ</Name>
<Name Lang="en">PAKISTANI RUPEE</Name>
<ForexBuying>0.02707</ForexBuying>
<ForexSelling>0.02742</ForexSelling>
<CrossRateUSD>105.4</CrossRateUSD>
</Currency>
</Currencies>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="currencies" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:documentation>This XML Schema will be used to validate the set of XML documents for the Wonders of the World project.</xs:documentation>
</xs:annotation>
<xs:simpleType name="CrossRateUSD_type">
<xs:restriction base="xs:double">
<xs:maxExclusive value="1000"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="name_type">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="Lang" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:group name="below_info">
<xs:sequence>
<xs:element name="img" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="src" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:group>
<xs:attributeGroup name="cur_att_group">
<xs:attribute name="CrossOrder" type="xs:int" use="required"/>
<xs:attribute name="Kod" type="xs:string" use="required"/>
<xs:attribute name="CurrencyCode" type="xs:string" use="required"/>
<xs:attribute name="CurrencyID" type="xs:string" use="optional" default="0"/>
</xs:attributeGroup>
<xs:element name="Currencies">
<xs:complexType>
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:sequence>
<xs:element name="Currency">
<xs:complexType>
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:sequence>
<xs:element name="Unit">
<xs:simpleType>
<xs:restriction base="xs:int">
<xs:minExclusive value="0"/>
<xs:maxExclusive value="1000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Name" type="name_type" />
<xs:element name="ForexBuying">
<xs:simpleType>
<xs:restriction base="xs:decimal">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="1000"/>
<xs:totalDigits value="10"/>
<xs:fractionDigits value="6"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="ForexSelling">
<xs:simpleType>
<xs:restriction base="xs:double">
<xs:pattern value="[0-9]+\.*[0-9]*"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="BanknoteBuying" type="xs:double"/>
<xs:element name="BanknoteSelling">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:double">
<xs:attribute name="scope" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="CrossRateUSD">
<xs:simpleType>
<xs:union memberTypes="xs:string CrossRateUSD_type"/>
</xs:simpleType>
</xs:element>
<xs:element name="Country">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Turkey" />
<xs:enumeration value="USA" />
<xs:enumeration value="UK" />
<xs:enumeration value="France" />
<xs:maxLength value="512" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="IsAlive" type="xs:boolean" fixed="true"/>
<xs:element name="Date">
<xs:simpleType>
<xs:restriction base="xs:date">
<xs:minInclusive value="2000-01-01"/>
<xs:maxInclusive value="2015-12-28"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Time" type="xs:time"/>
<xs:element name="DateTime" type="xs:dateTime"/>
<xs:element name="Interval" type="xs:duration" default="P1D"/>
<xs:element name="tribute_year" type="xs:gYear" default="1995"/>
<xs:element name="birth_mont" type="xs:gMonth" default="--12"/>
<xs:element name="leap_day" type="xs:gMonthDay" default="--02-29"/>
<xs:element name="ides" type="xs:gDay" default="---15"/>
<xs:element name="using_from">
<xs:simpleType>
<xs:list itemType="xs:string" />
</xs:simpleType>
</xs:element>
<xs:element name="description">
<xs:complexType>
<xs:all>
<xs:element name="title" type="xs:string" />
<xs:element name="body" type="xs:string" />
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="history">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="1" maxOccurs="2">
<xs:element name="title" type="xs:string" />
<xs:sequence>
<xs:element name="body" type="xs:string" />
</xs:sequence>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="extra_info">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="id" type="xs:positiveInteger" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="below_i">
<xs:complexType>
<xs:sequence>
<xs:group ref="below_info"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attributeGroup ref="cur_att_group"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="Tarih" type="xs:date" use="required"/>
<xs:attribute name="Date" type="xs:date" use="required"/>
<xs:attribute name="Time" type="xs:time" use="optional" fixed="15:30:00"/>
<xs:attribute name="Bulten_No" type="xs:string" use="required"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:schema>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment