Unit Ii-Xml
Unit Ii-Xml
Unit Ii-Xml
XML Definition
XML stands for extensible markup language. XML was developed
around 1996 and is a subset of SGML. It's documents conform to SGML.
XML was made less complicated than SGML to enable its use on the
web. XML uses the ISO 10646 (Unicode) standard for encoding
characters. It is Meta-Markup language.
HTML
• The most popular markup language
• Defines a set of tags
• Designed for presentation for data
• HTML documents are processed by
• HTML processing application (Browser)
Strengths of HTML:
1. Easy to implement and author
• Small number of tags
• Simple relationship between tags
• Syntax-checking is very forgiving
• Limited number of formats possible
• Viewers can be small and simple
2. HTML trades power for ease of use
Weakness of HTML:
So XML is Born!
Motivations
• HTML would not work for publishing in general case
• Web application would require a method of encoding data that
could drive arbitrarily complex distributed processes
• Without XML, HTML would be replaced by a more powerful binary
and proprietary format
XML Design Goals
• XML shall be straightforwardly usable over the Internet.
• XML shall support a wide variety of applications.
• XML shall be compatible with SGML.
• It shall be easy to write programs, which process XML
documents.
• The number of optional features in XML is to be kept to the
absolute minimum, ideally zero.
• XML documents should be human legible and reasonably clear.
• The XML design should be prepared quickly.
• The design of XML shall be formal and concise.
• XML documents shall be easy to create.
• Terseness in XML markup is of minimal importance.
XML USES:
When I first began to read about XML, I had to ask, "What are its
practical uses?". I also wondered where it is actually being used
currently and how can I actually use it. I was not aware of any tools
that I could use to display XML. I did not know how I could see the
results of my XML documents. However many modern web browsers
today will display XML such as Internet Explorer version 5 or later.
Advantages
Since HTML has been so widely used and works so well (with some
weaknesses) I had to wonder what the advantages of using XML are. A
few are listed below:
• You can define your own elements and thereby support a much
wider variety of information display. XML may be used to
describe chemical structures, or other scientific or artistic data
that cannot be readily displayed using HTML.
Unit - II XML
3
XML Architecture
Unit - II XML
3
standardization are not carried out by the W3C but by other industrial
or governmental standardization bodies.
XML Namespaces:
• An XML namespace is a collection of names (markup
vocabulary)
identified by a URI reference
used in XML documents as element and attribute names
• Uses
universally agreed names
combination of names from different DTDs without name
conflicts
But not combination of different DTDs
Ex:
We may use the element book to mark up data about one of our
publications:
A stamp collector may also create an element book to mark up
data about a book of stamps. If both of these elements were used in
the same document there would be a naming collision & it would be
difficult to determine which kind of data each element contained.
Namespaces provide a means for document authors to
prevent collisions.
Ex: -
<subject>Math</subject>
and
<subject>crocin</subject>
Ex:
Use the XML namespace keyword xmlns to create two
namespace prefixes: text & image are called Uniform Resource
Identifiers (URI); by definition URI is a series of characters used to
differentiate names.
<?xml version=”1.0”>
<!—Namespaces
<directory xmlns:text=”urn:deitel:textinfo”
xmlns:image=”urn:deitel:imageinfo”>
<text:file filename=”book.xml”>
<text:description>A Book list</text:description>
</text:file>
<image:file filename=”funny.jpg”>
Unit - II XML
3
These URLs are never visited by the parser they only represent a
series of characters for differentiating names & nothing more. The URIs
need not even exist or be properly formed. We declare a default
namespace using the xmlns attribute with a URI as its value.
Ex: -
<directory xmlns=”urn:deitel:textInfo”
xmlns:image=”urn:deitel:imageInfo”>
<file filename=”book.html”>
<description>A book list</description>
</file>
<image:dile dilename=”funny.jpg”>
<image:description>A funny picture</image:description>
</image:file>
</directory>
Parsers can support the document object model & simple API for
XML(SAX) for accessing a documents content programmatically using
languages such as java, python, c Etc;
Unit - II XML
3
Notice the minus sign (-) & plus sign (+) in the left margins (not a
part of XML document); it was placed by IE5, for all e3lements that
contain one or more child elements. Because these elements store
other elements they are called container elements.
Characters:
A character set consists of the characters that may be
represented in a document.
Character set:
XML documents may contain the following characters: carriage
returns, line feeds & Unicode. Unicode is a standard of the Unicode
consortium. Its goal is to enable computers to process the characters
for most of the world’s major languages.(www.uni-code.org).
Ex: <message><&></message>
Ex:
<?xml version=”1.0”?>
<!—fig, lang.xml-- >
<!DocType welcome system “lang.ddtd”>
<welcome>
<from>
<!—Arabic -- >
داي
ت㻲لأن د
<! – entity -- >
&#assoc;
</form>
<subject>
<! – welcome to Arabic subject -- >
أهلا
ًبكم
فيِعا
Unit - II XML
3
لم
&text;
</subject>
</welcome>
ex:
<! – lang.dtd -- >
<!ELEMENT wecome(from,subject)>
<!ELEMENT from(#PCDATA)>
<!ELEMENT subject(#PCDATA)>
<!ENTITY assoc
“أسّشِ
<!ENTITY text
“اليون
<img src=”image.gif”/>
forward slash (/) for termination.
CDATA sections:
Sections of an XML document called CDATA section, it may
contain text, reserved characters & white characters. Here character
data in a CDATA section is not processed by the XML parser. A
common use of a CDATA section is for scripting code.
Syntax:
<![CDATA[
Unit - II XML
3
//c++ comment
if(this getX()<5&& value[0]!=3]
cerr<<thisdisplayError();
]]>
CDATA sections can’t contain the text ]]>, because this is used to
terminate a CDATA section.
DTD Structure:
A DTD can comprise two parts: an external DTD subset and an
internal DTD subset. An external DTD subset is a DTD that exists
outside the content of the document, which is usually the case when a
common DTD is used, as in the medical example above. An internal
DTD subset is a DTD that is included within the XML document. A
document can contain one or both types of subsets. If a document
contains both, the internal subset is processed first and takes
precedence over any external subset. This is beneficial when an author
is using an external DTD but wants to customize some parts of the DTD
for a specific application. We'll look at an example of this in the section
Class DTDs.
Unit - II XML
3
<?xml version="1.0"?>
<!DOCTYPE EMAIL [
<!ELEMENT EMAIL (TO, FROM, CC, SUBJECT, BODY)>
<!ELEMENT TO (#PCDATA)>
<!ELEMENT FROM (#PCDATA)>
<!ELEMENT CC (#PCDATA)>
<!ELEMENT SUBJECT (#PCDATA)>
<!ELEMENT BODY (#PCDATA)>
]>
<EMAIL>
<TO>Jodie@msn.com</TO>
<FROM>Bill@msn.com</FROM>
<CC>Philip@msn.com</CC>
<SUBJECT>My First DTD</SUBJECT>
<BODY>Hello, World!</BODY>
</EMAIL>
Element Declarations:
Each element declaration contains the element name and the
type of data the element contains, called its content specification,
which consists of one of four types:
Data Types:
XML stays relatively simple when it comes to including data
types, but some tricky issues are worth a look. In document content,
XML allows for parsed character data (declared with the keyword
#PCDATA, as shown above) and character data (declared with the
Unit - II XML
3
<?xml version="1.0"?>
<LESSON>
<TITLE>Working with XML Markup</TITLE>
<EXAMPLE>
<![CDATA[<ELEMENT>A sample element</ELEMENT>]]>
</EXAMPLE>
</LESSON>
Structure Symbols:
XML uses a set of symbols for specifying the structure of an
element declaration. You have already seen some of these symbols,
such as the pipe and the comma. Table 4-1 identifies each of the
available symbols, the purpose of each symbol, an example of how
each is used, and what each symbol means.
Attributes:
In addition to defining the structure of an element and the kind
of content it contains, you can associate attributes with an element.
Unit - II XML
3
<HTML>
<HEAD>
<TITLE>Database Web Site</TITLE>
</HEAD>
<BODY>
<A HREF="http://mspress.microsoft.com">
Click here for a Web link
</A>
<BR>
<IMG SRC="Schemas2.gif" border="0" ALT="A Schema
Map">
</BODY>
</HTML>
The Anchor element (indicated by the <A> tag) and the Image
element (indicated by the <IMG> tag) both contain attributes: the
Anchor element contains the HREF attribute, and the Image element
contains the attributes SRC, BORDER, and ALT. These attributes
provide additional information of use mostly to the browser. Notice
that the Anchor element contains the content, Click here for a Web
link, but the Image element appears to be an empty element—it
contains no visible content. In reality, however, this is not entirely true.
While the element does not contain content, the SRC attribute is a
filename that tells the processor which file to display. So in this case, a
graphic file is displayed on the Web page. This example presents an
important aspect about attributes. Attributes can, and usually do,
contain important information that is not part of the content of the
element. This means that, while the results of the attribute are usually
visible, often the attribute itself is more important to the XML
processor than it is to the person viewing the content.
Attribute Declarations:
name of the attribute. The Type entry identifies the type of attribute
being declared. The Default entry specifies the default for the
attribute.
Attribute Usage
Type
CDAT Only character data can be used in the attribute.
A
ENTIT Attribute value must refer to an external binary
Y entity declared in the DTD.
ENTITI Same as ENTITY, but allows multiple values
ES separated by white space.
ID Attribute value must be a unique identifier. If a
document contains ID attributes with the same value,
the processor should generate an error.
IDREF Value must be a reference to an ID declared
elsewhere in the document. If the attribute does not
match the referenced ID value, the processor should
generate an error.
IDREF Same as IDREF, but allows multiple values
S separated by white space.
NMTO Attribute value is any mixture of name token
KEN characters, which must be letters, numbers, periods,
dashes, colons, or underscores.
NMTO Same as NMTOKEN, but allows multiple values
KENS separated by white space.
NOTA Attribute value must refer to a notation declared
TION elsewhere in the DTD. Declaration can also be a list of
notations. The value must be one of the notations in
the list. Each notation must have its own declaration
in the DTD.
Enum Attribute value must match one of the included
Unit - II XML
3
The final part of the attribute declaration is the default for the
attribute value. The default can come in one of four types. Table 4-3
shows the available attribute defaults.
Default Usage
#REQUI Every element containing this attribute must specify
RED a value for that attribute. A missing value results in
an error.
#IMPLIE This attribute is optional. The processor can ignore
D this attribute if no value is found.
#FIXED This attribute must have the value fixedvalue. If the
fixedvalue attribute is not included in the element, fixedvalue is
assumed.
default Identifies a default value for an attribute. If the
element does not include the attribute, the value
default is assumed.
<?xml version="1.0"?>
<!DOCTYPE EMAIL [
<!ELEMENT EMAIL (TO+, FROM, CC*, BCC*, SUBJECT?,
BODY?)>
<!ATTLIST EMAIL
LANGUAGE (Western|Greek|Latin|Universal) "Western"
ENCRYPTED CDATA #IMPLIED
PRIORITY (NORMAL|LOW|HIGH) "NORMAL">
<!ELEMENT TO (#PCDATA)>
<!ELEMENT FROM (#PCDATA)>
<!ELEMENT CC (#PCDATA)>
<!ELEMENT BCC (#PCDATA)>
<!ATTLIST BCC
HIDDEN CDATA #FIXED "TRUE">
The HIDDEN attribute has been included for the Bcc element.
The HIDDEN attribute is a CDATA type, and since it has a default of
#FIXED, the default value is specified following the keyword #FIXED.
This attribute must always have the value specified in the DTD, in this
case TRUE.
NOTE: Even though the attribute name is HIDDEN and the value is
TRUE, the XML processor does not actually know what that means. In
other words, the word "HIDDEN" has no special meaning in XML; it
simply happens to be the attribute name used. It will be up to the
application to know what to do with the attribute and its value.
<?xml version="1.0"?>
<!DOCTYPE EMAIL [
<!ELEMENT EMAIL (TO+, FROM, CC*, BCC*, SUBJECT?,
BODY?)>
<!ATTLIST EMAIL
LANGUAGE (Western|Greek|Latin|Universal) "Western"
ENCRYPTED CDATA #IMPLIED
PRIORITY (NORMAL|LOW|HIGH) "NORMAL">
<!ELEMENT TO (#PCDATA)>
<!ELEMENT FROM (#PCDATA)>
<!ELEMENT CC (#PCDATA)>
<!ELEMENT BCC (#PCDATA)>
<!ATTLIST BCC
HIDDEN CDATA #FIXED "TRUE">
<!ELEMENT SUBJECT (#PCDATA)>
<!ELEMENT BODY (#PCDATA)>
]>
Unit - II XML
3
Entities:
You know that entities are used as containers for content and
that the content can reside in the XML document (as an internal entity)
or outside the document in an external file (an external entity). Most
entities must be declared in the DTD. (You'll recall that some
predefined entities are already built into XML and are used to display
characters normally used for markup.) Entity declarations follow the
same basic syntax used by other declarations:
Internal Entities:
Unit - II XML
3
Internal entities are declared in the DTD and contain the content
that will be used in the document. This line adds an internal entity
called SIGNATURE to the example XML document:
This entity will be added to the DTD, and (as you will see in the
"Entity References" section later in this chapter) whenever that entity
is referenced in the document, it will be replaced with the content of
the entity (Bill).
NOTE External entities can also reference other XML files. For
example, if you were putting together a book in XML, the master book
document could use entity references to the chapters. An entity
reference might be <!ENTITY CHAP01 SYSTEM "Chapter1.xml">. Using
such a reference would greatly reduce the size of the master
document and allow the individual chapter files to be self-contained.
Entity References:
You'll recall from Chapter 3 that entity references use a specific
syntax within a document: &EntityName;. When a processor
encounters an entity reference in a document, the reference tells the
processor that it should replace that reference with the content
declared in the entity.
<?xml version="1.0"?>
<!DOCTYPE EMAIL [
<!ELEMENT EMAIL (TO+, FROM, CC*, BCC*, SUBJECT?,
BODY?)>
<!ATTLIST EMAIL
LANGUAGE (Western|Greek|Latin|Universal) "Western"
ENCRYPTED CDATA #IMPLIED
PRIORITY (NORMAL|LOW|HIGH) "NORMAL">
<!ELEMENT TO (#PCDATA)>
<!ELEMENT FROM (#PCDATA)>
<!ELEMENT CC (#PCDATA)>
<!ELEMENT BCC (#PCDATA)>
<!ATTLIST BCC
HIDDEN CDATA #FIXED "TRUE">
Unit - II XML
3
Parameter Entities:
Although parameter entities work in much the same way that
general entities work, they have one important syntactical difference.
Parameter entities use the percent symbol (%) in both the declaration
and the reference. In the entity declaration, the percent symbol follows
the keyword !ENTITY but precedes the entity name, as shown here.
(Note that a single space is required before and after the % symbol.)
<!ENTITY % ENCRYPTION
"40bit CDATA #IMPLIED
128bit CDATA #IMPLIED">
This entity can now be referenced elsewhere in the DTD. For example:
Unit - II XML
3
This fragment tells the processor to ignore the Bcc element and
attribute list and to include the Subject element. As you look over this
code, you might think that the IGNORE keyword seems useful but that
the INCLUDE keyword seems unnecessary. You could accomplish the
same effect by eliminating the INCLUDE keyword. However, INCLUDE
proves its worth any time you want to quickly change what is being
included or ignored in the document. Consider the following code,
which changes both keywords into parameter entities and then places
content within the appropriate sections:
Processing Instructions:
Processing instructions (PIs) provide instructions for the
application that's processing the document. PIs usually appear in the
document prolog, but they can be placed anywhere in the XML
document. The most common PI is the XML declaration included at the
top of our sample XML documents:
<?xml version="1.0"?>
PIs are written with the sequence <?, followed by the PI name,
followed by a value or instruction, and concluded with ?>. The name,
or PI Target, identifies which application should be looking at the PI.
See section 2.6 in the XML 1.0 specification for more details about PIs.
Comments:
Unit - II XML
3
<?xml version="1.0"?>
<!DOCTYPE EMAIL [
<!-- This document could be used as an email template. -->
<!ELEMENT EMAIL (TO+, FROM, CC*, BCC*, SUBJECT?,
BODY?)>
<!ATTLIST EMAIL
LANGUAGE (Western|Greek|Latin|Universal) "Western"
ENCRYPTED CDATA #IMPLIED
PRIORITY (NORMAL|LOW|HIGH) "NORMAL">
<!ELEMENT TO (#PCDATA)>
External DTDs
You've also probably noticed that the majority of the document
space is taken up by the DTD. You can separate documents and DTDs
to make them a bit easier to work with. After creating a separate DTD,
you can reference it within any document.
To separate the DTD portion of our sample XML document, you
simply cut the DTD portion and paste it into a new text file. The new
filename should have the extension .dtd.
<?xml version="1.0"?>
<!ELEMENT EMAIL (TO+, FROM, CC*, BCC*, SUBJECT?,
Unit - II XML
3
BODY?)>
<!ATTLIST EMAIL
LANGUAGE (Western|Greek|Latin|Universal) "Western"
ENCRYPTED CDATA #IMPLIED
PRIORITY (NORMAL|LOW|HIGH) "NORMAL">
<!ELEMENT TO (#PCDATA)>
<!ELEMENT FROM (#PCDATA)>
<!ELEMENT CC (#PCDATA)>
<!ELEMENT BCC (#PCDATA)>
<!ATTLIST BCC
HIDDEN CDATA #FIXED "TRUE">
<!ELEMENT SUBJECT (#PCDATA)>
<!ELEMENT BODY (#PCDATA)>
<!ENTITY SIGNATURE "Bill">
<?xml version="1.0"?>
<!DOCTYPE EMAIL SYSTEM "Lst4_4.dtd">
<EMAIL LANGUAGE="Western" ENCRYPTED="128"
PRIORITY="HIGH">
<TO>Jodie@msn.com</TO>
<FROM>&SIGNATURE;@msn.com</FROM>
<CC>Philip@msn.com</CC>
<BCC>Naomi@msn.com</BCC>
<SUBJECT>Sample Document with External
DTD</SUBJECT>
<BODY>
Hello, this is &SIGNATURE;.
Take care, -&SIGNATURE;
</BODY>
</EMAIL>
Separating the DTD from the document greatly reduces the size
of the XML document file and provides some other benefits. Now that
the DTD is a separate file, it can be used in other documents by
anyone who has access to it. Another author can create a document
using the same structure with completely different content. And
because the new document would follow the DTD, it could be read by
any application that knows how to process that DTD.
Unit - II XML
3
<?xml version="1.0"?>
<Schema name="schemaname" xmlns="urn:schemas-
microsoft-com:xml-data">
<!-- Declarations go here -->
<ElementType name="elementname"
content="contenttype"/>
</Schema>
NOTE:
The Schema element must be derived from the xml-data
namespace urn:schemas-microsoft-com:xml-data. It is not necessary to
declare the namespace in the schema prolog.
While it is generally preferred to make the xml-data namespace
the default namespace, it is not required. However, by making the xml-
data namespace the default, you can avoid having to prefix all the
definitions in a schema document. The schema document below, for
example, does not assume that the xml-data namespace is the default.
Using the prefix declared in the namespace declaration, the following
schema document is equivalent to the previous schema example.
<?xml version="1.0"?>
<?xml:namespace ns="urn:schemas-microsoft-com:xml-data"
prefix="s"?>
<s:Schema name="schemaname">
Unit - II XML
3
<ElementType name="plant">
<element type="name"/>
</ElementType>
</Schema>
Local-Level Declarations
A declaration that appears inside another declaration that is not
at the top level is considered local-level in scope. A local-level
declaration can be referenced only within the declaration in which it is
declared. For example, let's add a local-level attribute declaration to
the plant element type declaration.
<Schema name="wildflowers"
xmlns="urn:schemas-microsoft-com:xml-data">
<ElementType name="name" content="textOnly"/>
<ElementType name="plant">
<element type="name"/>
<attribute name="bestseller" values="yes no"/>
</ElementType>
</Schema>
In this example, the attribute bestseller can be used only in the
plant element type declaration.
Unit - II XML
3
Note: You have probably seen several new concepts in the examples
above that we have not discussed before. Don't worry. This brief
introduction is included here to give you some context for what comes
next.
Content Type
Each type of element can contain one of four content categories:
empty, text only, subelements only, or a mixture of text and
subelements. The category is expressed as the value of the content
attribute in the element type declaration. Here are the possible values:
empty—cannot contain any content
textOnly—can contain text content only
eltOnly—can contain subelements only
mixed—can contain a mixture of text and subelements
In the example below, the plant element type can contain text
content only:
<ElementType name="plant" content="textOnly"/>
In addition to content constraints, an element type declaration
can also specify the pattern in which the elements in the declaration
can appear. This is done using the order attribute.
Content Order
The order attribute constrains the pattern for the types of
elements declared in an element type declaration. These are the
possible values:
seq—Elements must appear in the same sequential order as the
elements referenced in the element type declaration. This is the
default pattern for eltOnly content.
one—One subelement of the type declared in the element type
declaration must appear in the parent element.
all—An element of each type declared in the element type
declaration must appear as a subelement, but the subelements can
appear in any order.
Unit - II XML
3
Note that the content type of the plant element was constrained
to eltOnly. We did not have to explicitly declare the value of the order
attribute because seq is the default content order for eltOnly content.
The order attribute was included for illustrative purposes only.
Element content can be further constrained by grouping element
references via the Group element. The Group element supports the
order attribute with the same values used for the ElementType
element. Now let's create a new content model that uses a Group
element.
<ElementType name="name" content="textOnly"/>
<ElementType name="zone" content="textOnly"/>
<ElementType name="light" content="textOnly"/>
<ElementType name="price" content="textOnly"/>
<ElementType name="plant" content="eltOnly"
order="seq">
<element type="name"/>
<group order="one">
<element type="zone"/>
<element type="light"/>
<element type="price"/>
</group>
</ElementType>
Unit - II XML
3
Here the plant element type must contain a name, and then
following the name, only one of the elements Zone, Light, or Price.
Note that if an order constraint is not declared for the group, the
default value will be the order for the enclosing element type
declaration. So in the example above, if an order was not specified for
the group, the default order value would have been seq.
appear exactly once inside any given element type. Let's look at an
example of how this might work. (Here the group must appear at least
once, but it can appear more often than that.)
AttributeType Elements
As with the ElementType element, each AttributeType element
must specify a name. The example below declares an attribute type
named bestseller.
<AttributeType name="bestseller"/>
<AttributeType name="bestseller"/>
<ElementType name="plant">
<attribute type="bestseller"/>
</ElementType>
Unit - II XML
3
In this example, the attribute can now appear as part of the Plant
element in a document.
Default Values
An attribute type declaration or reference can also include a
default attribute, which indicates the default attribute value. For
example, in the schema below, the default attribute is included in the
attribute type declaration.
<AttributeType name="bestseller" default="yes"/>
<ElementType name="plant">
<attribute type="bestseller"/>
</ElementType>
This specifies that the value of the default attribute will apply
everywhere that the attribute type is used in an element. If we change
the example as shown here
<AttributeType name="bestseller"/>
<ElementType name="plant">
<attribute type="bestseller" default="no"/>
</ElementType>
the value of the default attribute will apply to the attribute only
when it is used inside the Plant element. If default attributes are
specified in both places, as shown here
<AttributeType name="bestseller" default="yes"/>
<ElementType name="plant">
<attribute type="bestseller" default="no"/>
</ElementType>
the default attribute specified at the declaration level takes
precedence. So, using the above example, the default value yes would
apply everywhere the bestseller attribute is used, except when it
appears in the Plant element, where the default value no would apply.
Required Attribute
An attribute type declaration or reference can contain a required
attribute that identifies whether the attribute must have a value.
<ElementType name="plant">
<attribute type="bestseller" default="no" required="yes"/>
</ElementType>
Here the bestseller attribute in the Plant element must have a
value. Since it is combined with the default attribute, bestseller will
always contain that value if no other is specified.
Data Types
Unit - II XML
3
type Attribute
A data type is designated by referencing it using the type
attribute from the datatypes namespace. In the example below, we
specify a data type for the dateordered attribute type.
Attribute Data Types Table 10-2 shows the supported data types
for attributes.
Name Equivalent
id ID Attribute value must be a unique
identifier. If a document contains
more than one id attribute with the
same value, the processor should
generate an error.
string PCDATA Only character data can be
used in the attribute.
entity ENTITY The attribute value must refer to an
entity.
entitie ENTITIES Same as entity, but allows multiple
s values separated by white space.
idref IDREF Value must be a reference to an id
attribute declared elsewhere in the
document.
idrefs IDREFS Same as idref, but allows multiple
values separated by white space.
nmtok NMTOKE Attribute value is any mixture of
en N name token characters, which must
be letters, numbers, periods, dashes,
colons, or underscores.
Nmto NMTOKE Same as nmtoken, but allows
kens NS multiple values separated by white
space.
enum ENUMER Attribute value must match one of
eration ATION the included values.
notati NOTATIO Attribute value must refer to a
on N notation.
Element Data Types
lean
stri Character data.
ng
floa A signed, unsigned, whole, or fractional number.
t Essentially no limit on number of digits. Can contain an
exponent.
int An unsigned whole number, no exponent.
nu A signed, unsigned, whole, or fractional number.
mber Essentially no limit on number of digits. Can contain an
exponent.
uri Universal Resource Identifier.
uui Hexadecimal digits that represent octets. Optional
d hyphens should be ignored.
min and max: The min and max attributes define inclusive lower and
upper limits for the data in an element or attribute. For example, the
attribute below can contain a minimum value of 0 and a maximum
value of 50.
<attribute type="inventory" dt:type="int" dt:min="0"
dt:max="50"/>
enumeration At times it might be necessary to enumerate values
in an element or attribute. This is defined with the enumeration data
type and the values attribute.
<ElementType name="growinginfo">
<datatype dt:type="enumeration" dt:values="sun partialsun
shade"/>
</ElementType>
<ElementType name="plant">
<element type="name"/>
</ElementType>