Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Sample Assignment Solution Question 1 <?xml version="1.0" encoding="UTF-8"?> <!-- COMP5323 - Computing, PolyU--> <!DOCTYPE Resume SYSTEM "a1q1.dtd"> <Resume> <Name> <English>Peter Lee</English> <Chinese>李大,文</Chinese> </Name> <Address/> <Phones> <Office>23456789</Office> <Mobile>98765432</Mobile> </Phones> <Email>[email protected]</Email> <Self-Introduction>With over 5 years ... Marketing and Sales position</Self-Introduction> <Education> <From>2001</From> <To>2003</To> <School>Monash University, Australia</School> <Program>Master of Business Systems</Program> <Remarks>Distance Learning</Remarks> </Education> <Education> <From>1997</From> <To>2000</To> <School>University of Hong Kong</School> <Program>Bachelor of Business Administration</Program> <Remarks>Major in Marketing</Remarks> </Education> <Working-Experience> <From>March 2004</From> <To>Now</To> <Company>WXY Development Co Ltd</Company> <Position>Marketing Manager</Position> <Responsibilities>Plan sales and marketing activities in worldwide markets</Responsibilities> <Responsibilities>Develop international sales network establishments</Responsibilities> <Responsibilities>Explore new market segments worldwide</Responsibilities> <Responsibilities>Develop and launch a new brand onto local market successfully obtaining steady market share annually</Responsibilities> </Working-Experience> <Working-Experience> <From>December 2002</From> <To>March 2004</To> <Company>XYZ International Co Ltd</Company> <Position>Assistant Marketing Manager</Position> <Responsibilities>Plan online marketing strategies</Responsibilities> <Responsibilities>Responsible for implementing sales and marketing projects</Responsibilities> <Responsibilities>Conduct market research to monitor market changes</Responsibilities> </Working-Experience> <Working-Experience> <From>August 2001</From> <To>December 2002</To> <Company>ABC Global Co</Company> <Position>Marketing Executive</Position> <Responsibilities>Assis in executing marketing programmes</Responsibilities> <Responsibilities>Handle sales enquiries</Responsibilities> </Working-Experience> <Professional-Qualifications> <Organization>Professional Marketing Association, Hong Kong</Organization> <Details>2004 Member of Professional Marketing Association, Hong Kong</Details>
</Professional-Qualifications> <Skills>MS Word</Skills> <Skills>Excel</Skills> <Skills>PowerPoint</Skills> <Languages>English (spoken and written)</Languages> <Languages>Cantonese</Languages> <Languages>Putonghua</Languages> <References> <Name> <English/> <Chinese/> </Name> <Address/> <Phone/> <Request>Available upon request</Request> </References> <Availability>One month's notice</Availability> </Resume> <?xml version="1.0" encoding="UTF-8"?> <!-- COMP5323 - Computing, PolyU--> <!ELEMENT Resume (Name, Address, Phones, Email, Self-Introduction, Education+, Working-Experience*, Professional-Qualifications*, Skills*, Languages+, References+, Availability)> <!ELEMENT Name (English, Chinese)> <!ELEMENT Address (#PCDATA)> <!ELEMENT Phones (Office, Mobile)> <!ELEMENT Email (#PCDATA)> <!ELEMENT Self-Introduction (#PCDATA)> <!ELEMENT Education (From, To, School, Program, Remarks)> <!ELEMENT Working-Experience (From, To, Company, Position, Responsibilities+)> <!ELEMENT Professional-Qualifications (Organization, Details)> <!ELEMENT Skills (#PCDATA)> <!ELEMENT Languages (#PCDATA)> <!ELEMENT References (Name, Address, Phone, Request)> <!ELEMENT Availability (#PCDATA)> <!ELEMENT English (#PCDATA)> <!ELEMENT Chinese (#PCDATA)> <!ELEMENT Office (#PCDATA)> <!ELEMENT Mobile (#PCDATA)> <!ELEMENT From (#PCDATA)> <!ELEMENT To (#PCDATA)> <!ELEMENT School (#PCDATA)> <!ELEMENT Program (#PCDATA)> <!ELEMENT Remarks (#PCDATA)> <!ELEMENT Company (#PCDATA)> <!ELEMENT Position (#PCDATA)> <!ELEMENT Responsibilities (#PCDATA)> <!ELEMENT Organization (#PCDATA)> <!ELEMENT Details (#PCDATA)> <!ELEMENT Phone (#PCDATA)> <!ELEMENT Request (#PCDATA)>
<?xml version="1.0" encoding="UTF-8"?> <!-- edited with XML Spy v4.4 U (http://www.xmlspy.com) by Department of Computing (The Hong Kong Polytechnic University) --> <xs:schema targetNamespace="http://my.assignment/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://my.assignment/namespace" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="Resume"> <xs:annotation> <xs:documentation>Comment describing your root element</xs:documentation> </xs:annotation> <xs:complexType> <xs:sequence> <xs:element name="Name" type="NameType"/> <xs:element name="Address" type="xs:string"/> <xs:element name="Phones"> <xs:complexType> <xs:sequence> <xs:element name="Office" type="xs:string"/> <xs:element name="Mobile" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Email" type="xs:string"/> <xs:element name="Self-Introduction" type="xs:string"/> <xs:element name="Education" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="From" type="xs:gYearMonth"/> <xs:element name="To" type="xs:gYearMonth"/> <xs:element name="School" type="xs:string"/> <xs:element name="Program" type="xs:string"/> <xs:element name="Remarks" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Working-Experience" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="From" type="xs:gYearMonth"/> <xs:element name="To" type="xs:gYearMonth"/> <xs:element name="Company" type="xs:string"/> <xs:element name="Position" type="xs:string"/> <xs:element name="Responsibilities" type="xs:string" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Professional-Qualifications" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="Organization" type="xs:string"/> <xs:element name="Remarks" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Skills" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="Languages" type="xs:string" maxOccurs="unbounded"/> <xs:element name="References" maxOccurs="unbounded"> <xs:complexType>
<xs:sequence> <xs:element name="Name" type="NameType"/> <xs:element name="Address" type="xs:string"/> <xs:element name="Phone" type="xs:string"/> </xs:sequence> <xs:attribute name="request" type="xs:string" use="optional"/> </xs:complexType> </xs:element> <xs:element name="Availability" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="NameType"> <xs:sequence> <xs:element name="English" type="xs:string"/> <xs:element name="Chinese" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:schema> Some possible comparisons Ø Allow “Data Exchange” – Staffing Supplier + Staffing Customer + Candidate. Used in:
Hiring Company Transaction, Staffing Agency Transaction, Job Board Transaction Ø A general application that allow sorts of users to use, i.e. not tailored made to individual, thus
most fields will be empty or schemas not be used. For example, Patent History, Publication History, Speaking Events History, etc
Ø Design has been considered the “Date Privacy” and meets most requirements of most jurisdictions
Question 2 Preparation Work =============================================================================== Create a DEL file: SIGMOD.DEL <XDS FIL='D:/SIGMOD/SIGMODRECORD.XML' /> IMPORT FROM D:/SIGMOD/SIGMOD.DEL OF DEL XML FROM D:/SIGMOD INSERT INTO ALVIN.SIGMOD_TABLE =============================================================================== a) ------------------------------------------------------------------------------- xquery for $x in db2-fn:xmlcolumn('SIGMOD_TABLE.SIGMOD_COLUMN')/SigmodRecord/issue/articles/article where $x/authors/author = "Karen Botnich" return <result> {$x/title/text()} </result> 1 ------------------------------------------------------------------------------- <result> Annotated Bibliography on Data Design. </result> 1 record(s) selected. ------------------------------------------------------------------------------- xquery db2-fn:xmlcolumn('SIGMOD_TABLE.SIGMOD_COLUMN') //article[authors/author="Karen Botnich"]/title/text() 1 ------------------------------------------------------------------------------- Annotated Bibliography on Data Design. 1 record(s) selected. b) ------------------------------------------------------------------------------- xquery let $a:= count( for $x in db2-fn:xmlcolumn('SIGMOD_TABLE.SIGMOD_COLUMN') /SigmodRecord/issue[volume = 12] return $x/articles/article/title) return <result> {$a} </result> 1 ------------------------------------------------------------------------------- <result> 17 </result> 1 record(s) selected.
------------------------------------------------------------------------------- xquery count(db2-fn:xmlcolumn('SIGMOD_TABLE.SIGMOD_COLUMN') /issue[volume=12]//article/title) 1 ------------------------------------------------------------------------------- 17 1 record(s) selected. c) ------------------------------------------------------------------------------- xquery for $a := db2-fn:xmlcolumn('SIGMOD_TABLE.SIGMOD_COLUMN')/SigmodRecord /issue[volume = 12]/articles/article[endPage - initPage + 1 > 25] return <result> {$a/title} {$a/authors} </result> 1 ------------------------------------------------------------------------------- <result> <title> BUSINESS - An End-User Oriented Application Development Language. </title> <authors> <author position="00"> Peter B. Miller </author> <author position="01"> Sergey Tetelbaum </author> <author position="02"> Kincade N. Webb </author> </authors> </result> <result> <title> Final Report of the ANSI/X3/SPARC DBS-SG Relational Database Task Group. </title> <authors> <author position="00"> Michael L. Brodie </author> <author position="01"> Joachim W. Schmidt </author> </authors> </result> 2 record(s) selected. ------------------------------------------------------------------------------- xquery db2-fn:xmlcolumn('SIGMOD_TABLE.SIGMOD_COLUMN')//issue[volume=12] //article[endPage - initPage > 24]/title/text() | db2-fn:xmlcolumn('SIGMOD_TABLE.SIGMOD_COLUMN')//issue[volume=12] //article[endPage - initPage > 24]//author/text()
1 ------------------------------------------------------------------------------- BUSINESS - An End-User Oriented Application Development Language. Peter B. Miller Sergey Tetelbaum Kincade N. Webb Final Report of the ANSI/X3/SPARC DBS-SG Relational Database Task Group. Michael L. Brodie Joachim W. Schmidt 7 record(s) selected. d) ------------------------------------------------------------------------------- xquery let $r := db2-fn:xmlcolumn('SIGMOD_TABLE.SIGMOD_COLUMN')//article let $s := "Karen Botnich" let $a := (for $x in $r//authors[author = $s] return if (count($x//author) = 2) then ($x//author) else ()) let $b := (for $y in ((for $z in $r return $z) except (for $v in $r where $v//author = $s return $v)) return $y//author) for $i in distinct-values($a) where $i != $s return if (exists(index-of(($b), $i))) then () else $i 1 ------------------------------------------------------------------------------- Anthony I. Wasserman 1 record(s) selected. ==No XPath== e) ------------------------------------------------------------------------------- xquery let $r := db2-fn:xmlcolumn('SIGMOD_TABLE.SIGMOD_COLUMN')//author let $p1 := distinct-values(for $x in $r return if ($x/@position="01") then $x else ()) let $px := distinct-values(for $x in $r return if ($x/@position!="01") then $x else ()) for $pr in $p1 return if (exists(index-of(($px),$pr))) then () else $pr 1 ------------------------------------------------------------------------------- Karen Botnich Marco A. Casanova S. Jerrold Kaplan H. Rex Hartson Cory Devor Sergey Tetelbaum I. A. Popova Christian Richard T. L. Anderson Luc Bernard Frederick G. Davis John Doughty Edward Sciore Kenneth C. Wilner
Marina Moscarini Witold Lipski Jr. C. C. Chang Masatoshi Yoshikawa Jurgen Koch Joseph C. Stoltzfus David Rozenshtein Kalervo Jarvelin Yann Viamont Charles Connell Stelios Gamvroulas Aaron M. Tenenbaum Gerald Kreissig Alon Itai Ming-Yee Lai Erika Anderson Israel Gold Setrag Khoshafian Volkert Brosda C. H. Chen Masaru Kitsuregawa Sukhamay Kundu Daniel Leifker Matthew J. Weinstein Sally A. Goldman Michael Dohler M. W. Evens Keki B. Irani P. D. Nanadikar Gael N. Buckley Klaus Kuspert Bernhard Convent Nancy D. Griffeth Christophe de Maindreville Mayer D. Schwartz Michael V. Mannino G. Zoerntlein M. Er-radi Thierry Schang F. Ho Sandra Heiler Angelika M. Kotz Alan H. Goldfine Earl F. Ecklund Jr. A. R. Hurson Hanan Samet M. S. Kubicar Kurt Rothermel Alfred Z. Spector David Mutchler Lawrence J. Henschen Lawrence Chung Arie Shoshani Kenneth Salem Gianfranco R. Putzolu Gita Gopal Ragunathan Rajkumar Ming-Ju Lin Wei Zhao C. C. Lin Hannu Peltonen Chuen-Sing Yeung L. Miller Lowell Carmony
Ding-An Chiang Richard J. Waldinger Mikio Aoyama Walter A. Burkhard Gregory D. Speegle Tim King Chih-Chen Lin Dieter Schoenbauer R. Hogan Thomas Rose Sakti Pramanik Anoop Gupta Daniel Alexander Ford R. L. Guck Sam Toueg Hans-Werner Six Murthy Ganti Jim Yacabucci Kathryn Bates Hill Louis Hamel Rishiyur S. Nikhil Beverly Jamison V. Deshpande N. Natarajan Ronald J. Brachman Karen Ward Mario Terranova Prasadram Ramachandra Georg Lausen Soumitra Sengupta L. Garnett Jianwen Su Minyoung Ra Marti A. Hearst Jint Waramahaputi Manfred A. Jeusfeld et al. Rafiul Ahad Robert Godin Aya Ozeri Moez Chaabouni Ali Morfeq Riccardo Torlone Alex Tsukerman Qiuhui Yuan Doron Rotem Younkyung Cha Kang Mihalis Yannakakis Ralph D. Semmel Georges-Henri Moll Ravi S. Sandhu Eduardo B. Fernandez Peter Rathmann Anita K. Jones Fabrizio L. Ricci E. A. Unger Peter Schwarz Peter Zabback S. Raghuram Eric Mays Christoph Kilger Joseph Rajkumar Shamim A. Naqvi Anthony J. Bonner
Avraham Leff Alexander J. Pasik V. Krishnamurthy Alex Delis Andrew U. Frank Craig W. Schnepf Christine Parent Biao Jia Mohammad A. Ketabchi Randi Karlsen Jian Wu S. Misbah Deen Martin Kracker Yehoshua Perl Malu Castellanos Gottfried Luef Michael Novak Jean-Claude Mamou Volker Turau Madhu Reddy Inderpal Narang Pratap Khedkar Frank Levine Mariagrazia Fugini David Goldberg Beng Chin Ooi Edward D. Lazowska Andreas Grasnickel Sam Haradhvala Rajeev Rastogi Mandy Goldner Maxine Cohen G. Vinek M. McLoughlin K. Y. Lam M. J. Bas Daniel M. Dias L. Maugis Jiansan Chen Yale N. Patt Barton P. Miller Robert M. Arlein Khaled M. Bugrara Hiroyuki Kitagawa William J. McKenna Daniel P. Miranker Filipp I. Andon Don Mitchusson Padmashree Krishna John H. Christiansen George Karabatis M. Strobel Ming-Syan Chen Francis Upton IV Herman Lam William J. Dally Richard Jensen Gary Larson Paul C. Attie Annamaria Auddino William G. Roth M. A. Merzbacher Y. Alp Aslandogan Vibby Gottemukkala
Scott J. Van Horn Subhash Bhalla Andrew Deacon Kia Makki Ian Sommerville Iris Sheauyin Chu Sichen Liu Hock Chuan Chan Hai-Ping Ko Alexandra Poulovassilis Sylvia L. Osborn Fatima Pires Arturo Jaime Thomas Tschernko Gung-Wei Chirn Christian Breiteneder Yongjian Fu S. Viswanathan K. Bernhard Schiefer M. Ranganathan Yezdi Lashkari M. Toiati Jeffrey Olkin Lip Boon Doo Maurice van Keulen Wayne E. Moore Ee-Peng Lim Aziz Ait-Braham Terrance Swift Lon A. Smith Sheung-lun Hung Takashi Kitagawa Arnold Charles Meltzer Robert Barnes Peter Schauble Linda G. DeMichiel Farshad Fotouhi Margaret Christensen Kingsley C. Nwosu Thomas Berkel Dinkar Sitaram Gilles Fecteau Bill Bohrer James Davis Aashu Virmani Stefan Desloch Ralf Bottger Zhongyang Zhang King-Ip Lin Leana Golubchik Stephen Kelley Fernando Machuca David Hanley Stefano Pavani Heribert Schutz Yoram Kornatzky Thierry Coupaye Myron Flickner Alin Deutsch Yannis Theodoridis H. Stephen Au-Yeung Nadjiba Sahraoui Chia-Jung Chen Efstathios V. Ioannidis
H. Olivie Kevin Strehlo M. Satyanarayanan Babak Hamidzadeh Melliyal Annamalai Yuh-Lin Chang Ray Glasstone Michael Pizzo Jin Jing Suzanne W. Dietrich Nandlal L. Sarda Jorgen Hansson Shing-Shan Peng Rasikan David Gonzalo Navarro Rajendran M. Sivasankaran David Gelernter Aloysius K. Mok Anil Kumar Ion Tim Ieong Gang Zhou Susan B. Davidson Rona Machlin Lukas Relly T. A. Funkhouser Helen P. Yeung Yasuhiko Morimoto Mark Stokrp Karl Aberer Charles Hoch Michele Cart Antonio Badia K. Selcuk Candan Artur Klauser Pat Helland Manish Arya Harumi A. Kuno Roman Yangarber Edward Omiecinski Harald Kosch Alistair Moffat Thomas Zurek Phil Janus Stephen G. Eick Kenneth J. Mitchell Laurent Daynes Richard Beigel Dimitrios Georgakopoulos Antonia Bezenchek Laura Tarantino Eric Hughes Julia E. Hodges Kerry Taylor Roland Mayer-Foll John M. Tyler Catherine Plaisant Ralf Nikolai Pierangela Samarati Yuping Yang Jie-Bing Yu Allan Packer Thomas Hoppler Michael Averbuch Francoise Fabret
Christian Bohm Remzi Arpaci-Dusseau Laks V. S. Lakshmanan Mark Paskin George Karypis Kenneth C. Sevcik Chen-Chuan K. Chang Akira Kawaguchi Ramy Amouroux Jeanine Weisenfels Shin'ichi Satoh Nectaria Tryfona Susan V. Vrbsky Christian Larouche Mark Sullivan Nandit Soparkar Scott B. Huffman Barry Eaglestone V. Wiktor Marek Ada Wai-Chee Fu Chris Miller Anurag Acharya Ashok Josji Mehul Shah Huan Liu Piero A. Bonatti Sridhar Rajagopalan Shivakumar Venkataraman Allison Woodruff Ray Suorsa Gadi Entin Yelena Yesha Byron Dom Ralf Muhlberg Shiby Thomas Phil Shaw Gopalan Arun Tobias Mayr Philippe Rigaux Andreas Dehmel Vibha Dayal Arnaud Sahuguet Yong Sik Kwon Bharat Kumar Vinay K. Chaudhri Roger S. Barga Werner Retschitzegger Israel Ben-Shaul Timothy J. Norman Jordi Herrera-Joancomarti Maurice D. Mulvenna Sebastian Pulkowski Robert J. Glushko Paul Lewis Brad Perry J. Hoppenbrouwers Matthias Klusch Marcus Costa Sampaio Claudia Bauyer Medeiros F. Haenni Silvana Castano John Murphy Leo Obrst Clemens Bertram
398 record(s) selected. f) ------------------------------------------------------------------------------- xquery let $v00 := db2-fn:xmlcolumn('SIGMOD_TABLE.SIGMOD_COLUMN')//issue[volume=11 or volume=12] let $v01 := db2-fn:xmlcolumn('SIGMOD_TABLE.SIGMOD_COLUMN')//issue[volume=11] let $v02 := db2-fn:xmlcolumn('SIGMOD_TABLE.SIGMOD_COLUMN')//issue[volume=12] let $a00 := $v00//article let $a01 := $v01//article let $a02 := $v02//article let $av0 := for $x in $a00 return ($x/endPage - $x/initPage + 1) let $av1 := for $y in $a01 return ($y/endPage - $y/initPage + 1) let $av2 := for $z in $a02 return ($z/endPage - $z/initPage + 1) return <all> <volume-11-12> {avg($av0)} </volume-11-12> <volume-11> {avg($av1)} </volume-11> <volume-12> {avg($av2)} </volume-12> </all> 1 ------------------------------------------------------------------------------- <average-all> <volume-11-12> 14.448275862069 </volume-11-12> <volume-11> 13.6666666666667 </volume-11> <volume-12> 15 </volume-12> </average-all> 1 record(s) selected.
Question 3 This is an open end question. It depends on what and how many proofs you have shown to support your view points. Question 4 Students can draw an ERD to help the design but it is optioncal. Schema a1q4.xsd
schema location: C:\ xmlspy-run\Template\new.xsd targetNamespace: http://my.assignment.q4/namespace Elements Complex types Assigned ParticularsType Categories Companies Projects Selections Students element Assigned
diagram
namespace http://my.assignment.q4/namespace
children Projects Students Progress Letters
source <xs:element name="Assigned"> <xs:complexType> <xs:sequence> <xs:element ref="Projects" /> <xs:element ref="Students"/> <xs:element name="Progress"> <xs:complexType> <xs:sequence> <xs:element name="Chief-Supervisor" type="ParticularsType"/> <xs:element name="Co-Supervisor" type="ParticularsType"/> <xs:element name="Visits"> <xs:complexType> <xs:sequence> <xs:element name="Initial" type="xs:date"/> <xs:element name="Mid" type="xs:date"/> <xs:element name="Final" type="xs:date"/>
</ xs:sequence> </xs:complexType> </ xs:element> <xs:element name="Status" type="xs:string"/> </ xs:sequence> </xs:complexType> </ xs:element> <xs:element name="Letters" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="Author" type="xs:string" /> <xs:element name="Content" type="xs:string"/> </ xs:sequence> <xs:attribute name="LetterID" type="xs:string" use="required"/> </xs:complexType> <xs:key name="LetterID_PK"> <xs:selector/ > <xs:field xpath="LetterID"/> </xs:key> </ xs:element> </ xs:sequence> </xs:complexType> </ xs:element>
element Assigned/Progress
diagram
namespace http://my.assignment.q4/namespace
children Chief-Supervisor Co-Supervisor Visits Status
source <xs:element name="Progress"> <xs:complexType> <xs:sequence> <xs:element name="Chief-Supervisor" type="ParticularsType"/> <xs:element name="Co-Supervisor" type="ParticularsType"/> <xs:element name="Visits"> <xs:complexType> <xs:sequence> <xs:element name="Initial" type="xs:date"/> <xs:element name="Mid" type="xs:date"/> <xs:element name="Final" type="xs:date"/> </ xs:sequence> </xs:complexType> </ xs:element> <xs:element name="Status" type="xs:string"/> </ xs:sequence> </xs:complexType> </ xs:element>
element Assigned/Progress/Chief-Supervisor
diagram
namespace http://my.assignment.q4/namespace
type ParticularsType
children Name Phone Email
source <xs:element name="Chief-Supervisor" type="ParticularsType"/>
element Assigned/Progress/Co-Supervisor
diagram
namespace http://my.assignment.q4/namespace
type ParticularsType
children Name Phone Email
source <xs:element name="Co-Supervisor" type="ParticularsType"/>
element Assigned/Progress/Visits
diagram
namespace http://my.assignment.q4/namespace
children Initial Mid Final
source <xs:element name="Visits"> <xs:complexType> <xs:sequence> <xs:element name="Initial" type="xs:date"/> <xs:element name="Mid" type="xs:date"/> <xs:element name="Final" type="xs:date"/> </ xs:sequence> </xs:complexType> </ xs:element>
element Assigned/Progress/Visits/Initial
diagram
namespace http://my.assignment.q4/namespace
type xs:date
source <xs:element name="Initial" type="xs:date"/>
element Assigned/Progress/Visits/Mid
diagram
namespace http://my.assignment.q4/namespace
type xs:date
source <xs:element name="Mid" type="xs:date"/>
element Assigned/Progress/Visits/Final
diagram
namespace http://my.assignment.q4/namespace
type xs:date
source <xs:element name="Final" type="xs:date"/>
element Assigned/Progress/Status
diagram
namespace http://my.assignment.q4/namespace
type xs:string
source <xs:element name="Status" type="xs:string"/>
element Assigned/Letters
diagram
namespace http://my.assignment.q4/namespace
children Author Content
attributes Name Type Use Default Fixed Annotation LetterID xs:string required
identity constraints
Name Refer Selector Field(s) key LetterID_PK LetterID
source <xs:element name="Letters" maxOccurs="unbounded"> <xs:complexType>
<xs:sequence> <xs:element name="Author" type="xs:string" /> <xs:element name="Content" type="xs:string"/> </ xs:sequence> <xs:attribute name="LetterID" type="xs:string" use="required"/> </xs:complexType> <xs:key name="LetterID_PK"> <xs:selector/ > <xs:field xpath="LetterID"/> </xs:key> </ xs:element>
element Assigned/Letters/Author
diagram
namespace http://my.assignment.q4/namespace
type xs:string
source <xs:element name="Author" type="xs:string"/>
element Assigned/Letters/Content
diagram
namespace http://my.assignment.q4/namespace
type xs:string
source <xs:element name="Content" type="xs:string"/>
element Categories
diagram
namespace http://my.assignment.q4/namespace
children CategoryID Description
source <xs:element name="Categories"> <xs:complexType> <xs:sequence> <xs:element name="CategoryID" type="xs:string"> <xs:key name="CategoryID_PK"> <xs:selector/ > <xs:field xpath="CategoryID" /> </xs:key> </ xs:element> <xs:element name="Description" type="xs:string" /> </ xs:sequence> </xs:complexType> </ xs:element>
element Categories/CategoryID
diagram
namespace http://my.assignment.q4/namespace
type xs:string
identity constraints
Name Refer Selector Field(s) key CategoryID_PK CategoryID
source <xs:element name="CategoryID" type="xs:string"> <xs:key name="CategoryID_PK"> <xs:selector/ > <xs:field xpath="CategoryID" /> </xs:key> </ xs:element>
element Categories/Description
diagram
namespace http://my.assignment.q4/namespace
type xs:string
source <xs:element name="Description" type="xs:string" />
element Companies
diagram
namespace http://my.assignment.q4/namespace
children CompanyName Contacts
attributes Name Type Use Default Fixed Annotation CompanyID xs:string required
identity constraints
Name Refer Selector Field(s) key CompanyID_PK CompanyID
source <xs:element name="Companies"> <xs:complexType> <xs:sequence> <xs:element name="CompanyName" type="xs:string" /> <xs:element name="Contacts"> <xs:complexType> <xs:sequence> <xs:element name="ContactStaff" maxOccurs="unbounded"> <xs:complexType> <xs:complexContent> <xs:extension base="ParticularsType"> <xs:attribute name="StaffID" type="xs:string" use="required"/> </ xs:extension> </ xs:complexContent> </xs:complexType> <xs:key name="StaffID_PK"> <xs:selector/ > <xs:field/ > </xs:key> </ xs:element> </ xs:sequence> </xs:complexType> </ xs:element> </ xs:sequence> <xs:attribute name="CompanyID" type="xs:string" use="required"/> </xs:complexType> <xs:key name="CompanyID_PK"> <xs:selector/ > <xs:field xpath="CompanyID"/> </xs:key> </ xs:element>
element Companies/CompanyName
diagram
namespace http://my.assignment.q4/namespace
type xs:string
source <xs:element name="CompanyName" type="xs:string" />
element Companies/Contacts
diagram
namespace http://my.assignment.q4/namespace
children ContactStaff
source <xs:element name="Contacts"> <xs:complexType> <xs:sequence> <xs:element name="ContactStaff" maxOccurs="unbounded"> <xs:complexType> <xs:complexContent> <xs:extension base="ParticularsType"> <xs:attribute name="StaffID" type="xs:string" use="required"/> </ xs:extension> </ xs:complexContent> </xs:complexType> <xs:key name="StaffID_PK"> <xs:selector/ > <xs:field/ > </xs:key> </ xs:element> </ xs:sequence> </xs:complexType> </ xs:element>
element Companies/Contacts/ContactStaff
diagram
namespace http://my.assignment.q4/namespace
type extension of ParticularsType
children Name Phone Email
attributes Name Type Use Default Fixed Annotation StaffID xs:string required
identity constraints
Name Refer Selector Field(s) key StaffID_PK
source <xs:element name="ContactStaff" maxOccurs="unbounded">
<xs:complexType> <xs:complexContent> <xs:extension base="ParticularsType"> <xs:attribute name="StaffID" type="xs:string" use="required"/> </ xs:extension> </ xs:complexContent> </xs:complexType> <xs:key name="StaffID_PK"> <xs:selector/ > <xs:field/ > </xs:key> </ xs:element>
element Projects
diagram
namespace http://my.assignment.q4/namespace
children SubmittedBy Specification ContactStaff Approved Details Category
used by elements Assigned Selections attributes Name Type Use Default Fixed Annotation
ProjectID xs:string required identity
constraints Name Refer Selector Field(s) key ProjectID_PK ProjectID
source <xs:element name="Projects"> <xs:complexType> <xs:sequence> <xs:element name="SubmittedBy"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="CompanyID" type="xs:string" use="required"/> </ xs:extension> </ xs:simpleContent> </xs:complexType> <xs:keyref name="CompanyID_FK" refer="CompanyID_PK"> <xs:selector/ > <xs:field xpath="CompanyID"/> </xs:keyref> </ xs:element> <xs:element name="Specification" type="xs:string" /> <xs:element name="ContactStaff" maxOccurs="unbounded"> <xs:complexType> <xs:complexContent> <xs:extension base="ParticularsType"> <xs:attribute name="StaffID"/> </ xs:extension> </ xs:complexContent>
</xs:complexType> <xs:keyref name="StaffID_FK" refer="StaffID_PK"> <xs:selector/ > <xs:field xpath="StaffID"/> </xs:keyref> </ xs:element> <xs:element name="Approved" type="xs:boolean" /> <xs:element name="Details" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="Task"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="TaskID" type="xs:string" use="required"/> </ xs:extension> </ xs:simpleContent> </xs:complexType> <xs:key name="TaskID_PK"> <xs:selector/ > <xs:field xpath="TaskID"/> </xs:key> </ xs:element> <xs:element name="Description" type="xs:string" /> </ xs:sequence> </xs:complexType> </ xs:element> <xs:element name="Category"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="CategoryID" type="xs:string" use="required"/> </ xs:extension> </ xs:simpleContent> </xs:complexType> <xs:keyref name="CategoryID_FK" refer="CategoryID_PK"> <xs:selector/ > <xs:field xpath="CategoryID" /> </xs:keyref> </ xs:element> </ xs:sequence> <xs:attribute name="ProjectID" type="xs:string" use="required"/> </xs:complexType> <xs:key name="ProjectID_PK"> <xs:selector/ > <xs:field xpath="ProjectID"/> </xs:key> </ xs:element>
element Projects/SubmittedBy
diagram
namespace http://my.assignment.q4/namespace
type extension of xs:string
attributes Name Type Use Default Fixed Annotation CompanyID xs:string required
identity constraints
Name Refer Selector Field(s) keyref CompanyID_FK CompanyID_PK CompanyID
source <xs:element name="SubmittedBy"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="CompanyID" type="xs:string" use="required"/> </ xs:extension> </ xs:simpleContent> </xs:complexType> <xs:keyref name="CompanyID_FK" refer="CompanyID_PK"> <xs:selector/ > <xs:field xpath="CompanyID"/>
</xs:keyref> </ xs:element>
element Projects/Specification
diagram
namespace http://my.assignment.q4/namespace
type xs:string
source <xs:element name="Specification" type="xs:string" />
element Projects/ContactStaff
diagram
namespace http://my.assignment.q4/namespace
type extension of ParticularsType
children Name Phone Email
attributes Name Type Use Default Fixed Annotation StaffID
identity constraints
Name Refer Selector Field(s) keyref StaffID_FK StaffID_PK StaffID
source <xs:element name="ContactStaff" maxOccurs="unbounded"> <xs:complexType> <xs:complexContent> <xs:extension base="ParticularsType"> <xs:attribute name="StaffID"/> </ xs:extension> </ xs:complexContent> </xs:complexType> <xs:keyref name="StaffID_FK" refer="StaffID_PK"> <xs:selector/ > <xs:field xpath="StaffID"/> </xs:keyref> </ xs:element>
element Projects/Approved
diagram
namespace http://my.assignment.q4/ namespace
type xs:boolean
source <xs:element name="Approved" type="xs:boolean" />
element Projects/Details
diagram
namespace http://my.assignment.q4/namespace
children Task Description
source <xs:element name="Details" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="Task"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="TaskID" type="xs:string" use="required"/> </ xs:extension> </ xs:simpleContent> </xs:complexType> <xs:key name="TaskID_PK"> <xs:selector/ > <xs:field xpath="TaskID"/> </xs:key> </ xs:element> <xs:element name="Description" type="xs:string" /> </ xs:sequence> </xs:complexType> </ xs:element>
element Projects/Details/Task
diagram
namespace http://my.assignment.q4/namespace
type extension of xs:string
attributes Name Type Use Default Fixed Annotation TaskID xs:string required
identity constraints
Name Refer Selector Field(s) key TaskID_PK TaskID
source <xs:element name="Task"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="TaskID" type="xs:string" use="required"/> </ xs:extension> </ xs:simpleContent> </xs:complexType> <xs:key name="TaskID_PK"> <xs:selector/ > <xs:field xpath="TaskID"/> </xs:key> </ xs:element>
element Projects/Details/Description
diagram
namespace http://my.assignment.q4/namespace
type xs:string
source <xs:element name="Description" type="xs:string" />
element Projects/Category
diagram
namespace http://my.assignment.q4/namespace
type extension of xs:string
attributes Name Type Use Default Fixed Annotation CategoryID xs:string required
identity constraints
Name Refer Selector Field(s) keyref CategoryID_FK CategoryID_PK CategoryID
source <xs:element name="Category"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="CategoryID" type="xs:string" use="required"/> </ xs:extension> </ xs:simpleContent> </xs:complexType> <xs:keyref name="CategoryID_FK" refer="CategoryID_PK"> <xs:selector/ > <xs:field xpath="CategoryID" /> </xs:keyref> </ xs:element>
element Selections
diagram
namespace http://my.assignment.q4/namespace
children Projects Students
source <xs:element name="Selections"> <xs:complexType> <xs:sequence> <xs:element ref="Projects" maxOccurs="3"/> <xs:element ref="Students"/> </ xs:sequence> </xs:complexType> </ xs:element>
element Students
diagram
namespace http://my.assignment.q4/namespace
children Particulars CV
used by elements Assigned Selections attributes Name Type Use Default Fixed Annotation
StudentID xs:string required identity
constraints Name Refer Selector Field(s) key StudentID_PK
annotation documentation Root source <xs:element name="Students">
<xs:annotation> <xs:documentation>Root</ xs:documentation> </xs:annotation> <xs:complexType> <xs:sequence> <xs:element name="Particulars" type="ParticularsType"/> <xs:element name="CV" type="xs:string" /> </ xs:sequence> <xs:attribute name="StudentID" type="xs:string" use="required" /> </xs:complexType> <xs:key name="StudentID_PK"> <xs:selector/ > <xs:field/ > </xs:key> </ xs:element>
element Students/Particulars
diagram
namespace http://my.assignment.q4/namespace
type ParticularsType
children Name Phone Email
source <xs:element name="Particulars" type="ParticularsType"/>
element Students/CV
diagram
namespace http://my.assignment.q4/namespace
type xs:string
source <xs:element name="CV" type="xs:string" />
complexType ParticularsType
diagram
namespace http://my.assignment.q4/namespace
children Name Phone Email
used by elements Assigned/Progress/Chief-Supervisor Assigned/Progress/Co-Supervisor Companies/Contacts/ContactStaff Projects/ContactStaff Students/Particulars
source <xs:complexType name="ParticularsType"> <xs:sequence> <xs:element name="Name" type="xs:string" /> <xs:element name="Phone" type="xs:string" /> <xs:element name="Email" type="xs:string" /> </xs:sequence> </ xs:complexType>
element ParticularsType/Name
diagram
namespace http://my.assignment.q4/namespace
type xs:string
source <xs:element name="Name" type="xs:string" />
element ParticularsType/Phone
diagram
namespace http://my.assignment.q4/namespace
type xs:string
source <xs:element name="Phone" type="xs:string" />
element ParticularsType/Email
diagram
namespace http://my.assignment.q4/namespace
type xs:string
source <xs:element name="Email" type="xs:string" />
XML Schema documentation generated with XML Spy Schema Editor www.xmlspy.com
4b) Areas to be investigated: flexibility, complexity and completeness of data/information/structure. Comparing the use of “IDREF(S)” and “ID” in XML document, and “KEY” and “KEYREF” in schema.