Xml-Schema validation



I have a file .xsd which validates my xml file. The problem is that it works for one element, but when I have more than one it doesn't work and I can't find the problem.


This is my .xml file:



<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<UrlList>
<url>
<url>http://ift.tt/141p5ki;
<idUrl>72</idUrl>
<urlShort>http://ift.tt/1AmGYXo;
<numVisits>2</numVisits>
</url>
<url>
<url>http://ift.tt/141p5Ay;
<idUrl>73</idUrl>
<urlShort>http://ift.tt/1AmGWi6;
<numVisits>1</numVisits>
</url>
</UrlList>


And this is my .xsd file:



<xs:schema xmlns:xs="http://ift.tt/tphNwY">
<xs:element name="UrlList">
<xs:complexType>
<xs:sequence>
<xs:element ref="url"/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:element name="url">
<xs:complexType>
<xs:sequence>
<xs:element name="url" type="xs:string"/>
<xs:element name="idUrl" type="xs:integer"/>
<xs:element name="urlShort" type="xs:string"/>
<xs:element name="numVisits" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>


Need help please!!


No comments:

Post a Comment