Ex 4
Ex 4
Ex 4
PROBLEM STATEMENT:
PROJECT CODE:
<!DOCTYPE register_list [
]>
<register_list>
<register id="1">
<name>tobias eaton</name>
<email>tobiaseaton@hotmail.com</email>
<address>mystic falls</address>
<mobile>123456787</mobile>
<password>div125tobias</password>
<confm_password>div125tobias</confm_password>
<gender>male</gender>
</register>
<register id="2">
<name>Elliot Alderson</name>
<email>rami_melak@robot.com</email>
<address>Los Angelos</address>
<mobile>120505005</mobile>
<password>fsociety</password>
<confm_password>fsociety</confm_password>
<gender>male</gender>
</register>
<register id = "3">
<name>Hope mikaelson</name>
<email>kidvampire@vamp.com</email>
<address>New Orleans</address>
<mobile>01010101</mobile>
<password>tribrid_m</password>
<confm_password>tribrid_m</confm_password>
<gender>female</gender>
</register>
</register_list>
XSD:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="register">
<xs:complexType>
<xs:sequence>
<xs:element name="name">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1">
<xs:maxLength value="20">
<xs:pattern value="[a-zA-Z]*"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="email">
<xs:simpleText>
<xs:restriction base="xs:string">
<xs:minLength value="1">
<xs:maxLength value="20">
<xs:pattern value="[a-zA-Z]*"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="gender">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="male"/>
<xs:enumeration value="female"/>
<xs:enumeration value="others"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
XSL:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h1><b>Registration</b></h1>
<center>
<table border="1">
<tr bgcolor="green">
<th>Name</th>
<th>Email</th>
<th>Address</th>
<th>Mobile</th>
<th>Password</th>
<th>Gender</th>
</tr>
<xsl:for-each select="register_list/register">
<tr>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="email"/></td>
<td><xsl:value-of select="address"/></td>
<td><xsl:value-of select="mobile"/></td>
<td><xsl:value-of select="password"/></td>
<td><xsl:value-of select="gender"/></td>
</tr>
</xsl:for-each>
</table>
</center>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
OUTPUT:
RESULT:
Thus the XML, XML Schema, DTD for the modules has been designed successfully.