XML

In this category I want to collect all articles, which are related to processing XML. Why would he open a dedicated category just for XML? Because XML is a complex field.

If you have to define a simple XML element of a certain predefined type like string or long but you want to include properties in the resulting element, the following schema definition might come handy.

XML

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
	targetNamespace="http://www.consulting-bolte.de/ImgRule/" 
	xmlns:tns="http://www.consulting-bolte.de/ImgRule/" 
	elementFormDefault="qualified">
 
	<xs:complexType name="PropertyType">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="name" type="xs:string" />
				<xs:attribute name="type" type="xs:string" />
			</xs:extension>						
		</xs:simpleContent>
	</xs:complexType>
  
</xs:schema>

 

The above schema extends the simple type string from the W3C xml namespace.