More Related Content
Similar to Xml Syntax Quick Reference
Similar to Xml Syntax Quick Reference (6)
Xml Syntax Quick Reference
- 1. Element Declaration Attribute Declaration
name
<!ELEMENT (content-model) > <!ATTLIST element name declvalue default >
keyword or
name of
name of the
XML Syntax
keyword default value
attribute
element type, formal definition of the
keyword ATTLIST what kind of
element's allowed content
ELEMENT its quot;tagquot; value or list of
values
Quick Reference
name of the
Connectors 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
NMTOKENS One or more name tokens (spaces between)
(no indicator) Required One and only one
ID Unique identifier for element
? Optional None or one
Reference to ID on another element
IDREF
* Optional, repeatable None, one, or more
One or more IDREFs (spaces between)
IDREFS
+ Required, repeatable One or more
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 always
#PCDATA Attribute Defaults
Vertical Bar quot;|quot; include the *
If attribute is omitted, assume this value.
quot;valuequot;
ANY Element Keyword
#REQUIRED Required. Document is not valid if no
name
<!ELEMENT ANY >
value is provided.
name of the Mulberry Technologies, Inc.
keyword #IMPLIED Optional. Not constrained; no default can
keyword element type, ANY
ELEMENT its quot;tagquot; 17 West Jefferson Street, Suite 207
be inferred; an application is free to handle
Rockville, MD 20850 USA
as appropriate.
EMPTY Element Keyword Phone: +1 301/315-9631
#FIXED Fixed value. (Requires a value as well as
name
<!ELEMENT EMPTY > Fax: +1 301/315-8285
quot;valuequot; the keyword.) If the attribute appears with
info@mulberrytech.com
a different value, that’s an error.
name of the keyword http://www.mulberrytech.com
keyword element type, EMPTY
ELEMENT its quot;tagquot;
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. Technologies, Inc. © 2000 Mulberry Technologies, Inc. (20000621)
© 2000 Mulberry Technologies, Inc.
- 2. DOCTYPE Declaration Parameter Entity Declarations XML Declaration
<!DOCTYPE name External-ID [ declarations ] > <?xml version=quot;1.0quot; encoding=quot;UTF-8quot; standalone=quot;noquot;?>
Internal Parameter Entity
name of the the internal Standalone declaration:
Version of the
document name
<!ENTITY % quot; whatever text quot; >
subset of
no: parsing affected by
type XML specification
the DTD
pointer to (optional) external DTD subset
entity value
another file name of
keyword
(any literal)
the entity
ENTITY
DSC yes: parsing not affected by
DSO
keyword Declaration
Declaration
DOCTYPE external DTD subset
percent sign quot;%quot;
Subset Close
Subset Open single or double quotes, Character encoding of the
shows this is a
' or quot;, must match
parameter entity document, expressed in
Internal Subset Latin characters, e.g. UTF-8, UTF-16,
D
External Parameter Entity
<?xml version=quot;1.0quot;?> EUC-JP, ISO-10646-UCS2
o
<!DOCTYPE whatnot
c
u name
<!ENTITY % External-ID >
DOCTYPE declaration
[
m
includes other declarations
e
Processing Instruction
n
in an internal subset
name of
t
keyword
the entity <?target ***Some Stuff **** ?>
E
ENTITY
]> pointer to a file
n
t
percent sign quot;%quot;
i
Tags and text:
shows this is a
t
Notation Declaration
the document
y
parameter entity
name
<!NOTATION External-ID >
External Subset
General Entity Declarations keyword
<?xml version=quot;1.0quot;?>
D
DOCTYPE declaration
o SYSTEM or PUBLIC identifier
NOTATION
c <!DOCTYPE whatnot refers to a DTD in a (PUBLIC does not require URI)
u
SYSTEM quot;whatnot.dtdquot; > external subset.
m
name of
Internal Entity
e
n
the entity
a file named:
t
whatnot.dtd (FAX, JPG, CGS, etc.)
name
<!ENTITY quot; whatever text quot;>
E
must be unique in DTD
n
t
entity value
i
keyword (any literal)
t
ENTITY name of
Tags and text:
y
Comment
the entity
the document single or double quotes,
' or quot;, must match
<!-- Whatever you want to say! -->
Internal and External Subsets
D <?xml version=quot;1.0quot;?>
External Unparsed Entity
DOCTYPE declaration
Comment may contain any
o
refers to an external
c <!DOCTYPE whatnot
subset and includes an characters except the string quot;--quot;.
SYSTEM quot;whatnot.dtdquot;
u name NDATA name
<!ENTITY External-ID >
internal subset.
m[
DTD is sum of the parts.
e
n
t ]> keyword SYSTEM or
a file named:
Start Tag with Attribute (in document)
whatnot.dtd ENTITY PUBLIC identifier keyword NDATA
E
name of
n followed by
t <tag attributename = quot; attribute-value quot; >
the entity notation name
i
Tags and text:
t
y
the document
Predefined General Entities one or more
name of the
values
attribute
Entity Displays As Character Value name of equals single or double quotes,
Conditional Section (DTD only) the element ' or quot;, must match
sign
& &#38;
&
<![IGNORE[ declarations ]]>
< &#60;
<
<![INCLUDE[ declarations ]]>
EMPTY Element (in document)
> >
>
<name/>
' '
’
External-ID <name></name>
" "
quot;
SYSTEM quot;URIquot;
OR
PUBLIC quot;Public IDquot; quot;URIquot;
CDATA Section (in document)
<![CDATA[ *** Some Stuff *** ]]>
Mulberry Mulberry Mulberry
Technologies, Inc. Technologies, Inc. Technologies, Inc.
© 2000 Mulberry Technologies, Inc. © 2000 Mulberry Technologies, Inc. © 2000 Mulberry Technologies, Inc.