Please support our XML, XSLT and XPATH advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Oct 2007
Posts: 48
Reputation: FallenPaladin is an unknown quantity at this point 
Solved Threads: 0
FallenPaladin FallenPaladin is offline Offline
Light Poster

Newbi error

 
0
  #1
Oct 17th, 2008
Hi all,

I am trying to create an xml file and schema that can be oppened by a .net app. However when the app trys to read from the data set, nothing is being held. I think this may be due to an error in the creation of the xml and xsd files. I would be greatful if someone could just check them over to see if there is anything out of place. Thanks

xml file
XML, XSLT and XPATH Syntax (Toggle Plain Text)
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2.  
  3. <tblEmployee xmlns="http://www.w3schools.com"
  4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  5. xsi:schemaLocation="trial.xsd">
  6. <employee empID="001">
  7. <name>Jon</name>
  8. <surname>Cox</surname>
  9. <age>31</age>
  10. </employee>
  11. </tblEmployee>

xsd file
XML, XSLT and XPATH Syntax (Toggle Plain Text)
  1. <?xml version="1.0"?>
  2. <xs:schema xmlns:xs="http://wwww.w3.org/2001/XMLSchema">
  3.  
  4. <xs:element name="tblEmployee">
  5. <xs:complexType>
  6. <xs:sequence>
  7. <xs:element name="employee">
  8. <xs:complexType>
  9. <xs:sequence>
  10. <xs:element name="name" type="xs:string"/>
  11. <xs:element name="surname" type="xs:string"/>
  12. <xs:element name="age" type="xs:integer"/>
  13. </xs:sequence>
  14. <xs:attribute name="empID" type="xs:string" use="required"/>
  15. </xs:complexType>
  16. </xs:element>
  17. </xs:sequence>
  18. </xs:complexType>
  19. </xs:element>
  20.  
  21. </xs:schema>
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 13
Reputation: gravyboat is an unknown quantity at this point 
Solved Threads: 2
gravyboat gravyboat is offline Offline
Newbie Poster

Re: Newbi error

 
0
  #2
Oct 27th, 2008
Everything is correct, except you have a typo:
<xs:schema xmlns:xs="http://wwww.w3.org/2001/XMLSchema">
(one too many 'w's in the schema namespace declaration; should be 'www.w3.org').
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 48
Reputation: FallenPaladin is an unknown quantity at this point 
Solved Threads: 0
FallenPaladin FallenPaladin is offline Offline
Light Poster

Re: Newbi error

 
0
  #3
Oct 28th, 2008
ok ty for your reply. It really was a newbi error
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the XML, XSLT and XPATH Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC