Hi there
I am just beginner of this area. I developed xml and xsl which is now working ok,
But I am trying to add xml schema to validate my elements, but unfortunately I am having difficult with that.
I want you to help me out this problem, am enclosing my welcome.xsd file and my welcome.xml
Please try to spend some time to understand my code and then debug it.
xml schema: welcome.xsd
<?xml version="1.0"?>
<xs:schema xmlns:xs="
http://www.w3.org/2001/XMLSchema"
targetNamespace="
http://www.w3schools.com"
xmlns="
http://www.w3schools.com"
elementFormDefault="qualif
ied">
<xs:element name="MyPage">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="xariiq" type="xs:string"/>
<xs:element name="personalInfo" type="xs:string"/>
<xs:complexType>
<xs:squence>
<xs:element name="photograph" type="xs:string"/>
<xs:element name="details" type="xs:string"/>
<xs:element name="email" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="infoBlock" type="xs:string"/>
<xs:complexType>
<xs:squence>
<xs:element name="title" type="xs:string"/>
<xs:element name="curriculumVitae" type="xs:string"/>
<xs:element name="Profiles" type="xs:string"/>
<xs:element name="mscdegree" type="xs:string"/>
<xs:element name="bscdegree" type="xs:string"/>
<xs:element name="hndcertificate" type="xs:string"/>
<xs:element name="help" type="xs:string"/>
<xs:element name="contact" type="xs:string"/>
<xs:element name="background" type="xs:string"/>
<xs:element name="link" type="xs:string"/>
<xs:complexType>
<xs:squence>
<xs:element name="href" type="xs:string"/>
<xs:element name="linkname" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
xml file: welcome.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="welcome.xsl"?>
<welcome xmlns="
http://www.w3schools.com"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.w3schools.com welcome.xsd">
<MyPage>
<name>
Web Page:</name>
<xariiq>xariiq.gif</xariiq
>
<personalInfo>
<photograph>
graduation.jpg
</photograph>
<detail>
<p>I'm a MSc part time student in Internat Computing within Software Engineering at Westminster
University.</p>
<p> I found really very challanging and skill full
in this area.</p>
</detail>
<email>
My Email is: dsssl@hotmail.com
</email>
</personalInfo>
<infoBlock>
<title>
My Background:
</title>
<curriculumVitae>
myCV.jpg
</curriculumVitae>
<Profiles>
personalProfiles.jpg
</Profiles>
<mscdegree>
MSc.jpg
</mscdegree>
<bscdegree>
BSc.jpg
</bscdegree>
<hndcertificate>
HND.jpg
</hndcertificate>
<help>
Help.jpg
</help>
<contact>
Contacts.jpg
</contact>
<background>
My name is
</background>
<link>
<href>
https://intranet.cscs.wmin.ac.uk/~douglap</href>
<linkname>
My Personal Page
</linkname>
</link>
</infoBlock>
</MyPage>
Start Free Trial