
<xs:complexType name="companyname" type="xs:string"> error Attribute 'name' is not allowed in element <xs:complexType> On Thu, Mar 10, 2011 at 2:34 PM, Muhile Abdulaziz < abdulaziz.muhile@gmail.com> wrote:
whats the error, send post the xml file
On Thu, Mar 10, 2011 at 3:30 AM, ibtisam jamal <ibty.jamal@gmail.com>wrote:
Hi,
<xs:element name="location"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="Masaki"/> <xs:enumeration value="Poster"/> </xs:restriction> </xs:simpleType> </xs:element> </xs:schema>
the above will restrict the location values to only Masaki and Poster.I think it should be any location not restricted to the above.
Then i fail to validate the second part.Im getting an error at type ="jobdescription"
*<xs:complexType name="companyname" type="jobdescripton"> <xs:sequence> <xs:element name="Jobone" type="xs:string"/> <xs:element name="Jobtwo" type="xs:string"/> <xs:element name="Jobthree" type="xs:string"/> </xs:sequence> </xs:complexType> *
On Thu, Mar 10, 2011 at 12:57 PM, Muhile Abdulaziz < abdulaziz.muhile@gmail.com> wrote:
I tried working on number three, no errors as far as am concerned
here goes
1. In the case of job requests, the sample file should include (at least) two different locations
Answer - simpletype
* <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="location"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="Masaki"/> <xs:enumeration value="Poster"/> </xs:restriction> </xs:simpleType> </xs:element> </xs:schema>*
where i thought they are testing you on *simpletype* and *complextype
*2. for suitable jobs should include at least three different job descriptions from two different companies.
Answer - *complextype
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="suitablejobs">
<xs:complexType name="companyname" type="jobdescripton"> <xs:sequence> <xs:element name="Jobone" type="xs:string"/> <xs:element name="Jobtwo" type="xs:string"/> <xs:element name="Jobthree" type="xs:string"/> </xs:sequence> </xs:complexType>
<xs:complexType name="companyname" type="jobdescripton"> <xs:sequence> <xs:element name="Jobfour" type="xs:string"/> <xs:element name="Jobfive" type="xs:string"/> <xs:element name="Jobsix" type="xs:string"/> </xs:sequence> </xs:complexType>
<xs:complexType name="jobdescripton"> <xs:complexContent> <xs:extension base="companyname"> <xs:sequence> <xs:element name="Jobtitle" type="xs:string"/> <xs:element name="salaryammount" type="xs:integer"/> <xs:element name="details" type="xs:string"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType>
</xs:element>
</xs:schema> * Maybe fellow skunks can advise further
On Thu, Mar 10, 2011 at 12:36 AM, ibtisam jamal <ibty.jamal@gmail.com>wrote:
Thanks for your response Ashok,
See attached my code that works but i only used xs:string for element name . I don't understand xs:NCName please elaborate .
Is it OK ??
I also have the following questions
3.Create XSD/Schema files for both a job request document, and the suitable jobs document. You should also produce example files of each type. In the case of job requests, the sample file should include (at least) two different locations and for suitable jobs should include at least three different job descriptions from two different companies. 4. Create an extended job seeker XSD document, and XML sample, to include provision for the following additional information: • How far away the job seeker is willing to travel for a new job • Whether the job seeker drives (should be either yes or no) • Current experience – this should be a list of positions that the user has had, including the position title, the address of the employment, and a list of responsibilities • References – two references, including referee name, address, phone number and email address You should ensure that data types are specified for all of the information as much as possible in the schema document. 5. Create an XSLT file to display the suitable jobs document as HTML in a web browser. The resulting output should deal with as many jobs as are returned, and be simple and clear to view (a table structure works best).
On Thu, Mar 10, 2011 at 9:38 AM, <ashok+skunkworks@parliaments.info>wrote:
On Tue, Mar 8, 2011 at 2:06 PM, ibtisam jamal <ibty.jamal@gmail.com>wrote:
im learning but im stuck i created the attached XML doc from the attached DTD then i created a schema doc from my XML and the DTD .but when i referenced the xsd in the xml document it gets stuck when validating .
I think i should have 6 elements under root seeker
Please find the attached
Your schema definition has some problems -- it allows multiple root elements ; does not define a hierarchy ; also you dont need a DTD if you are using a XSD schema.
For the schema -- you need to do something like this :
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="seeker"> <xs:complexType> <xs:sequence> <xs:element ref="name"/> <xs:element ref="address"/> <xs:element ref="personalinfo"/> <xs:element ref="email"/> <xs:element ref="skills"/> <xs:element ref="salary"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="name"> <xs:complexType> <xs:sequence> <xs:element ref="first-name"/> <xs:element ref="surname"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="first-name" type="xs:NCName"/> <xs:element name="surname" type="xs:NCName"/> <xs:element name="address"> <xs:complexType> <xs:sequence> <xs:element ref="street"/> <xs:element ref="town"/> <xs:element ref="county"/> <xs:element ref="postcode"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="street" type="xs:string"/> <xs:element name="town" type="xs:NCName"/> <xs:element name="county" type="xs:string"/> <xs:element name="postcode" type="xs:integer"/> <xs:element name="personalinfo"> <xs:complexType> <xs:sequence> <xs:element ref="dateofbirth"/> <xs:element ref="nationality"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="dateofbirth"> <xs:complexType> <xs:attribute name="date" use="required" type="xs:date"/> </xs:complexType> </xs:element> <xs:element name="nationality" type="xs:NCName"/> <xs:element name="email" type="xs:string"/> <xs:element name="skills"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" ref="skill"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="skill" type="xs:NCName"/> <xs:element name="salary"> <xs:complexType> <xs:sequence> <xs:element ref="min-salary"/> <xs:element ref="max-salary"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="min-salary" type="xs:string"/> <xs:element name="max-salary" type="xs:string"/> </xs:schema>
A xml corresponding to the schema will look like this :
<?xml version="1.0" encoding="UTF-8"?> <!-- JOBSEEKER DETAILS --> <seeker xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="jobseeker.xsd"> <name> <first-name>MUKHTAR</first-name> <surname>OMAR</surname> </name> <address> <street>SOUTH C</street> <town>NAIROBI</town> <county>NAIROBI WEST</county> <postcode>00506</postcode> </address> <personalinfo> <dateofbirth date="1970-01-12" /> <nationality>Kenya</nationality> </personalinfo> <email>M.OMAR@GMAIL.COM</email> <skills> <skill>DOCTOR</skill> <skill>ENGINEER</skill> <skill>PILOT</skill> </skills> <salary> <min-salary>2000 USD</min-salary> <max-salary>3000 USD</max-salary> </salary> </seeker>
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- regards
AA.Muhile Abdul Title: Creative
*Address* Plot 145, Kijitonyama Area, P.O.Box 71387 Dar es Salaam Tanzania Cell: +255 783 018998
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- regards
AA.Muhile Abdul Title: Creative
*Address* Plot 145, Kijitonyama Area, P.O.Box 71387 Dar es Salaam Tanzania Cell: +255 783 018998
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke