473,385 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

My XML Document and XML Schema are working together

2
Hi,
I seem to be having an issue linking my XML document and XML Schema together.
Both are not working, and do not seem to be validating when using:
http://tools.decisionsoft.com/schemaValidate/

Im not sure if what I have will work, or does work, as I can still output the XML via an XSLT fine :S

Ive attached my XML page and XML Schema, if someone could have a look I would be very grateful!
Thanks,

Sav.

XML PAGE
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?>
  2. <premierleague xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:noNamespaceSchemaLocation="myschema.xsd">
  4.  
  5.   <team area="London" leaguechamp="yes" europeanchamp="no" domesticwinner="yes">
  6.     <clubname>Arsenal F.C.</clubname>
  7.     <nickname>The Gunners</nickname>
  8.     <stadium>
  9.     <name>Emirates Stadium</name>
  10.     <capacity>60355</capacity>
  11.     </stadium>
  12.     <manager>Arsene Wenger</manager>
  13.     <captain>Francesc Fabregas</captain>
  14.     <sponsor>Emirates</sponsor>
  15.     <trophy>
  16.       <leaguetitle>13</leaguetitle>
  17.       <domestic>12</domestic>
  18.       <europeanchamp>0</europeanchamp>
  19.     </trophy>
  20.     <Image ID="1" URI="images/badges/arsenal.gif"/>
  21.   </team>
  22.  
  23.  <team area="Mid" leaguechamp="yes" europeanchamp="yes" domesticwinner="yes">
  24.     <clubname>Aston Villa F.C.</clubname>
  25.     <nickname>The Villa</nickname>
  26.     <stadium>
  27.     <name>Villa Park</name>
  28.     <capacity>42788</capacity>
  29.     </stadium>
  30.     <manager>Martin O'Neill</manager>
  31.     <captain>Stilian Petrov</captain>
  32.     <sponsor>Acorn</sponsor>
  33.     <trophy>
  34.       <leaguetitle>7</leaguetitle>
  35.       <domestic>12</domestic>
  36.       <europeanchamp>1</europeanchamp>
  37.     </trophy>
  38.    <Image ID="2" URI="images/badges/villa.gif"/>
  39.   </team>
  40.  
  41.  <team area="Mid" leaguechamp="no" europeanchamp="no" domesticwinner="yes">
  42.     <clubname>Birmingham City F.C.</clubname>
  43.     <nickname>Blues</nickname>
  44.     <stadium>
  45.     <name>St Andrew's</name>
  46.     <capacity>30009</capacity>
  47.     </stadium>
  48.     <manager>Alex McLeish</manager>
  49.     <captain>Lee Carsley</captain>
  50.     <sponsor>F and C Investments</sponsor>
  51.     <trophy>
  52.       <leaguetitle>0</leaguetitle>
  53.       <domestic>1</domestic>
  54.       <europeanchamp>0</europeanchamp>
  55.     </trophy>
  56.     <Image ID="3" URI="images/badges/bham.gif"/>
  57.   </team>
  58.  
  59. <team area="NorthWest" leaguechamp="yes" europeanchamp="no" domesticwinner="yes">
  60.     <clubname>Blackburn Rovers F.C.</clubname>
  61.     <nickname>Rovers</nickname>
  62.     <stadium>
  63.     <name>Ewood Park</name>
  64.     <capacity>31367</capacity>
  65.     </stadium>
  66.     <manager>Sam Allardyce</manager>
  67.     <captain>Ryan Nelsen</captain>
  68.     <sponsor>Crown Paints</sponsor>
  69.     <trophy>
  70.       <leaguetitle>1</leaguetitle>
  71.       <domestic>2</domestic>
  72.       <europeanchamp>0</europeanchamp>
  73.     </trophy>
  74.     <Image ID="4" URI="images/badges/blackburn.gif"/>
  75.   </team>
  76.  
  77.  
  78. <team area="NorthWest" leaguechamp="no" europeanchamp="no" domesticwinner="yes">
  79.     <clubname>Bolton Wanderers F.C.</clubname>
  80.     <nickname>The Trotters</nickname>
  81.     <stadium>
  82.     <name>Reebok Stadium</name>
  83.     <capacity>28723</capacity>
  84.     </stadium>
  85.     <manager>Owen Coyle</manager>
  86.     <captain>Kevin Davies</captain>
  87.     <sponsor>188BET</sponsor>
  88.     <trophy>
  89.       <leaguetitle>0</leaguetitle>
  90.       <domestic>4</domestic>
  91.       <europeanchamp>0</europeanchamp>
  92.     </trophy>
  93.     <Image ID="5" URI="images/badges/bolton.gif"/>
  94.   </team>
  95.  
  96. <team area="NorthWest" leaguechamp="no" europeanchamp="no" domesticwinner="yes">
  97.     <clubname>Burnley F.C.</clubname>
  98.     <nickname>The Clarets</nickname>
  99.     <stadium>
  100.     <name>Turf Moor</name>
  101.     <capacity>22546</capacity>
  102.     </stadium>
  103.     <manager>Brian Laws</manager>
  104.     <captain>Alexander</captain>
  105.     <sponsor>Cooke</sponsor>
  106.     <trophy>
  107.       <leaguetitle>0</leaguetitle>
  108.       <domestic>1</domestic>
  109.       <europeanchamp>0</europeanchamp>
  110.     </trophy>
  111.     <Image ID="6" URI="images/badges/burnley.gif"/>
  112.   </team>
  113.  
  114. <team area="London" leaguechamp="yes" europeanchamp="no" domesticwinner="yes">
  115.   <clubname>Chelsea F.C.</clubname>
  116.     <nickname>The Blues</nickname>
  117.     <stadium>
  118.     <name>Stamford Bridge</name>
  119.     <capacity>31367</capacity>
  120.     </stadium>
  121.     <manager>Carlo Ancelotti</manager>
  122.     <captain>John Terry</captain>
  123.     <sponsor>Samsung</sponsor>
  124.     <trophy>
  125.       <leaguetitle>3</leaguetitle>
  126.       <domestic>2</domestic>
  127.       <europeanchamp>0</europeanchamp>
  128.     </trophy>
  129.     <Image ID="7" URI="images/badges/chelsea.gif"/>
  130.   </team>
  131.  
  132. <team area="NorthWest" leaguechamp="no" europeanchamp="no" domesticwinner="yes">
  133.     <clubname>Everton F.C.</clubname>
  134.     <nickname>The Clarets</nickname>
  135.     <stadium>
  136.     <name>Goodison Park</name>
  137.     <capacity>22546</capacity>
  138.     </stadium>
  139.     <manager>David Moyes</manager>
  140.     <captain>Phillip Neville</captain>
  141.     <sponsor>Chang Beer</sponsor>
  142.     <trophy>
  143.       <leaguetitle>0</leaguetitle>
  144.       <domestic>1</domestic>
  145.       <europeanchamp>0</europeanchamp>
  146.     </trophy>
  147.     <Image ID="8" URI="images/badges/everton.gif"/>
  148.   </team>
  149.  
  150. <team area="London" leaguechamp="no" europeanchamp="no" domesticwinner="no">
  151.     <clubname>Fulham F.C.</clubname>
  152.     <nickname>The Cottagers</nickname>
  153.     <stadium>
  154.     <name>Craven Cottage</name>
  155.     <capacity>22700</capacity>
  156.     </stadium>
  157.     <manager>Roy Hodgson</manager>
  158.     <captain>Danny Murphy</captain>
  159.     <sponsor>LG</sponsor>
  160.     <trophy>
  161.       <leaguetitle>0</leaguetitle>
  162.       <domestic>0</domestic>
  163.       <europeanchamp>0</europeanchamp>
  164.     </trophy>
  165.     <Image ID="9" URI="images/badges/fulham.gif"/>
  166.   </team>
  167.  
  168. <team area="NorthEast" leaguechamp="no" europeanchamp="no" domesticwinner="no">
  169.     <clubname>Hull City A.F.C</clubname>
  170.     <nickname>The Tigers</nickname>
  171.     <stadium>
  172.     <name>KC Stadium</name>
  173.     <capacity>22404</capacity>
  174.     </stadium>
  175.     <manager>Ian Dowie</manager>
  176.     <captain>Ian Ashbee</captain>
  177.     <sponsor>Karoo</sponsor>
  178.     <trophy>
  179.       <leaguetitle>0</leaguetitle>
  180.       <domestic>0</domestic>
  181.       <europeanchamp>0</europeanchamp>
  182.     </trophy>
  183.     <Image ID="10" URI="images/badges/hull.gif"/>
  184.   </team>
  185.  
  186. <team area="NorthWest" leaguechamp="yes" europeanchamp="yes" domesticwinner="yes">
  187.     <clubname>Liverpool F.C.</clubname>
  188.     <nickname>The Reds</nickname>
  189.     <stadium>
  190.     <name>Anfield</name>
  191.     <capacity>45276</capacity>
  192.     </stadium>
  193.     <manager>Rafael Benitez</manager>
  194.     <captain>Steven Gerrard</captain>
  195.     <sponsor>Carlsberg</sponsor>
  196.     <trophy>
  197.       <leaguetitle>18</leaguetitle>
  198.       <domestic>17</domestic>
  199.       <europeanchamp>8</europeanchamp>
  200.     </trophy>
  201.     <Image ID="11" URI="images/badges/lfc.gif"/>
  202.   </team>
  203.  
  204. <team area="NorthWest" leaguechamp="no" europeanchamp="no" domesticwinner="yes">
  205.     <clubname>Manchester City F.C.</clubname>
  206.     <nickname>The Citizens</nickname>
  207.     <stadium>
  208.     <name>City of Manchester Stadium</name>
  209.     <capacity>47726</capacity>
  210.     </stadium>
  211.     <manager>Roberto Mancini</manager>
  212.     <captain>Kolo Toure</captain>
  213.     <sponsor>Etihad Airways</sponsor>
  214.     <trophy>
  215.       <leaguetitle>0</leaguetitle>
  216.       <domestic>6</domestic>
  217.       <europeanchamp>0</europeanchamp>
  218.     </trophy>
  219.     <Image ID="12" URI="images/badges/mancity.gif"/>
  220.   </team>
  221.  
  222. <team area="NorthWest" leaguechamp="yes" europeanchamp="yes" domesticwinner="yes">
  223.     <clubname>Manchester United F.C.</clubname>
  224.     <nickname>Red Devils</nickname>
  225.     <stadium>
  226.     <name>Old Trafford</name>
  227.     <capacity>75957</capacity>
  228.     </stadium>
  229.     <manager>Sir Alex Ferguson</manager>
  230.     <captain>Gary Neville</captain>
  231.     <sponsor>AIG</sponsor>
  232.     <trophy>
  233.       <leaguetitle>18</leaguetitle>
  234.       <domestic>15</domestic>
  235.       <europeanchamp>3</europeanchamp>
  236.     </trophy>
  237.     <Image ID="13" URI="images/badges/manutd.gif"/>
  238.   </team>
  239.  
  240. <team area="South" leaguechamp="yes" europeanchamp="no" domesticwinner="yes">
  241.     <clubname>Portsmouth F.C.</clubname>
  242.     <nickname>Pompey</nickname>
  243.     <stadium>
  244.     <name>Fratton Park</name>
  245.     <capacity>20224</capacity>
  246.     </stadium>
  247.     <manager>Avram Grant</manager>
  248.     <captain>David James</captain>
  249.     <sponsor>OKI</sponsor>
  250.     <trophy>
  251.       <leaguetitle>2</leaguetitle>
  252.       <domestic>2</domestic>
  253.       <europeanchamp>0</europeanchamp>
  254.     </trophy>
  255.     <Image ID="14" URI="images/badges/pompey.gif"/>
  256.   </team>
  257.  
  258. <team area="NorthWest" leaguechamp="no" europeanchamp="no" domesticwinner="yes">
  259.     <clubname>Stoke City F.C.</clubname>
  260.     <nickname>The Potters</nickname>
  261.     <stadium>
  262.     <name>Britannia Stadium</name>
  263.     <capacity>28383</capacity>
  264.     </stadium>
  265.     <manager>Tony Pulis</manager>
  266.     <captain>Abdoulaye Faye</captain>
  267.     <sponsor>Britannia</sponsor>
  268.     <trophy>
  269.       <leaguetitle>0</leaguetitle>
  270.       <domestic>1</domestic>
  271.       <europeanchamp>0</europeanchamp>
  272.     </trophy>
  273.     <Image ID="15" URI="images/badges/stoke.gif"/>
  274.   </team>
  275.  
  276. <team area="NorthEast" leaguechamp="yes" europeanchamp="no" domesticwinner="yes">
  277.     <clubname>Sunderland F.C.</clubname>
  278.     <nickname>The Black Cats</nickname>
  279.     <stadium>
  280.     <name>Stadium of Light</name>
  281.     <capacity>49000</capacity>
  282.     </stadium>
  283.     <manager>Steve Bruce</manager>
  284.     <captain>Lorik Cana</captain>
  285.     <sponsor>Boyle Sport</sponsor>
  286.     <trophy>
  287.       <leaguetitle>6</leaguetitle>
  288.       <domestic>2</domestic>
  289.       <europeanchamp>0</europeanchamp>
  290.     </trophy>
  291.     <Image ID="16" URI="images/badges/sunder.gif"/>
  292.   </team>
  293.  
  294. <team area="London" leaguechamp="yes" europeanchamp="yes" domesticwinner="yes">
  295.     <clubname>Tottenham Hotspur F.C.</clubname>
  296.     <nickname>Spurs</nickname>
  297.     <stadium>
  298.     <name>White Hart Lane</name>
  299.     <capacity>36310</capacity>
  300.     </stadium>
  301.     <manager>Harry Redknapp</manager>
  302.     <captain>Ledley King</captain>
  303.     <sponsor>Mansion.com</sponsor>
  304.     <trophy>
  305.       <leaguetitle>2</leaguetitle>
  306.       <domestic>12</domestic>
  307.       <europeanchamp>2</europeanchamp>
  308.     </trophy>
  309.     <Image ID="17" URI="images/badges/spurs.gif"/>
  310.   </team>
  311.  
  312. <team area="London" leaguechamp="no" europeanchamp="no" domesticwinner="yes">
  313.     <clubname>West Ham United F.C.</clubname>
  314.     <nickname>The Hammers</nickname>
  315.     <stadium>
  316.     <name>Upton Park</name>
  317.     <capacity>35303</capacity>
  318.     </stadium>
  319.     <manager>Gianfranco Zola</manager>
  320.     <captain>Matthew Upson</captain>
  321.     <sponsor>SBOBET</sponsor>
  322.     <trophy>
  323.       <leaguetitle>0</leaguetitle>
  324.       <domestic>3</domestic>
  325.       <europeanchamp>0</europeanchamp>
  326.     </trophy>
  327.     <Image ID="18" URI="images/badges/westham.gif"/>
  328.   </team>
  329.  
  330. <team area="NorthWest" leaguechamp="no" europeanchamp="no" domesticwinner="no">
  331.     <clubname>Wigan Athletic F.C.</clubname>
  332.     <nickname>Latics</nickname>
  333.     <stadium>
  334.     <name>DW Stadium</name>
  335.     <capacity>25138</capacity>
  336.     </stadium>
  337.     <manager>Roberto Martinez</manager>
  338.     <captain>Mario Melchiot</captain>
  339.     <sponsor>188BET</sponsor>
  340.     <trophy>
  341.       <leaguetitle>0</leaguetitle>
  342.       <domestic>0</domestic>
  343.       <europeanchamp>0</europeanchamp>
  344.     </trophy>
  345.     <Image ID="19" URI="images/badges/wigan.gif"/>
  346.   </team>
  347.  
  348. <team area="Mid" leaguechamp="yes" europeanchamp="no" domesticwinner="yes">
  349.     <clubname>Wolverhampton Wonderers  F.C.</clubname>
  350.     <nickname>Wolves</nickname>
  351.     <stadium>
  352.     <name>Molineux Stadium</name>
  353.     <capacity>29303</capacity>
  354.     </stadium>
  355.     <manager>Mick McCarthy</manager>
  356.     <captain>Karl Henry</captain>
  357.     <sponsor>Sporting Bet</sponsor>
  358.     <trophy>
  359.       <leaguetitle>3</leaguetitle>
  360.       <domestic>6</domestic>
  361.       <europeanchamp>0</europeanchamp>
  362.     </trophy>
  363.     <Image ID="20" URI="images/badges/wolves.gif"/>
  364.   </team>
  365.  
  366. </premierleague>
  367.  
XML SCHEMA
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?>
  2.  
  3. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  4.  
  5.  
  6. <xs:element name="premierleague">
  7.     <xs:complexType>
  8.     <xs:sequence>
  9.                 <xs:element name="team">
  10.                     <xs:complexType>
  11.                     <xs:attribute name="area" type="xs:string"/>
  12.                     <xs:attribute name="leaguechamp" type="xs:string"/>
  13.                     <xs:attribute name="europeanchamp" type="xs:string"/>
  14.                     <xs:attribute name="domesticwinner" type="xs:string"/>
  15.                   <xs:sequence>
  16.                                 <xs:element name="clubname" type="xs:string"/>
  17.                                 <xs:element name="nickname" type="xs:string"/>
  18.                                 <xs:element name="stadium">
  19.                                   <xs:complexType>
  20.                                  <xs:sequence>
  21.                                 <xs:element name="name" type="xs:string"/>
  22.                                 <xs:element name="capacity" type="xs:integer"/>
  23.                                  </xs:sequence>
  24.                                   </xs:complexType>
  25.                                 </xs:element>
  26.                                 <xs:element name="manager" type="xs:string"/>
  27.                                 <xs:element name="captain" type="xs:string"/>
  28.                                 <xs:element name="sponsor" type="xs:string"/>
  29.                                 <xs:element name="trophy">
  30.                                    <xs:complexType>
  31.                                   <xs:sequence>
  32.                                   <xs:element name="leaguetitle" type="xs:integer"/>
  33.                                           <xs:element name="domestic" type="xs:integer"/>
  34.                                           <xs:element name="europeanchamp" type="xs:integer"/>
  35.                                   </xs:sequence>
  36.                                    </xs:complexType>
  37.                                 </xs:element>
  38.                         </xs:sequence>
  39.                     </xs:complexType>
  40.                 </xs:element>
  41.             </xs:sequence>
  42.     </xs:complexType>
  43. </xs:element>
  44. </xs:schema>
  45.  
May 10 '10 #1

✓ answered by jkmyoung

In Team, put attributes after the sequence.
You're missing a definition for Image.

You have multiple team elements. Either specify that the sequence has maxoccurs="unbounded", or the team element has maxoccurs="unbounded"

3 1897
jkmyoung
2,057 Expert 2GB
In Team, put attributes after the sequence.
You're missing a definition for Image.

You have multiple team elements. Either specify that the sequence has maxoccurs="unbounded", or the team element has maxoccurs="unbounded"
May 10 '10 #2
SavRak
2
Thanks very much for your quick reply, apologies for not tagging the thread accordingly.

I think ive got it correct now, both my XML document and XML Schema pass through the validator.

I have defined the Image as below:

Expand|Select|Wrap|Line Numbers
  1. <xs:element name="Image">
  2.                                     <xs:complexType>
  3.                                         <xs:attribute name="ID" type="xs:integer"/>
  4.                                         <xs:attribute name="URI" type="xs:string"/>
  5.                                   </xs:complexType>
  6.                                 </xs:element>
  7.  

Is this adequate?

Thanks very much for your support.
May 10 '10 #3
jkmyoung
2,057 Expert 2GB
Looks to be so; you have more access to your data than we do.
May 11 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Christian Graf | last post by:
Hi, (sorry if this post might occur two times, but I can't find my first one from yesterday evening in this group) I have a bigger VC++6.0 project which is successfully compiled into a DLL. I...
1
by: mackenzie | last post by:
Hi, I found a great js calendar pop-up that i want to use on the same page where i'm already using a .vbs for client- side script. I can use either one individually w/o problems but, when I try...
0
by: Sokolov Yura | last post by:
Django Model is wonderfull. But SQLObject more flexible (and powerfull, as i think, and has already more db interfaces). But Django Model is tied with Django, and using Django with another OO...
13
by: David L Wright II | last post by:
Does anyone know when building a msi file under VB.Net 2003, it would try to install something from the VS 2005 Beta 1? I have both products installed. Thanks,
2
by: phil cunningham | last post by:
I am using Access to run a database within the company and also have a website that makes some of the information available to the general public And so far everything is working very well q....
0
by: Rod | last post by:
Well, I've taken the plunge and gotten myself my first domain. (I've worked on other peoples and of course at work, but never done my own domain.) With this new project my family and I will...
4
by: geshan | last post by:
In php5 I am not able to use include funciton and header("location:""" together please help.
2
by: buddyr | last post by:
Hello, I am having trouble with two combo boxes working together. two tables table1 table2 table1 fields -number and name table 2 fields -code and number ...
4
by: MimiMi | last post by:
I'm trying to put together a http response header. It seems to work, except for that I don't get the data string added correctly! I wouldn't be surprised if my problems have something to do with...
16
by: ashwinkumar18 | last post by:
hi, am very new to ajax and js . i tried using ajax for server validation in my jsp. i also used js for client side validation i have my js script for client side validation in a seperate file....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.