HTML and CSS Reference
In-Depth Information
Table H-4 XML Element Rules
Symbol
Meaning
#PCDATA
Element contains parsed character data or text and conforms to XML constraints
(CDATA attributes are nonparsed character data)
element name (by itself)
Element name may be used one time only
element name ?
Element is used either once or not at all
Element has a one-to-many (1:n) relationship
element name 1
element name *
Element has a zero, or one-to-many (1:n) relationship
, (comma)
Used between elements to indicate order
| (bar)
Used between elements to indicate either/or
( )
Used to group related elements together; may be nested
Table H-5 Valid and Invalid Examples of XML Elements
Example
Comment
<FirstName></FirstName>
Valid
Valid empty element
<Picture SRC 5 "mypic.jpg" />
<_Project></_Project>
Valid
<First-Name></First-Name>
Valid
<Hanger_41></Hanger_41>
Valid
<Java Script></Java Script>
Invalid (contains a space)
<xmlproject></xmlproject>
Invalid (may not begin with xml)
<Para></PARA>
Invalid (start and end tags use different case)
<45Degree></45Degree>
Invalid (starts with a numeral)
Element attributes describe additional information about the element. Attribute values must
be enclosed in quotation marks (either single or double quotation marks are acceptable).
Attribute names follow the same rules as elements. Table H-6 shows the reserved attributes.
Table H-6 Reserved Attributes
Attribute
Comment
Example
xml:lang 5 "code"
where code indicates language of
element body
<Greet xml:lang="en">Hey</Greet>
xml:space 5 "action"
where action is either default or
preserve; preserve means preserve
white space, default means treat
white space based on default
settings
<Lines xml:space="preserve">This
is
one
line
</Lines>
xml:link 5 "type"
where type is simple, extended,
locator, group, or document
<a xml:link="simple"
href=http://www.w3.org>W3C</A>
XML Schema Definition (XSD)
An XML Schema Definition ( XSD ) describes in more exact detail the structure of
an XML document. Because the XML document can be used as a database, its structure
must be defined. The XSD describes the fields, the data types, and the values that can be
stored in a field. XSD files are external documents to the XML document instance and are
linked to the XML file in the root <xml> tag.
Search WWH ::




Custom Search