SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: XML Validation

  1. #1
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XML Validation

    Hi,

    I am having trouble validating an XML file with its schema and not sure why.

    Any help would be greatly appretiated!

    XML
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <people>
    	<person>
    		<id>1</id>
    		<name>Name 1</name>
    		<surname>Surname 1</surname>
    	</person>
    	<person>
    		<id>2</id>
    		<name>Name 2</name>
    		<surname>Surname 2</surname>
    	</person>
    	<person>
    		<id>3</id>
    		<name>Name 3</name>
    		<surname>Surname 3</surname>
    	</person>	
    </people>
    XSD
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema id="People" elementFormDefault="qualified" xmlns="http://tempuri.org/People.xsd" xmlns:mstns="http://tempuri.org/People.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    	<!--targetNamespace="http://tempuri.org/People.xsd"-->
    	<xs:element name="People">
    		<xs:complexType>
    			<xs:sequence>
    				<xs:element name="person" maxOccurs="unbounded">
    					<xs:complexType>
    						<xs:sequence>
    							<xs:element name="id" type="xs:integer" />
    							<xs:element name="name" type="xs:string" />
    							<xs:element name="surname" type="xs:string" />
    						</xs:sequence>
    					</xs:complexType>
    				</xs:element>
    			</xs:sequence>
    		</xs:complexType>
    	</xs:element>
    </xs:schema>

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,460
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)
    People vs. people ??

  3. #3
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks!


Bookmarks

Posting Permissions

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