How attribute is different from a element in XSD?

Venkatesh
Venkatesh

Posted On: Feb 22, 2018

 

Element in XSD is nothing but an XML element such as opening tag, content, closing tag, etc. XSD Elements are the building blocks of your XML document. Elements are defined by their occurrence. An element can have sub-elements inside them. XSD elements can be of simpleType, complexType, or anyType.

The attribute in XSD is extra information about the element. The attribute is always a simpleType and has a fixed or default value. An element cannot have multiple attributes of the same name tag.

//example
<test id="5">somevalue</test>

Here, the test is an XSD element and ‘id’ is an attribute of the element.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    XSD Interview Questions

    What is XSD?

    XSD (XML Schema Definition) is a language definition that defines how to describe the elements in the Extensible Markup Language (XML). This definition is a recommendation of the World Wide Web Consor...

    XSD Interview Questions

    Explain the benifits of using XSD?

    The advantages of using XSD over other schema languages are,XSD is extensible. That is, You can use XSD to derive new elements from the existing elements. XSD doesn&rsquo;t require intermediate p...

    XSD Interview Questions

    Enlist different data types avaialable in XSD?

    There are two data types available in XSD. They are simpleType and complexType.simpleType - These are the built-in datatype present in XSD. There are many types available in ti. They are xsd:inte...