XSD Interview Questions & Answers

  1. Question 1. How You Define Attributes In Xml Schema?

    Answer :

    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.

    Syntax:

  2. Question 2. How You Use Schema Element In Xml Document?

    Answer :

    We can say that element is an root element in XML Schema.

    Now, I have given you syntax of an XML Schema.

    Syntax:

    ….

    ….

    Yes, Schema element can also contain attribute.

    Example:

    target Namespace=”http://www.r4r.co.in”

    xmlns=”http://www.r4r.co.in”

    elementFormDefault=”qualified”>

    ….

    ….

  3. XML Interview Questions

  4. Question 3. How You Define Complex And Simple Type Of Element?

    Answer :

    In an XML Schema element are of two types.

    1. Complex Type Element
    2. 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: 

    Abhi

    Sudhi

    Birthday Wish

    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.

  5. Question 4. Give An Example Shows Xml Document Has A Reference To An Xml Schema?

    Answer :

    This example show you how XML document has a reference to an XML Schema.

    Example:

    xmlns=”http://www.r4r.co.in”

    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”

    xsi:schemaLocation=”http://www.r4r.co.in note.xsd”>

    Abhi

    Sudhi

    Birthday Wish

    Happy Birthday Dear

  6. XML Tutorial

  7. Question 5. Why We Use Xml Schemas?

    Answer :

    I have given you some main reasons those made XML Schemas more powerful than DTD.

    1. Using XML Schemas we can describe permissible document content more easily.
    2. Using XML Schemas we can validate the rightness of data easily.
    3. Using XML Schemas we can work with data that comes from database more easily.
    4. Easy to switch data b/w different datatypes.
    5. Easy to define data formats and to made restrictions on data.
  8. Oracle Interview Questions

  9. Question 6. Explain Why Xml Schemas Are Estensible?

    Answer :

    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.

  10. Question 7. What Is Xml Schema?

    Answer :

    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:

    1. We can define the child element among the elements.
    2. XML Schema also defines order and number of child element.
    3. 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.

  11. XPath Tutorial
    SQL Interview Questions

  12. Question 8. How You Define Elements Of Xml Document In An Xml Schema?

    Answer :

    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.

    Abhi

    Sudhi

    Birthday Wish

    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”).

    target Namespace=”http://www.r4r.co.in”

    xmlns=”http://www.r4r.co.in”

    elementFormDefault=”qualified”>

  13. Question 9. How You Set Default And Fixed Values For Attributes?

    Answer :

    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.

    Example:

    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.

    Example:

    In the above example fixed value of Lang is “EN”.

  14. Oracle E-Bussiness Suite Interview Questions

  15. Question 10. How We Can Say Xml Schemas Are Successors Of Dtds?

    Answer :

    Because of some reasons we can say that XML Schemas area successors of DTDs.

    Some reasons are given below:

    1. As DTD, XML Schemas also written in XML.
    2. 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.

  16. XQuery Tutorial

  17. Question 11. What Do You Mean By Simple Element?

    Answer :

    Have already told you XML Schema has defined elements in two types.

    1. Simple Element
    2. 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.

    Syntax:

    Where, ABC is used to define name of element and xyz is used to define data type of element.

  18. Oracle BPEL Interview Questions