kaur.reinjarv 0 Newbie Poster

I need to transform E-DOC XML INSDES (instruction to dispatch – document sent from Seller to Logistics company) to Edo XML INSDES using XSLT transformation and verify final by XSD scheme.

Here is the E-DOC XML

<PickingRequest>
<Order No="C3710177">
<OrderDate>
2012.11.15
</OrderDate>
<ShipFrom>
4771459000007
</ShipFrom>
<ShipTo>
9854485652622
</ShipTo>
<Lines>
<Line No="24339858">
<INF_PREK>
A000043
</INF_PREK>
<ProductDescription>
Makaronid sarvekesed väikesed ARRIGHI 400g
</ProductDescription>
</Line>
<Line No="24339869">
<INF_PREK>
A000044
</INF_PREK>
<ProductDescription>
Makaronid spiraalid ARRIGHI 500g
</ProductDescription>
</Line>
</Lines>
</Order>
</PickingRequest>

Into Edo XML

<Document-InstructionToDespatch>
<InstructionToDespatch-Header>
<InstructionToDespatchNumber>
C3710177
</InstructionToDespatchNumber>
<InstructionToDespatchDate>
2012-11-15
</InstructionToDespatchDate>
</InstructionToDespatch-Header>
<Document-Parties>
<Sender>
<ILN>
4771459000007
</ILN>
</Sender>
<Receiver>
<ILN>
9854485652622
</ILN>
</Receiver>
</Document-Parties>
<InstructionToDespatch-Lines>
<Line>
<Line-Item>
<LineNumber>
10
</LineNumber>
<SupplierItemCode>
A000043
</SupplierItemCode>
<ItemDescription>
Makaronid sarvekesed vaikesed ARRIGHI 400g
</ItemDescription>
</Line-Item>
</Line>
<Line>
<Line-Item>
<LineNumber>
20
</LineNumber>
<SupplierItemCode>
A000044
</SupplierItemCode>
<ItemDescription>
Makaronid spiraalid ARRIGHI 500g
</ItemDescription>
</Line-Item>
</Line>
</InstructionToDespatch-Lines>
<InstructionToDespatch-Summary>
<TotalLines>
2
</TotalLines>
</InstructionToDespatch-Summary>
</Document-InstructionToDespatch>

XSD scheme

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:element name="Document-InstructionToDespatch">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="InstructionToDespatch-Header"/>
                <xs:element ref="Document-Parties" minOccurs="0"/>
                <xs:element ref="InstructionToDespatch-Lines"/>
                <xs:element ref="InstructionToDespatch-Summary"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="InstructionToDespatch-Header">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="InstructionToDespatchNumber"/>
                <xs:element ref="InstructionToDespatchDate"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="Document-Parties">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="Sender" minOccurs="0"/>
                <xs:element ref="Receiver" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="Sender">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="ILN"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="Receiver">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="ILN"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="InstructionToDespatch-Lines">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="Line" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="Line">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="Line-Item"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="Line-Item">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="LineNumber"/>
                <xs:element ref="SupplierItemCode" minOccurs="0"/>
                <xs:element ref="ItemDescription" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="InstructionToDespatch-Summary">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="TotalLines"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <!--   Types -->
    <xs:element name="ILN" type="ILN"/>
    <xs:element name="LineNumber" type="xs:int"/>
    <xs:element name="SupplierItemCode" type="string35-1"/>
    <xs:element name="ItemDescription" type="string100"/>
    <xs:element name="TotalLines" type="xs:int"/>
    <xs:element name="InstructionToDespatchNumber" type="string20-1"/>
    <xs:element name="InstructionToDespatchDate" type="date" default="1970-01-01"/>
    <!-- STRING -->
    <xs:simpleType name="string20-1">
        <xs:restriction base="xs:string">
            <xs:maxLength value="20"/>
            <xs:minLength value="1"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="string35-1">
        <xs:restriction base="xs:string">
            <xs:maxLength value="35"/>
            <xs:minLength value="1"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="string100">
        <xs:restriction base="xs:string">
            <xs:maxLength value="100"/>
            <xs:minLength value="0"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- PATTERN -->
    <xs:simpleType name="date">
        <xs:restriction base="xs:date">
            <xs:pattern value="[0-9]{4}-[0-9]{2}-[0-9]{2}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="ILN">
        <xs:restriction base="xs:string">
            <xs:pattern value="[0-9]{0,13}"/>
        </xs:restriction>
    </xs:simpleType>

</xs:schema>

I'm new and would appreaciate if anyone could lead me into right way and help me with doing this.