Skip to Main Content
XML and Related Technologies
book

XML and Related Technologies

by Atul kahate
May 2024
Beginner to intermediate content levelBeginner to intermediate
527 pages
17h 52m
English
Pearson India
Content preview from XML and Related Technologies
XML Schemas • 187
4.6 ATTRIBUTES
So far, we have ignored attributes in the context of schemas. We would now take a look at them. The
declaration of attributes is similar to that of elements. We specify the keyword called as attribute to define an
attribute. For example, suppose that we want to declare an attribute named designation. Then, its declaration
would be as follows:
<attribute name = “designation”/>
We can also add a data type to an attribute. For example, the above declaration can be modified as follows:
<attribute name = “designation” type = “xsd:string”/>
An attribute occurs only once, so we cannot use minOccurs or maxOccurs. However, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

XML Schema

XML Schema

Eric van der Vlist
XML in a Nutshell, 3rd Edition

XML in a Nutshell, 3rd Edition

Elliotte Rusty Harold, W. Scott Means
Beginning XML, 5th Edition

Beginning XML, 5th Edition

Danny Ayers, Liam R.E. Quin, Joe Fawcett

Publisher Resources

ISBN: 9781282652262