A easy question about XML schema(.xsd file)!!!

Flowing_air 2006-08-30 03:10:57
This is my homework, xml document.

cwmm.xsd ----:


<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="file:///students/u2585798/comp3410/a1"
xmlns:cwmm="file:///students/u2585798/comp3410/a1"
elementFormDefault="qualified">

<xs:element name="workflow" type="xs:workflowtype"/>

<xs:complexType name="workflowtype">
<xs:sequence>
<xs:element name="workers" type="xs:workerstype" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="manuscripts" type="xs:manuscriptstype" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="workerstype">
<xs:sequence>
<xs:element name="worker" type="xs:workertype" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>



<xs:complexType name="workertype">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
<xs:element name="contact" type="xs:contacttype"/>
</xs:sequence>
<xs:attribute name="id" type="string"/>
</xs:complexType>

<xs:complexType name="contacttype">
<xs:sequence>
<xs:element name="phone" type="xs:string"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="address" type="xs:string"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="manuscriptstype">
<xs:sequence>
<xs:element name="manuscript" type="xs:manuscripttype"
minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="manuscripttype">
<xs:sequence>
<xs:element name="title" type="xs:string"/>
<xs:element name="author" type="xs:string"
minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="editor" type="xs:string"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="reviewer" type="xs:string"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="submission-date" type="xs:date"/>
<xs:element name="review-date" type="xs:date"/>
<xs:element name="edit-date" type="xs:date"/>
<xs:element name="submission-days" type="xs:string"/>
<xs:element name="review-days" type="xs:string"/>
<xs:element name="edit-days" type="xs:string"/>
<xs:element name="version" type="xs:versiontype"/>
</xs:sequence>
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="journal" type="xs:string"/>
</xs:complexType>

<xs:complexType name="versiontype">
<xs:sequence>
<xs:element name="link" type="xs:string"/>
<xs:element name="exposure" type="xs:string"/>
</xs:sequence>
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="status" type="xs:string"/>
<xs:attribute name="revision" type="xs:string"/>
</xs:complexType>


<xs:complexType name="journaltype">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="workerlist" type="xs:workerlisttype"
minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="workerlisttype">
<xs:sequence>
<xs:element name="worker" type="xs:string"/>
</xs:sequence>
<xs:attribute name="id" type="xs:string"/>
</xs:complexType>

</xs:schema>


----------------------------------------------------------------------------



cwmm.xml --------------:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="cwmm.xsl"?>

<cwmm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="cwmm.xsd">

<workflow>
<workers>
<worker id="1">
<name>Rodolfo Villarroel</name>
<contact>
<address>1 Foo St</address>
<phone>+612 6276 6453</phone>
</contact>
</worker>
<worker id="2">
<name>Eduardo Ferndez-Medina</name>
<contact>
<address>2 Foo St</address>
<phone>+612 6234 7635</phone>
</contact>
</worker>
<worker id="3">
<name>Mario Piattini</name>
<contact>
<address>3 Foo St</address>
<phone>+612 8734 324</phone>
</contact>
</worker>
</workers>

<manuscripts>
<manuscript id="1" journal="1">
<title>My Manuscript</title>
<author>1</author>
<author>5</author>
<editor>2</editor>
<reviewer>3</reviewer>
<reviewer>4</reviewer>

<submission-date>2006-08-25</submission-date>
<review-date>2006-08-30</review-date>
<editing-date>2006-08-10</editing-date>

<submission-days>10</submission-days>
<review-days>10</review-days>
<edit-days>10</edit-days>

<version id="1" status="draft" revision="1">
<link>http://example.com/draft1.html</link>
<exposure>Public Comments</exposure>
</version>
<version id="2" status="draft" revision="2">
<link>http://example.com/draft2.html</link>
<exposure>Private</exposure>
</version>
<version id="3" status="final" revision="1">
<link>http://example.com/final.html</link>
</version>
</manuscript>
</manuscripts>

<journal id="1">
<name>Journal of Research and Practice in Information Technology</name>
<workerlist>
<worker>1212</worker>
<worker>2323</worker>
</workerlist>
</journal>
<journal id="2">
<name>Conferences in Research and Practice in Information Technology</name>
<workerlist>
<worker>1212</worker>
<worker>2323</worker>
</workerlist>

</journal>
<journal id="3">
<name>Astroparticle Physics</name>
<workerlist>
<worker>1212</worker>
<worker>2323</worker>
</workerlist>

</journal>
</workflow>


...全文
332 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Flowing_air 2006-08-30
  • 打赏
  • 举报
回复
When i use "xmllint --noout --schema cwmm.xsd cwmm.xml" to compile...

It show the errors that...

n113lt08:~/comp3410/ass1> xmllint --noout --schema cwmm.xsd cwmm.xml
cwmm.xsd:7: element element: Schemas parser error : element decl. '{file:///stud
ents/u2585798/comp3410/a1}workflow', attribute 'type': The QName value '{http://
www.w3.org/2001/XMLSchema}workflowtype' does not resolve to a(n) type definition
.
cwmm.xsd:11: element element: Schemas parser error : element decl. '{file:///stu
dents/u2585798/comp3410/a1}workers', attribute 'type': The QName value '{http://
www.w3.org/2001/XMLSchema}workerstype' does not resolve to a(n) type definition.
cwmm.xsd:12: element element: Schemas parser error : element decl. '{file:///stu
dents/u2585798/comp3410/a1}manuscripts', attribute 'type': The QName value '{htt
p://www.w3.org/2001/XMLSchema}manuscriptstype' does not resolve to a(n) type def inition.
cwmm.xsd:18: element element: Schemas parser error : element decl. '{file:///stu dents/u2585798/comp3410/a1}worker', attribute 'type': The QName value '{http://w ww.w3.org/2001/XMLSchema}workertype' does not resolve to a(n) type definition.
cwmm.xsd:28: element element: Schemas parser error : element decl. '{file:///stu dents/u2585798/comp3410/a1}contact', attribute 'type': The QName value '{http:// www.w3.org/2001/XMLSchema}contacttype' does not resolve to a(n) type definition.
cwmm.xsd:30: element attribute: Schemas parser error : attribute decl. 'id', att ribute 'type': The QName value 'string' does not resolve to a(n) simple type def inition.
cwmm.xsd:44: element element: Schemas parser error : element decl. '{file:///stu dents/u2585798/comp3410/a1}manuscript', attribute 'type': The QName value '{http ://www.w3.org/2001/XMLSchema}manuscripttype' does not resolve to a(n) type defin ition.
cwmm.xsd:63: element element: Schemas parser error : element decl. '{file:///stu dents/u2585798/comp3410/a1}version', attribute 'type': The QName value '{http:// www.w3.org/2001/XMLSchema}versiontype' does not resolve to a(n) type definition.
cwmm.xsd:84: element element: Schemas parser error : element decl. '{file:///stu dents/u2585798/comp3410/a1}workerlist', attribute 'type': The QName value '{http ://www.w3.org/2001/XMLSchema}workerlisttype' does not resolve to a(n) type defin ition.
WXS schema cwmm.xsd failed to compile





Any one can help...It is noly one problem through this file. 100 marks for the kind hearted person.

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧