15.2.5. XSD-< schema > element

发布时间 :2025-10-25 12:23:27 UTC      

The < schema > element is the root element of every XML Schema.

< schema > element

The < schema > element is the root element of each XML Schema:

<?xml version="1.0"?>
<xs:schema>
...
...
</xs:schema>

< schema > elements can contain attributes. An schema declaration often looks like this:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.runoob.com"
xmlns="http://www.runoob.com"
elementFormDefault="qualified">
...
...
</xs:schema>

The following code snippet:

xmlns:xs="http://www.w3.org/2001/XMLSchema"

Shows that the elements and data types used in schema come from the namespace “ http://www.w3.org/2001/XMLSchema ”.” It also specifies that elements and data types from the namespace “ http://www.w3.org/2001/XMLSchema ”” should use the prefix xs:

This snippet:

targetNamespace="http://www.runoob.com"

Shows that the elements defined by this schema (note, to, from, heading, body) come from the namespace: “ http://www.runoob.com ”.

This snippet:

xmlns="http://www.runoob.com"

Indicates that the default namespace is “ http://www.runoob.com ”.”

This snippet:

elementFormDefault="qualified"

Indicates that elements used by any XML instance document and declared in this schema must be namespace qualified.

Reference Schema in an XML document

This XML document contains a reference to XML Schema:

<?xml version="1.0"?>
<note xmlns="http://www.runoob.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.runoob.com note.xsd">
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

The following code snippet:

xmlns="http://www.runoob.com"

Specifies the declaration of the default namespace. This declaration tells the schema validator that all elements used in this XML document are declared in the “ http://www.runoob.com ”” namespace.

Once you have the available XML Schema instance namespace:

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

You can then use the schemaLocation property. This property has two values. The first value is the namespace that needs to be used. The second value is the location of the XML schema used by the namespace:

xsi:schemaLocation="http://www.runoob.com note.xsd"
Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.