Question 1. How You Define Attributes In Xml Schema?
You have to note this in XML Schema all attributes are only declare as simple types element not as complex types. Because yes, Simple Elements has no attributes and attributes are only happen with Complex Elements. But key point is that in XML Schema always attribute declare as simple type itself.
Question 2. How You Use Schema Element In Xml Document?
We can say that
element is an root element in XML Schema.
Now, I have given you syntax of an XML Schema.
Yes, Schema element can also contain attribute.
Question 3. How You Define Complex And Simple Type Of Element?
In an XML Schema element are of two types.
- Complex Type Element
- Simple Type Element
Complex Type Element: Complex Type Elements are elements those contain elements.
Simple Type Element: Simple Type Elements are elements those don’t contain any other elements.
I explain you complex and simple type of element with an example:
Happy Birthday Dear
In the above example note element called as complex element because it contains elements(to, from, heading, body).And element to, from, heading and body called as Simple Type Element because it doesn’t contain any other element.
Question 4. Give An Example Shows Xml Document Has A Reference To An Xml Schema?
This example show you how XML document has a reference to an XML Schema.
Happy Birthday Dear
Question 5. Why We Use Xml Schemas?
I have given you some main reasons those made XML Schemas more powerful than DTD.
- Using XML Schemas we can describe permissible document content more easily.
- Using XML Schemas we can validate the rightness of data easily.
- Using XML Schemas we can work with data that comes from database more easily.
- Easy to switch data b/w different datatypes.
- Easy to define data formats and to made restrictions on data.
Question 6. Explain Why Xml Schemas Are Estensible?
Have given you some reasons that say XML Schemas are extensible. We can reuse our XML Schemas with in other XML Schemas. Also we can make our own data types which are derived from standard types. We can refer multiple schemas in a same XML document.
Question 7. What Is Xml Schema?
When we don’t want to use DTD than we can use XML Schema as an alternative of DTD.Using XML Schema we can describe the structure of XML document. We can also call XML Schema language as XML Schema Definition.
Some main of XML Schema are given below:
- We can define the child element among the elements.
- XML Schema also defines order and number of child element.
- Using XML Schema we can define data types, default and fixed values for attributes and elements.
XML Schema has W3C Recommendation since 02 May 2001.
Question 8. How You Define Elements Of Xml Document In An Xml Schema?
Simple I give you a example of an XML document. Then I told you define elements of this XML document in an XML Schema.
Example shows a XML Document.
Happy Birthday Dear
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”).
Question 9. How You Set Default And Fixed Values For Attributes?
Mean of default and fixed value in terms of attributes.
Default values are those values that are directly assigned to attribute when this attribute doesn’t contain any other defined value.
In the above example default value of Lang is “EN”.
Fixed values are those values that are directly assigned to attribute but it doesn’t contain any other defined value for this attribute.
In the above example fixed value of Lang is “EN”.
Question 10. How We Can Say Xml Schemas Are Successors Of Dtds?
Because of some reasons we can say that XML Schemas area successors of DTDs.
Some reasons are given below:
- As DTD, XML Schemas also written in XML.
- As DTD, XML Schemas also support Data types and namespaces.
But, XML Schemas is much good as DTDs.Because it is much richer and powerful than DTDs.And it also has some features that are made to solve problems comes in future.
Question 11. What Do You Mean By Simple Element?
Have already told you XML Schema has defined elements in two types.
- Simple Element
- Complex Element
Simple Element: In XML simple elements are that element that has contain only text doesn’t contain any other elements or attributes.
Text may be of any type that define in XML Schema
Like Boolean, string, date etc.
Where, ABC is used to define name of element and xyz is used to define data type of element.
XML Interview Questions
Oracle Interview Questions
SQL Interview Questions
Oracle E-Bussiness Suite Interview Questions
Oracle BPEL Interview Questions