|
INTERVIEW QUESTIONS
XML
XML SCHEMA
DETAILS
Question: How you define elements of XML document in an XML Schema?
Answer: Simple I given you a example of an XML document. Than I told you define elements of this XML document in an XML Schema. Example shows a XML Document. <?xml version="1.0"?> <note> <to>Abhi</to> <from>Sudhi</from> <heading>Birthday Wish</heading> <body>Happy Birthday Dear</body> </note> Now, I will show you how to define these elements(to, from, heading, body)of XML document(saved with "note.xml")in an XML Schema (saved with "note.xsd").
<?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.r4r.co.in" xmlns="http://www.r4r.co.in" elementFormDefault="qualified"> <xs:element name="note"> <xs:complexType> <xs:sequence> <xs:element name="to" type="xs:string"/> <xs:element name="from" type="xs:string"/> <xs:element name="heading" type="xs:string"/> <xs:element name="body" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
|
|
|
Category |
XML Schema Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 7236 users |
Added on |
4/28/2014 |
Views |
66781 |
Rate it! |
|
|
Question:
How you define elements of XML document in an XML Schema?
Answer:
Simple I given you a example of an XML document. Than I told you define elements of this XML document in an XML Schema. Example shows a XML Document. <?xml version="1.0"?> <note> <to>Abhi</to> <from>Sudhi</from> <heading>Birthday Wish</heading> <body>Happy Birthday Dear</body> </note> Now, I will show you how to define these elements(to, from, heading, body)of XML document(saved with "note.xml")in an XML Schema (saved with "note.xsd").
<?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.r4r.co.in" xmlns="http://www.r4r.co.in" elementFormDefault="qualified"> <xs:element name="note"> <xs:complexType> <xs:sequence> <xs:element name="to" type="xs:string"/> <xs:element name="from" type="xs:string"/> <xs:element name="heading" type="xs:string"/> <xs:element name="body" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
Explain why XML Schemas are Estensible?
|
View Answer
|
|
Why we use XML Schemas?
|
View Answer
|
|
How we can say XML Schemas are successors of DTDs?
|
View Answer
|
|
What is XML Schema?
|
View Answer
|
|
Can you please explain me about the SCHEMA? and how important it is in the payroll?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All XML Schema Interview Questions & Answers - Exam Mode /
Learning Mode
|