1. The text “Croydon Tramlink” on firefox explorer will be underlined and most likely highlighted in a different colour to indicate that it is a link where as on explorer the link is not supported and is not even highlighted or underlined.
2. I would chose XML schema’s over DTD’S because DTD ‘s has limitation on the description it can give about the document structure and uses a strange archaic format. However xml schema uses xml therefore can be parsed through an xml parser. The xml schema addresses the shortcomings of DTD’S and has the ability to describe complex XML types. There are also other features such as the “minOccurs” and “maxOccurs” which gives information on the amount of times each element will appear within a certain document.
Longer Questions
Bellow is the required XML schema document that I had to create: -
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="book">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string"/>
<xs:element name="author" type="xs:string"/>
<xs:element name="character">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="friend-of" type="xs:string" minOccurs="0"/>
<xs:element name="since" type="xs:string"/>
<xs:element name="qualified" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="isbn" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>
Lecture Reflection-WEEK 11 – 12 – XML Schema
An XML Schema describes the structure of an XML document and it is an XML-based alternative to DTD. An advantage of an XML schema over a DTD is that the schema uses XML for its coding therefore ensures a better understanding for someone that already knows how to use XML. This also ensures that the schema is parsed using an XML parser. An XML schema also offers more description then a DTD.
XML Schema language is sometimes referred to as XML Schema Definition (XSD). XML Schema is a W3 recommendation and it is thought of as the successor of DTD since they are extensible to future additions, support data types and namespaces, and they are more powerful than DTD.
There are two types used in an XML schema: -
1.Simple Type= Simple types contain only text. They don’t have child types. The element concerned doesn’t have attributes.
2.Complex Type= the element has one or more attributes, or one or more child elements, or both.
Example
XML document: -
<?xml version="1.0"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
XML Schema for the above document: -
<?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="qualified">
<xs:element name="note">
<xs:complexType>
<xs:sequence>
<xs:element name="to" type="xs:string"/>
<xs:element name="from" type="xs:string"/>
<xs:element name="heading" type="xs:string"/>
<xs:element name="body" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
http://www.ronnysmarket.com/
http://www.ronnysmarket.com/catalog/main
No comments:
Post a Comment