Starting from:

$30

CSIT128-Lab 8 Solved

Question 1. Given the following XML code containing an exam result where score is an integer; and contestant id, exam id, band and digital signature are strings. Your task is to write the corresponding XSD code and save it into the file q1.xsd.

 

<?xml version="1.0"?

<result ref="10007629P"

  <contestantId00025142</contestantId

  <examIdKB253DG</examId

  <score156</score

  <bandC</band

  <digitalSignaturea720cf8e23bc1256bce2</digitalSignature </result
 

Question 2. Copy the code from q1.xsd to q2.xsd.​ In q2.xsd, add the following restrictions:

●      Band values must be A, B, C or D.

●      Score values must be an integer between 0 and 300.

Here is a sample of restriction code:

<xsd:restriction base="xsd:integer"

  <xsd:minInclusive value="0" /

  <xsd:maxInclusive value="100" /

</xsd:restriction

 

<xsd:restriction base="xsd:string"

  <xsd:enumeration value="LARGE" /

  <xsd:enumeration value="MEDIUM" /

  <xsd:enumeration value="SMALL" /

</xsd:restriction
Page 1 of 2

 

 

Question 3. Given the following XML code.​

Your task is to write the corresponding XSD code and save it into the file q3.xsd.

 

<?xml version="1.0"?

<audit campus="Woolloomooloo" year="2000" session="A"

 

  <subject sid="0769642"

    <codeMATH101</code

    <titleCalculus</title

    <statistics

      <enrol170</enrol

      <withdrawn31</withdrawn

    </statistics

  </subject

 

  <subject sid="1734231"

    <codeMATH234</code

    <titleAbstract Algebra</title

    <statistics

      <enrol40</enrol

      <withdrawn15</withdrawn

    </statistics

  </subject

 

</audit

More products