Cover | Table of Contents
<
and >, but also &, '', and ') are used to separate the text that
identifies document structures from the text contained in those
structures. The text that represents the structure of the document is
called markup, as historically it
was extra information added to text documents to provide metadata,
formatting, or other information. Adding this information to a document
is referred to as "marking up" the document, although text and markup
are usually created simultaneously now.[2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] 1.0 [2] Char ::= [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] 1.1 [3] S ::= (#x20 | #x9 | #xD | #xA)+ [4] NameChar::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender
[45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>'
[46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children
[47] children ::= (choice | seq) ('?' | '*' | '+')?
[48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?
[49] choice ::= '(' S? cp ( S? '|' S? cp )+ S? ')'
[50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'
[51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*' | '(' S? '#PCDATA' S? ')'
[52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'
[53] AttDef ::= S Name S AttType S DefaultDecl
[54] AttType ::= StringType | TokenizedType | EnumeratedType
[55] StringType ::= 'CDATA'
[56] TokenizedType ::= 'ID'| 'IDREF' | 'IDREFS' | 'ENTITY' | 'ENTITIES' | 'NMTOKEN' |
'NMTOKENS'
[57] EnumeratedType ::= NotationType | Enumeration
[58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'
[59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'
[60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)
[61] conditionalSect ::= includeSect | ignoreSect
[62] includeSect ::= '<![' S? 'INCLUDE' S? '[' extSubsetDecl ']]>'
[63] ignoreSect ::= '<![' S? 'IGNORE' S? '[' ignoreSectContents* ']]>'
[64] ignoreSectContents ::= Ignore ('<![' ignoreSectContents ']]>' Ignore)*
[65].Ignore ::= Char* - (Char* ('<![' | ']]>') Char*)
<!ELEMENT message (#PCDATA)>
<!ATTLIST message date CDATA #REQUIRED>
<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet href="mine.css" type="text/css" ?>
<!--This is a very simple document.-->
<!DOCTYPE message [
<!ELEMENT message (#PCDATA)>
<!ATTLIST message date CDATA #REQUIRED>
]>
<message xmlns="http://simonstl.com/ns/examples/message"
xml:lang="eng" date="20051006" >
This is a message!
</message>
rng: to distinguish them from XML Schema
elements with identical names; however, the prefix is not normally
necessary in common usage, nor is it used in provided examples.datatypeLibrary and
ns attributes are legal on all
elements, though in some instances they have no effect. datatypeLibrary names the datatype library to
be used in the schema, and ns
specifies the default namespace for either the element or attribute,
depending on context. It is common to specify the W3C XML Schema
datatype namespace (1 <?xml version="1.0" encoding="US-ASCII"?>
2 <sch:schema xmlns:sch="http://www.ascc.net/xml/ schematron">
3 <sch:title>Horse schema</sch:title>
4 <sch:pattern>
5 <sch:rule context="horse">
6 <sch:assert test="@legs = '4'">Our horses should have
4 legs.</sch:assert>
7 <sch:assert test="snip">Our horses should have a snip.
</sch:report>
8 <sch:report test="blaze">This horse has a blaze.
</sch:report>
9 <sch:report test="star">This horse has a star.
</sch:report>
10 </sch:rule>
11 </sch:pattern>
12 </sch:schema>
Return to XML Pocket Reference