www.webdeveloper.com
Results 1 to 2 of 2

Thread: New, Learning, and completely lost now

  1. #1
    Join Date
    May 2013
    Posts
    2

    New, Learning, and completely lost now

    I am guessing this should be simple but its not for me. My professor does not understand English well and is using a book we don't have. Sigh
    Any help is extremely appreciated, especially explanations of why something is done a certain way
    This is what I need to do:

    1. Use your text editor to open the golfer.txt and scores.txt files from the folder you saved them, and then study the contents of the files. Based on the contents of these two files, develop two XML vocabularies: one to describe the information from the golfer.txt file and the other to describe the information from the scores.txt file. The structure of the two vocabularies is up to you, but it should include examples of attributes and nested child elements.
    2. Place the golfer vocabulary in the namespace http://fairwayviews.com/golfers/ns and the scores vocabulary in the namespace http://fairwayviews.com/scores/ns.
    3. Create a compound document named golfer.xml that includes data from both the golfer and the scores vocabularies. Include a comment section in the file that describes the content and purpose of the document.
    4. Create a schema file named scores.xsd that can be used to validate the content from the scores vocabulary. The layout and structure of the schema is up to you, but it should contain examples of the following:
    A customized data type restricting the value of a built-in XML Schema data type
    A named complex type that describes the structure of a complex element
    An attribute that employs the IDREF data type
    5. Create a schema file named golfers.xsd that can be used to validate the golfer vocabulary. The schema should demonstrate how to import the scores schema and include the following features:
    Attributes with data values limited to nonnegative and positive integers
    An attribute containing an ID value
    An element containing a floating point value
    6. Apply the two schemas you created to your compound document, golfer.xml. Validate the file to ensure that there are no errors.

    Files are as:
    golfer.txt:
    Code:
    Name: Brett Bierson
    News: Bierson fresh off his 7th place finish in the Buick Invitational, tees off
          with the last group in the Southern Open. Bierson looks to finish in the
          Top 30 of the money list for the third consecutive year.
    
    
       Events:    3
       Cuts:      3
       Top 10:    2
       Wins:      0
       Avg:      70.9
       Earnings: 980968
    
    Player ID: pga028
    scores.txt:
    Code:
    Venue: Buick Invitational
    Golfer: Brett Bierson
    Finish: 7
    Score: 285 (-3)
    Winnings: 589231
    
    Scoring
    =======
    Round 1
       Hole1 (par 4): 4
       Hole2 (par 4): 4
       Hole3 (par 5): 5
       Hole4 (par 3): 2
       Hole5 (par 4): 4
       Hole6 (par 4): 4
       Hole7 (par 5): 5
       Hole8 (par 3): 4
       Hole9 (par 4): 4
       Hole10 (par 4): 4
       Hole11 (par 5): 3
       Hole12 (par 4): 4
       Hole13 (par 3): 3
       Hole14 (par 4): 4
       Hole15 (par 5): 5
       Hole16 (par 4): 5
       Hole17 (par 3): 3
       Hole18 (par 4): 3
    
    Round 2
       Hole1 (par 4): 3
       Hole2 (par 4): 4
       Hole3 (par 5): 5
       Hole4 (par 3): 3
       Hole5 (par 4): 4
       Hole6 (par 4): 4
       Hole7 (par 5): 5
       Hole8 (par 3): 3
       Hole9 (par 4): 4
       Hole10 (par 4): 4
       Hole11 (par 5): 4
       Hole12 (par 4): 4
       Hole13 (par 3): 3
       Hole14 (par 4): 4
       Hole15 (par 5): 6
       Hole16 (par 4): 4
       Hole17 (par 3): 4
       Hole18 (par 4): 4
    
    
    Round 3
       Hole1 (par 4): 3
       Hole2 (par 4): 4
       Hole3 (par 5): 6
       Hole4 (par 3): 3
       Hole5 (par 4): 4
       Hole6 (par 4): 4
       Hole7 (par 5): 5
       Hole8 (par 3): 2
       Hole9 (par 4): 4
       Hole10 (par 4): 4
       Hole11 (par 5): 4
       Hole12 (par 4): 3
       Hole13 (par 3): 3
       Hole14 (par 4): 5
       Hole15 (par 5): 4
       Hole16 (par 4): 4
       Hole17 (par 3): 2
       Hole18 (par 4): 4
    
    Round 4
       Hole1 (par 4): 4
       Hole2 (par 4): 4
       Hole3 (par 5): 5
       Hole4 (par 3): 2
       Hole5 (par 4): 3
       Hole6 (par 4): 5
       Hole7 (par 5): 5
       Hole8 (par 3): 4
       Hole9 (par 4): 3
       Hole10 (par 4): 5
       Hole11 (par 5): 5
       Hole12 (par 4): 4
       Hole13 (par 3): 6
       Hole14 (par 4): 5
       Hole15 (par 5): 5
       Hole16 (par 4): 3
       Hole17 (par 3): 3
       Hole18 (par 4): 4

  2. #2
    Join Date
    May 2013
    Posts
    2
    So far this is what I got:
    golfers.xsd:
    Code:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                targetNamespace="urn:golfer"
                xmlns:bks="urn:golfer">
    
    
      <xsd:element name="golfer" type="bks:GolferForm"/>
    
    
      <xsd:complexType name="GolferForm">
        <xsd:sequence>
          <xsd:element name="golfer" 
                      type="bks:GolferForm" 
                      minOccurs="0" 
                      maxOccurs="unbounded"/>
          </xsd:sequence>
      </xsd:complexType>
    
    
      <xsd:complexType name="GolferForm">
        <xsd:sequence>
          <xsd:element name="name"   type="xsd:string"/>
          <xsd:element name="news"    type="xsd:string"/>
          <xsd:element name="events"    type="xsd:float"/>
    	  <xsd:element name="cuts"    type="xsd:float"/>
          <xsd:element name="top10"    type="xsd:float"/>
    	  <xsd:element name="wins"    type="xsd:float"/>
          <xsd:element name="avg"    type="xsd:float"/>
          <xsd:element name="earn"    type="xsd:float"/>
          <xsd:element name="pid"   type="xsd:string"/>
        </xsd:sequence>
        <xsd:attribute name="id"   type="xsd:string"/>
      </xsd:complexType>
    </xsd:schema>
    scores.xsd:
    Code:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                targetNamespace="urn:scores"
                xmlns:bks="urn:scores">
    
    
      <xsd:element name="scores" type="bks:ScoresForm"/>
    
    
      <xsd:complexType name="ScoresForm">
        <xsd:sequence>
          <xsd:element name="scores" 
                      type="bks:ScoresForm" 
                      minOccurs="0" 
                      maxOccurs="unbounded"/>
          </xsd:sequence>
      </xsd:complexType>
    
    
      <xsd:complexType name="ScoresForm">
        <xsd:sequence>
          <xsd:element name="venue"   type="xsd:string"/>
          <xsd:element name="golfer"    type="xsd:string"/>
          <xsd:element name="finish"    type="xsd:float"/>
          <xsd:element name="score"    type="xsd:float" />
          <xsd:element name="winnings"   type="xsd:float" />
    	  
        </xsd:sequence>
        <xsd:attribute name="id"   type="xsd:string"/>
      </xsd:complexType>
    </xsd:schema>
    golfer.xml:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    
    
    <x:golfer xmlns:x="urn:golfer">
    	<golfer id="1">
    		<name>Brett Bierson</name>
    		<news>Bierson fresh off his 7th place finish in the Buick Invitational, tees off with the last group in the Southern Open. Bierson looks to finish in the Top 30 of the money list for the third consecutive year.</news>
    		<events>3</events>
    		<cuts>3</cuts>
    		<top10>2</top10>
    		<wins>0</wins>
    		<avg>70.9</avg>
    		<earn>980968</earn>
    		<pid>pga028</pid>
    	</golfer>
    </x:golfer>
    
    
    <x:scores xmlns:x="urn:scores">
    	<venue>Buick Invitational</venue>
    	<golfer>Brett Bierson</golfer>
    	<finish>7</finish>
    	<score>7</score>
    	<winnings>589231</winnings>
    	<round1>
    		<hole1>(par 4): 4</hole1>
    		<hole2>(par 4): 4</hole2>
    		<hole3>(par 5): 5</hole3>
    		<hole4>(par 3): 2</hole4>
    		<hole5>(par 4): 4</hole5>
    		<hole6>(par 4): 4</hole6>
    		<hole7>(par 5): 5</hole7>
    		<hole8>(par 3): 4</hole8>
    		<hole9>(par 4): 4</hole9>
    		<hole10>(par 4): 4</hole10>
    		<hole11>(par 5): 3</hole11>
    		<hole12>(par 4): 4</hole12>
    		<hole13>(par 3): 3</hole13>
    		<hole14>(par 4): 4</hole14>
    		<hole15>(par 5): 5</hole15>
    		<hole16>(par 4): 5</hole16>
    		<hole17>(par 3): 3</hole17>
    		<hole18>(par 4): 3</hole18>
    	</round1>
    	<round2>
    		<hole1>(par 4): 3</hole1>
    		<hole2>(par 4): 4</hole2>
    		<hole3>(par 5): 5</hole3>
    		<hole4>(par 3): 3</hole4>
    		<hole5>(par 4): 4</hole5>
    		<hole6>(par 4): 4</hole6>
    		<hole7>(par 5): 5</hole7>
    		<hole8>(par 3): 3</hole8>
    		<hole9>(par 4): 4</hole9>
    		<hole10>(par 4): 4</hole10>
    		<hole11>(par 5): 4</hole11>
    		<hole12>(par 4): 4</hole12>
    		<hole13>(par 3): 3</hole13>
    		<hole14>(par 4): 4</hole14>
    		<hole15>(par 5): 6</hole15>
    		<hole16>(par 4): 4</hole16>
    		<hole17>(par 3): 4</hole17>
    		<hole18>(par 4): 4</hole18>
    	</round2>
    	<round3>
    		<hole1>(par 4): 3</hole1>
    		<hole2>(par 4): 4</hole2>
    		<hole3>(par 5): 6</hole3>
    		<hole4>(par 3): 3</hole4>
    		<hole5>(par 4): 4</hole5>
    		<hole6>(par 4): 4</hole6>
    		<hole7>(par 5): 5</hole7>
    		<hole8>(par 3): 3</hole8>
    		<hole9>(par 4): 2</hole9>
    		<hole10>(par 4): 4</hole10>
    		<hole11>(par 5): 4</hole11>
    		<hole12>(par 4): 4</hole12>
    		<hole13>(par 3): 3</hole13>
    		<hole14>(par 4): 5</hole14>
    		<hole15>(par 5): 4</hole15>
    		<hole16>(par 4): 4</hole16>
    		<hole17>(par 3): 2</hole17>
    		<hole18>(par 4): 4</hole18>
    	</round3>
    	<round3>
    		<hole1>(par 4): 4</hole1>
    		<hole2>(par 4): 4</hole2>
    		<hole3>(par 5): 5</hole3>
    		<hole4>(par 3): 2</hole4>
    		<hole5>(par 4): 3</hole5>
    		<hole6>(par 4): 5</hole6>
    		<hole7>(par 5): 5</hole7>
    		<hole8>(par 3): 4</hole8>
    		<hole9>(par 4): 3</hole9>
    		<hole10>(par 4): 5</hole10>
    		<hole11>(par 5): 5</hole11>
    		<hole12>(par 4): 4</hole12>
    		<hole13>(par 3): 6</hole13>
    		<hole14>(par 4): 5</hole14>
    		<hole15>(par 5): 5</hole15>
    		<hole16>(par 4): 3</hole16>
    		<hole17>(par 3): 3</hole17>
    		<hole18>(par 4): 4</hole18>
    	</round3>
    </x:scores>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles