Hops: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Ahokkone (talk | contribs)
Ahokkone (talk | contribs)
Line 60: Line 60:


=== XSD fail ===
=== XSD fail ===
<source lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.example.org/autod"
  xmlns:tns="http://www.example.org/autod"
  elementFormDefault="qualified">
    <simpleType name="kytusSimpleType">
    <restriction base="string">
    <enumeration value="bensiin"></enumeration>
    <enumeration value="diisel"></enumeration>
    <enumeration value="elekter"></enumeration>
    </restriction>
    </simpleType>
    <complexType name="mootorComplexType">
    <sequence>
    <element name="kytus" type="tns:kytusSimpleType"
    maxOccurs="1" minOccurs="0">
    </element>
    <element name="kubatuur" maxOccurs="1" minOccurs="0">
    <complexType>
    <simpleContent>
      <extension base="int">
    <attribute name="yhik" use="required">
    <simpleType>
<restriction base="string">
<enumeration value="ccm"/>
<enumeration value="l"/>
</restriction>
</simpleType>
</attribute>
</extension>
  </simpleContent>
</complexType>
    </element>
    </sequence>
    </complexType>
    <complexType name="autoComplexType">
    <sequence>
    <element name="mootor" type="tns:mootorComplexType"></element>
    <element name="kere" type="tns:kereComplexType"
    maxOccurs="1" minOccurs="1">
    </element>
    </sequence>
    <attribute name="id" type="int"></attribute>
    </complexType>
   
    <simpleType name="v2rvSimpleType">
    <restriction base="string">
    <enumeration value="punane"></enumeration>
    <enumeration value="roheline"></enumeration>
    <enumeration value="sinine"></enumeration>
    </restriction>
    </simpleType>
    <complexType name="kereComplexType">
        <attribute name="v2rv" type="tns:v2rvSimpleType"></attribute>
    </complexType>
    <element name="autod" type="tns:AutodListComplexType"></element>
   
    <complexType name="AutodListComplexType">
    <sequence>
    <element name="auto" type="tns:autoComplexType" maxOccurs="unbounded" minOccurs="0"></element>
    </sequence>
    </complexType>
</schema>
</source>


=== XSLT failid ===
=== XSLT failid ===

Revision as of 23:17, 14 April 2013

Meeskond

  • Liikmed:
    • Artur Hokkonen
    • Margus Parts
    • Hanno Sirkel
    • Lauri Õunmaa

Idee

XML

XML fail

<?xml version="1.0" encoding="UTF-8"?>
<tns:autod xmlns:tns="http://www.example.org/autod" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/autod autod.xsd ">
  <tns:auto id="0">
    <tns:mootor>
      <tns:kytus>bensiin</tns:kytus>
      <tns:kubatuur yhik="ccm">2000</tns:kubatuur>
    </tns:mootor>
    <tns:kere v2rv="punane"/>
  </tns:auto>
  
  <tns:auto id="1">
    <tns:mootor>
      <tns:kytus>diisel</tns:kytus>
      <tns:kubatuur yhik="ccm">2500</tns:kubatuur>
    </tns:mootor>
    <tns:kere v2rv="roheline"/>
  </tns:auto>
  
  
  <tns:auto id="2">
    <tns:mootor>
      <tns:kytus>bensiin</tns:kytus>
      <tns:kubatuur yhik="ccm">1500</tns:kubatuur>
    </tns:mootor>
    <tns:kere v2rv="sinine"/>
  </tns:auto>
  
  <tns:auto id="3">
    <tns:mootor>
      <tns:kytus>elekter</tns:kytus>
    </tns:mootor>
    <tns:kere v2rv="sinine"/>
  </tns:auto>
  
</tns:autod>

XSD fail

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.example.org/autod" 
  xmlns:tns="http://www.example.org/autod"
  elementFormDefault="qualified">




    <simpleType name="kytusSimpleType">
    	<restriction base="string">
    		<enumeration value="bensiin"></enumeration>
    		<enumeration value="diisel"></enumeration>
    		<enumeration value="elekter"></enumeration>
    	</restriction>
    </simpleType>

    <complexType name="mootorComplexType">
    	<sequence>
    		<element name="kytus" type="tns:kytusSimpleType"
    			maxOccurs="1" minOccurs="0">
    		</element>
    		<element name="kubatuur" maxOccurs="1" minOccurs="0">
    			<complexType>
    			 	<simpleContent>
      					<extension base="int">
    						<attribute name="yhik" use="required">
		    					<simpleType>
									<restriction base="string">
										<enumeration value="ccm"/>
										<enumeration value="l"/>
									</restriction>
								</simpleType>
							</attribute>
						</extension>
   					</simpleContent>
				</complexType>
    		</element>
    	</sequence>
    </complexType>



    <complexType name="autoComplexType">
    	<sequence>
    		<element name="mootor" type="tns:mootorComplexType"></element>
    		<element name="kere" type="tns:kereComplexType"
    			maxOccurs="1" minOccurs="1">
    		</element>
    	</sequence>
    	<attribute name="id" type="int"></attribute>
    </complexType>
    



    <simpleType name="v2rvSimpleType">
    	<restriction base="string">
    		<enumeration value="punane"></enumeration>
    		<enumeration value="roheline"></enumeration>
    		<enumeration value="sinine"></enumeration>
    	</restriction>
    </simpleType>

    <complexType name="kereComplexType">
        <attribute name="v2rv" type="tns:v2rvSimpleType"></attribute>
    </complexType>



    <element name="autod" type="tns:AutodListComplexType"></element>
    
    <complexType name="AutodListComplexType">
    	<sequence>
    		<element name="auto" type="tns:autoComplexType" maxOccurs="unbounded" minOccurs="0"></element>
    	</sequence>
    </complexType>
</schema>

XSLT failid

Retsensioonid

XML