473,569 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to write XSD for an XML File

1 New Member
This is my XML File:

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8" ?> <rooms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="room.xsd">
  2.  <room> 
  3. <capacity>2 Adults</capacity>
  4.  <room_name>King Double</room_name> <cost_st>$1700</cost_st> 
  5. <cost_lt>$3400</cost_lt> 
  6. <loc>Ground Floor</loc>
  7.  <photo>fraise.jpg</photo> </room> </rooms>
This is my attempt at XSD, it's not working
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  4.  <xs:complexType name="Image">
  5.                                  <xs:simpleContent>
  6.                                             <xs:extension base="xs:anyURI">
  7.                                                  <xs:attribute name="src" type="xs:string"/>
  8.                                                  </xs:extension>
  9.                                   </xs:simpleContent>
  10.                          </xs:complexType>
  12.         <xs:element name="rooms">
  13.         <xs:complexType>
  14. <xs:sequence>
  16. <xs:element name="room" minOccurs="1" maxOccurs="unbounded">
  17.  <xs:element name="capacity" type="xs:string"/>
  18.                            <xs:element name="room_name" type="xs:string"/>
  19.                            <xs:element name="cost_st" type="xs:string"/>
  20.                            <xs:element name="cost_lt" type="Image"/>
  21.          <xs:element name="loc" type="xs:string"/>
  22.                            <xs:element name="photo" type="xs:Image"/>
  24.       </xs:element>
  25.       </xs:sequence>
  26.       </xs:complexType>
  27.       </xs:element>
  28.       </xs:schema>
Jan 5 '21 #1
0 3193

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

Similar topics

by: clintonG | last post by:
The application is a simple form of three textbox controls that results in writing an XML file to the file system of the application root when it runs on the local development machine. I've just used FTP to deploy this as my first ASP.NET application using a hosting provider using W2003 IIS6 noting the host provides a control panel that...
by: Lauren Quantrell | last post by:
I'd like to use my Access 2K application to write some text in the file properties of a Windows file. The properties I'm talking about are the properties you see whn you right click on a Windows file and then click on Properites, then the Summary tab. I want to be able to modify the Subject line and the Comments line in particular. I'm...
by: ben beroukhim | last post by:
I have huge number of legacy code which use standard files functions. I would like to pass a memory pointer rather than a FILE pointer. I am trying to use FILEs in the code to refer to memory buffers. Basically, I want to be able to use all the standard read and write functions, but I want them to refer to memory locations, rather than disk...
by: shefali | last post by:
Hi, I need to use an HTTPHandler to create and write files. I wanted to create the file in the directory that has this handler, and other handlers. For me, this directory is: c:\Inetpub\wwwroot\HttpHandlers. I get an error: "Access to the path "C:\Inetpub\wwwroot\HTTPHandlers\bidhero.ccn" is denied." I can have the code write files to...
by: Tim | last post by:
Hi, What I am trying to accomplish is to initiate remote desktop session from within my C# application to XP Pro machine NOT terminal services to a server. I have not found any way to do this with code (if you know of a way then I would love to hear about it). What I have created so far is; 1. Write RDP file to the HD from the code
by: Gregory Gadow | last post by:
I have a folder on \\webserver\wwwroot, called staticContent. The folder has several message of the day text files, such as RepMotd.text. I have an admin page, AdminMotd.aspx, that allows a user to view and edit the contents of the files. Webserver is running Win Server 2003 64-bit and IIS 6.0. The development machine is Win XP, using...
by: sheriff | last post by:
Dear friends, im a newbee for this forum and c++ im doing my MSc in Simulation Tech in mech. Engineering. My knowledge of c++ is very little which I had during my UG studies Long long ago .I am now forced to do some programming as a small part of my thesis work. Here goes my task and question. I want to read the text file and jus find the...
by: Swan | last post by:
Can anyone plz tell me,Can I write file on server using binary access,or it is only to write on local?(Actually I am creating OCX for Http File Upload Control in VB using API's.So for that I need to raed file from local and write it to server.) Thanking you!
by: teo | last post by:
hallo encoding loss here, i presume situation: Visual Web Developer 2005 creates a new html file with Visual Web Developer 2005 I write some odd chars
by: Bruno | last post by:
Hi! I have big .txt file which i want to read, process and write to another .txt file. I have done script for that, but im having problem with croatian characters (Š,Đ,Ž,Č,Ć). How can I read/write from/to file in utf-8 encoding? I read file with fileinput.input. thanks
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.