Tryag File Manager
Home
-
Turbo Force
Current Path :
/
home
/
cluster1
/
data
/
bu01
/
1121861
/
html
/
maxwell-old-archive
/
litprog-1.0
/
example
/
Upload File :
New :
File
Dir
/home/cluster1/data/bu01/1121861/html/maxwell-old-archive/litprog-1.0/example/doc.xpp
<programlisting><sgmltag class="starttag">html xmlns="http://www.w3.org/TR/xhtml-basic" xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:src="http://nwalsh.com/xmlns/litprog/fragment" xmlns:ex='urn:publicid:-:Norman+Walsh:Schema Example:EN'</sgmltag> <sgmltag class="starttag">head</sgmltag> <sgmltag class="starttag">title</sgmltag>Document Schema<sgmltag class="endtag">title</sgmltag> <sgmltag class="endtag">head</sgmltag> <sgmltag class="starttag">body</sgmltag> <sgmltag class="starttag">div</sgmltag> <sgmltag class="starttag">h1</sgmltag>A Simple Document W3C XML Schema<sgmltag class="endtag">h1</sgmltag> <sgmltag class="starttag">p</sgmltag>This schema defines the <sgmltag class="starttag">tt</sgmltag>urn:publicid:-:Norman+Walsh:Schema Example:EN<sgmltag class="endtag">tt</sgmltag> namespace by defining several elements and their complex types. <sgmltag class="endtag">p</sgmltag> <sgmltag class="starttag">p</sgmltag>Documents that conform to this schema have the general form:<sgmltag class="endtag">p</sgmltag> <sgmltag class="starttag">pre</sgmltag><sgmltag class="genentity">lt</sgmltag>doc xmlns="urn:publicid:-:Norman+Walsh:Schema Example:EN"> <sgmltag class="genentity">lt</sgmltag>title>Sample Document<sgmltag class="genentity">lt</sgmltag>/title> <sgmltag class="genentity">lt</sgmltag>para>Some paragraphs.<sgmltag class="genentity">lt</sgmltag>/para> <sgmltag class="genentity">lt</sgmltag>/doc><sgmltag class="endtag">pre</sgmltag> <sgmltag class="endtag">div</sgmltag> <sgmltag class="starttag">div</sgmltag> <sgmltag class="starttag">h1</sgmltag><sgmltag class="emptytag">a name="types"</sgmltag>The Types<sgmltag class="endtag">h1</sgmltag> <sgmltag class="starttag">p</sgmltag>This schema only defines three element types: <sgmltag class="starttag">tt</sgmltag>doc<sgmltag class="endtag">tt</sgmltag>, <sgmltag class="starttag">tt</sgmltag>title<sgmltag class="endtag">tt</sgmltag>, and <sgmltag class="starttag">tt</sgmltag>para<sgmltag class="endtag">tt</sgmltag>.<sgmltag class="endtag">p</sgmltag> <sgmltag class="starttag">div</sgmltag> <sgmltag class="starttag">h2</sgmltag>The <sgmltag class="starttag">tt</sgmltag>doc<sgmltag class="endtag">tt</sgmltag> Type<sgmltag class="endtag">h2</sgmltag> <sgmltag class="starttag">p</sgmltag>This is a document.<sgmltag class="endtag">p</sgmltag> <sgmltag class="starttag">src:fragment id="doc.type"</sgmltag> <sgmltag class="starttag">xs:complexType name='doc'</sgmltag> <sgmltag class="starttag">xs:sequence</sgmltag> <sgmltag class="emptytag">xs:element ref="ex:title" minOccurs='0' maxOccurs='1'</sgmltag> <sgmltag class="starttag">xs:choice minOccurs='1' maxOccurs='unbounded'</sgmltag> <sgmltag class="emptytag">xs:element ref='ex:para'</sgmltag> <sgmltag class="endtag">xs:choice</sgmltag> <sgmltag class="endtag">xs:sequence</sgmltag> <sgmltag class="endtag">xs:complexType</sgmltag> <sgmltag class="endtag">src:fragment</sgmltag> <sgmltag class="endtag">div</sgmltag> <sgmltag class="starttag">div</sgmltag> <sgmltag class="starttag">h2</sgmltag>The <sgmltag class="starttag">tt</sgmltag>title<sgmltag class="endtag">tt</sgmltag> Type<sgmltag class="endtag">h2</sgmltag> <sgmltag class="starttag">p</sgmltag>This is a title.<sgmltag class="endtag">p</sgmltag> <sgmltag class="starttag">src:fragment id="title.type"</sgmltag> <sgmltag class="starttag">xs:complexType name='title' mixed="true"</sgmltag> <sgmltag class="emptytag">src:fragref linkend="role.attrib"</sgmltag> <sgmltag class="emptytag">xs:anyAttribute namespace="##other" processContents="lax"</sgmltag> <sgmltag class="endtag">xs:complexType</sgmltag> <sgmltag class="endtag">src:fragment</sgmltag> <sgmltag class="endtag">div</sgmltag> <sgmltag class="starttag">div</sgmltag> <sgmltag class="starttag">h2</sgmltag>The <sgmltag class="starttag">tt</sgmltag>para<sgmltag class="endtag">tt</sgmltag> Type<sgmltag class="endtag">h2</sgmltag> <sgmltag class="starttag">p</sgmltag>This is a paragraph.<sgmltag class="endtag">p</sgmltag> <sgmltag class="starttag">src:fragment id="para.type"</sgmltag> <sgmltag class="starttag">xs:complexType name='para' mixed="true"</sgmltag> <sgmltag class="emptytag">src:fragref linkend="role.attrib"</sgmltag> <sgmltag class="emptytag">xs:anyAttribute namespace="##other" processContents="lax"</sgmltag> <sgmltag class="endtag">xs:complexType</sgmltag> <sgmltag class="endtag">src:fragment</sgmltag> <sgmltag class="endtag">div</sgmltag> <sgmltag class="endtag">div</sgmltag> <sgmltag class="starttag">div</sgmltag> <sgmltag class="starttag">h1</sgmltag>The <sgmltag class="starttag">tt</sgmltag>role<sgmltag class="endtag">tt</sgmltag> Attribute<sgmltag class="endtag">h1</sgmltag> <sgmltag class="starttag">p</sgmltag>Each of the complex types in this schema allows an optional role attribute. The role attribute is simply a string.<sgmltag class="endtag">p</sgmltag> <sgmltag class="starttag">src:fragment id="role.attrib"</sgmltag> <sgmltag class="emptytag">xs:attribute name="role" type="xs:string"</sgmltag> <sgmltag class="endtag">src:fragment</sgmltag> <sgmltag class="endtag">div</sgmltag> <sgmltag class="starttag">div</sgmltag> <sgmltag class="starttag">h1</sgmltag>The Elements<sgmltag class="endtag">h1</sgmltag> <sgmltag class="starttag">p</sgmltag>This schema defines one element of each <sgmltag class="starttag">a href="#types"</sgmltag>complex type<sgmltag class="endtag">a</sgmltag>.<sgmltag class="endtag">p</sgmltag> <sgmltag class="starttag">src:fragment id="elements"</sgmltag> <sgmltag class="emptytag">xs:element name="doc" type="ex:doc"</sgmltag> <sgmltag class="emptytag">xs:element name="para" type="ex:para"</sgmltag> <sgmltag class="emptytag">xs:element name="title" type="ex:title"</sgmltag> <sgmltag class="endtag">src:fragment</sgmltag> <sgmltag class="endtag">div</sgmltag> <sgmltag class="starttag">div</sgmltag> <sgmltag class="starttag">h1</sgmltag>The Schema<sgmltag class="endtag">h1</sgmltag> <sgmltag class="starttag">p</sgmltag>The schema wrapper surrounds all these definitions.<sgmltag class="endtag">p</sgmltag> <sgmltag class="starttag">src:fragment id="top" mundane-result-prefixes="ex xs"</sgmltag> <sgmltag class="starttag">xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:ex='urn:publicid:-:Norman+Walsh:Schema Example:EN' targetNamespace='urn:publicid:-:Norman+Walsh:Schema Example:EN' elementFormDefault='qualified'</sgmltag> <sgmltag class="emptytag">src:fragref linkend="doc.type"</sgmltag> <sgmltag class="emptytag">src:fragref linkend="title.type"</sgmltag> <sgmltag class="emptytag">src:fragref linkend="para.type"</sgmltag> <sgmltag class="emptytag">src:fragref linkend="elements"</sgmltag> <sgmltag class="endtag">xs:schema</sgmltag> <sgmltag class="endtag">src:fragment</sgmltag> <sgmltag class="endtag">div</sgmltag> <sgmltag class="endtag">body</sgmltag> <sgmltag class="endtag">html</sgmltag> </programlisting>