Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CA201 Word Application XML Week # 10 By Tariq Ibn Aziz Dammam Community college.

Similar presentations


Presentation on theme: "1 CA201 Word Application XML Week # 10 By Tariq Ibn Aziz Dammam Community college."— Presentation transcript:

1 1 CA201 Word Application XML Week # 10 By Tariq Ibn Aziz Dammam Community college

2 Tariq Aziz, Dammam Community College 2 Objectives In this chapter you will learn to: –XML Document –Create XML Schema

3 Tariq Aziz, Dammam Community College 3 XML Document in Word Let's have a look at this XML document called “Simple.xml” XML document has a root element persons. The “persons” element contains 1 child element “person”. “person” appears twice and contain name, address, city, and country elements.

4 Tariq Aziz, Dammam Community College 4 XML Document in Notepad <persons xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="simple.xsd"> Ola Nordmann Langgt 23 4000 Stavanger Norway

5 Tariq Aziz, Dammam Community College 5 XML Document The line above: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" tells the XML parser that this document should be validated against a schema. The line: xsi:noNamespaceSchemaLocation="simple.xsd" specifies WHERE the schema resides (here it is in the same folder as "simple.xml").

6 Tariq Aziz, Dammam Community College 6 Create XML Schema Open a file in Notepad and name it “Simple.xsd” To create the schema we could simply follow the structure in the XML document and define each element as we find it. We will start with the standard XML declaration followed by the xs:schema element that defines a schema...

7 Tariq Aziz, Dammam Community College 7 Create XML Schema[2]... In the schema above we use the standard namespace (xs), The URI associated with this namespace is the Schema language definition, which has the standard value of http://www.w3.org/2001/XMLSchema.

8 Tariq Aziz, Dammam Community College 8 Complex Type Next, we have to define the “persons" element. This element contains other elements, therefore we consider it as a complex type. The child elements of the “person" element is surrounded by a xs:sequence element that defines an ordered sequence of sub elements......

9 Tariq Aziz, Dammam Community College 9 SML Schema

10 Tariq Aziz, Dammam Community College 10 Chapter Key Points


Download ppt "1 CA201 Word Application XML Week # 10 By Tariq Ibn Aziz Dammam Community college."

Similar presentations


Ads by Google