Original PDF Flash format xml-syntax-quick-reference  


Xml Syntax Quick Reference

Element Declaration
Attribute Declaration
<!ELEMENT name (content-model) >
<!ATTLIST element name declvalue default >
name of
keyword or
name of the
keyword
default value
keyword
attribute
element type, formal definition of the
ATTLIST
XML Syntax
what kind of
ELEMENT
its "tag"
element's allowed content
value or list of
values
Connectors
name of the
Quick Reference
associated
element
repeat for
,
“Then”
Follow with (in sequence)
each attribute

|
“Or”
Select (only) one from the group

Declared Value Keywords
Only one connector type per group — no mixing!
CDATA
Data character string (default if well-formed)
Occurrence Indicators
NMTOKEN
Name token
(no indicator) Required
One and only one
NMTOKENS One or more name tokens (spaces between)
?
Optional
None or one
ID
Unique identifier for element
*
Optional, repeatable None, one, or more
IDREF
Reference to ID on another element
+
Required, repeatable One or more
IDREFS
One or more IDREFs (spaces between)
ENTITY
Name of an entity (declared elsewhere)
Groupings
ENTITIES One or more names of entities
(
Start content model or group
Enumerated Value Descriptions
)
End content model or group
(a|b|c)
List of attribute values (Or between)
#PCDATA in Models (first, OR bars, asterisk)
NOTATION Names of notations (Requires a list of
(#PCDATA)
(x|y)
values as well as the keyword. Values
(#PCDATA | elem1 | elem2 )*
declared elsewhere with NOTATION.)
element
keyword
name
#PCDATA
always
Attribute Defaults
Vertical Bar "|"
include the *
"value"
If attribute is omitted, assume this value.
ANY Element Keyword
#REQUIRED Required. Document is not valid if no
<!ELEMENT name ANY >
value is provided.
name of the
keyword
#IMPLIED
Mulberry Technologies, Inc.
keyword
Optional. Not constrained; no default can
element type, ANY
ELEMENT
its "tag"
17 West Jefferson Street, Suite 207

be inferred; an application is free to handle
as appropriate.
Rockville, MD 20850 USA
EMPTY Element Keyword
#FIXED
Fixed value. (Requires a value as well as
Phone: +1 301/315-9631
<!ELEMENT name EMPTY >
"value" the keyword.) If the attribute appears with
Fax: +1 301/315-8285
info@mulberrytech.com
name of the
a different value, that’s an error.
keyword
http://www.mulberrytech.com
keyword
element type, EMPTY
ELEMENT
its "tag"

Reserved Attributes
xml:space Preserve whitespace or use default
xml:lang Indicate language of element and that
element’s attributes and children
Mulberry
Technologies, Inc.
Mulberry
Mulberry
Technologies, Inc.
© 2006 Mulberry Technologies, Inc.
Technologies, Inc. © 2006 Mulberry Technologies, Inc.


DOCTYPE Declaration
Parameter Entity Declarations
XML Declaration
<!DOCTYPE name External-ID [ declarations ] >
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
Internal Parameter Entity
name of the
the internal
Standalone declaration:
document
Version of the
subset of
<!ENTITY % name " whatever text " >
type
the DTD
XML specification
no: parsing affected by
pointer to
(optional)
another file
keyword
name of
entity value
external DTD subset
keyword
DSO
DSC
ENTITY
the entity
(any literal)
yes: parsing not affected by
DOCTYPE
Declaration
Declaration
external DTD subset
Subset Open Subset Close
percent sign "%"
shows this is a
single or double quotes,
Character encoding of the
' or ", must match
Internal Subset
parameter entity

document, expressed in
Latin characters, e.g. UTF-8, UTF-16,
D <?xml version="1.0"?>
EUC-JP, ISO-10646-UCS2
o
External Parameter Entity

c <!DOCTYPE whatnot
u
<!ENTITY % name External-ID >
m [
DOCTYPE declaration
e
includes other declarations
n
Processing Instruction
in an internal subset
t
name of

keyword
E ]>
the entity
<?target ***Some Stuff **** ?>
n
ENTITY
pointer to a file

t
i
percent sign "%"
Tags and text:
t
shows this is a
y
the document

parameter entity
Notation Declaration

External Subset
<!NOTATION name External-ID >
D <?xml version="1.0"?>
DOCTYPE declaration
General Entity Declarations
keyword
o
c
SYSTEM or PUBLIC identifier
<!DOCTYPE whatnot
NOTATION
refers to a DTD in a
u
(PUBLIC does not require URI)
m SYSTEM "whatnot.dtd" > external subset.
e
name of
n
Internal Entity
a file named:
t
the entity

whatnot.dtd
(FAX, JPG, CGS, etc.)
E
<!ENTITY name " whatever text " >
n
must be unique in DTD

t
i
entity value
t
keyword
y
Tags and text:
(any literal)
the document

ENTITY
name of
the entity
single or double quotes,
Comment
' or ", must match
Internal and External Subsets

<!-- Whatever you want to say! -->
D <?xml version="1.0"?> DOCTYPE declaration
o
External Unparsed Entity
<!DOCTYPE whatnot
refers to an external
Comment may contain any
c
u SYSTEM "whatnot.dtd" subset and includes an
characters except the string "--".
internal subset.

m [
<!ENTITY name External-ID NDATA name >
DTD is sum of the parts.
e
n
t ]>
a file named:

keyword
SYSTEM or
whatnot.dtd
E
ENTITY
PUBLIC identifier
Start Tag with Attribute (in document)
keyword NDATA
n
t
name of
followed by
i
the entity
notation name
<tag attributename = " attribute-value " >
t
Tags and text:
y
the document

Predefined General Entities
name of the
one or more
attribute
values
Conditional Section (DTD only)
Entity
Displays As
Character Value
name of
equals single or double quotes,
the element
&amp;
sign
' or ", must match
&
&#38;#38;

<![IGNORE[ declarations ]]>
<![INCLUDE[ declarations ]]>
&lt;
<
&#38;#60;

EMPTY Element (in document)
&gt;
>
&#62;
<name/>
External-ID
&apos;
'
&#39;
<name></name>
&quot;
SYSTEM "URI"
"
&#34;
OR
PUBLIC "Public ID" "URI"
CDATA Section (in document)
<![CDATA[ *** Some Stuff *** ]]>

Mulberry
Mulberry
Mulberry
Technologies, Inc.
Technologies, Inc.
© 2006 Mulberry Technologies, Inc.
Technologies, Inc.
© 2006 Mulberry Technologies, Inc.

© 2006 Mulberry Technologies, Inc.