Zend Server User Guide > Tasks > Working with Libraries > Library Package > Example Codes > The XSD File

The XSD File

The XSD file validates the library XML descriptor file.

Example:

Usage Example

<?xml version="1.0" encoding="utf-8"?>

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

xmlns="http://www.zend.com/server/deployment-descriptor/1.0"

targetNamespace="http://www.zend.com/server/deployment-descriptor/1.0"

elementFormDefault="qualified">

<xs:element name="package">

<xs:annotation>

<xs:documentation></xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="type" minOccurs="0" maxOccurs="1" />

<xs:element name="name" minOccurs="1" maxOccurs="1" />

<xs:element name="summary" minOccurs="0" maxOccurs="1" />

<xs:element name="description" minOccurs="0" maxOccurs="1" />

<xs:element ref="version" minOccurs="1" maxOccurs="1" />

<xs:element name="releasedate" minOccurs="0" maxOccurs="1" />

<xs:element name="icon" type="xs:string" minOccurs="0" maxOccurs="1" />

<xs:element name="eula" type="xs:string" minOccurs="0" maxOccurs="1" />

<xs:element name="libdir" type="xs:string" minOccurs="0" maxOccurs="1" />

<xs:element name="scriptsdir" type="xs:string" minOccurs="0" maxOccurs="1" />

<xs:element name="updateurl" minOccurs="0" maxOccurs="1" />

<xs:element ref="dependencies" minOccurs="0" maxOccurs="1" />

<xs:element ref="parameters" minOccurs="0" maxOccurs="1" />

<xs:element ref="variables" minOccurs="0" maxOccurs="1" />

<xs:element ref="persistentresources" minOccurs="0" maxOccurs="1" />

</xs:sequence>

<xs:attribute name="version" type="xs:string" use="required">

<xs:annotation>

<xs:documentation>Package descriptor format version</xs:documentation>

</xs:annotation>

</xs:attribute>

</xs:complexType>

</xs:element>

<xs:element name="version">

<xs:annotation>

<xs:documentation>Application version</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="release" minOccurs="1" maxOccurs="1" />

<xs:element name="api" minOccurs="0" maxOccurs="1" />

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="dependencies">

<xs:annotation>

<xs:documentation>Application dependencies block</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="required" minOccurs="0" maxOccurs="1">

<xs:annotation>

<xs:documentation></xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element ref="php" minOccurs="0" maxOccurs="unbounded" />

<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded" />

<xs:element ref="directive" minOccurs="0" maxOccurs="unbounded" />

<xs:element ref="zendserver" minOccurs="0" maxOccurs="unbounded" />

<xs:element ref="zendservercomponent" minOccurs="0" maxOccurs="unbounded" />

<xs:element ref="zendframework" minOccurs="0" maxOccurs="unbounded" />

<xs:element ref="zendframework2" minOccurs="0" maxOccurs="unbounded" />

<xs:element ref="library" minOccurs="0" maxOccurs="unbounded" />

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="php">

<xs:annotation>

<xs:documentation>PHP version dependencies block</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="equals" minOccurs="0" maxOccurs="1" />

<xs:element name="min" minOccurs="0" maxOccurs="1" />

<xs:element name="max" minOccurs="0" maxOccurs="1" />

<xs:element name="exclude" minOccurs="0" maxOccurs="unbounded" />

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="extension">

<xs:annotation>

<xs:documentation>PHP extensions dependencies block</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="name" minOccurs="1" maxOccurs="1" />

<xs:element name="equals" minOccurs="0" maxOccurs="1" />

<xs:element name="min" minOccurs="0" maxOccurs="1" />

<xs:element name="max" minOccurs="0" maxOccurs="1" />

<xs:element name="exclude" minOccurs="0" maxOccurs="unbounded" />

<xs:element name="conflicts" minOccurs="0" maxOccurs="1" />

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="directive">

<xs:annotation>

<xs:documentation>PHP directives dependencies block</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="name" minOccurs="1" maxOccurs="1" />

<xs:element name="equals" minOccurs="0" maxOccurs="1" />

<xs:element name="min" minOccurs="0" maxOccurs="1" />

<xs:element name="max" minOccurs="0" maxOccurs="1" />

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="zendserver">

<xs:annotation>

<xs:documentation>Zend Server dependencies block</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="equals" minOccurs="0" maxOccurs="1" />

<xs:element name="min" minOccurs="0" maxOccurs="1" />

<xs:element name="max" minOccurs="0" maxOccurs="1" />

<xs:element name="exclude" minOccurs="0" maxOccurs="unbounded" />

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="zendservercomponent">

<xs:annotation>

<xs:documentation>Zend Server components dependencies block</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="name" minOccurs="1" maxOccurs="1" />

<xs:element name="equals" minOccurs="0" maxOccurs="1" />

<xs:element name="min" minOccurs="0" maxOccurs="1" />

<xs:element name="max" minOccurs="0" maxOccurs="1" />

<xs:element name="exclude" minOccurs="0" maxOccurs="unbounded" />

<xs:element name="conflicts" minOccurs="0" maxOccurs="1" />

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="zendframework">

<xs:annotation>

<xs:documentation>Zend Framework dependencies block</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="equals" minOccurs="0" maxOccurs="1" />

<xs:element name="min" minOccurs="0" maxOccurs="1" />

<xs:element name="max" minOccurs="0" maxOccurs="1" />

<xs:element name="exclude" minOccurs="0" maxOccurs="unbounded" />

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="zendframework2">

<xs:annotation>

<xs:documentation>Zend Framework 2 dependencies block</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="equals" minOccurs="0" maxOccurs="1" />

<xs:element name="min" minOccurs="0" maxOccurs="1" />

<xs:element name="max" minOccurs="0" maxOccurs="1" />

<xs:element name="exclude" minOccurs="0" maxOccurs="unbounded" />

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="library">

<xs:annotation>

<xs:documentation>Deployment Libraries dependencies block</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="name" minOccurs="1" maxOccurs="1" />

<xs:element name="equals" minOccurs="0" maxOccurs="1" />

<xs:element name="min" minOccurs="0" maxOccurs="1" />

<xs:element name="max" minOccurs="0" maxOccurs="1" />

<xs:element name="exclude" minOccurs="0" maxOccurs="unbounded" />

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="parameters">

<xs:annotation>

<xs:documentation>Package parameters</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element ref="parameter" minOccurs="0" maxOccurs="unbounded" />

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="parameter">

<xs:annotation>

<xs:documentation></xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="validation" minOccurs="0" maxOccurs="1">

<xs:complexType>

<xs:sequence>

<xs:element name="enums" minOccurs="0" maxOccurs="unbounded">

<xs:complexType>

<xs:sequence>

<xs:element name="enum" minOccurs="1" maxOccurs="unbounded" />

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="defaultvalue" minOccurs="0" maxOccurs="1" />

<xs:element name="description" minOccurs="0" maxOccurs="1" />

</xs:sequence>

<xs:attribute name="id" type="xs:string" use="required" />

<xs:attribute name="display" type="xs:string" use="required" />

<xs:attribute name="required" type="xs:boolean" use="required" />

<xs:attribute name="type" use="required">

<xs:simpleType>

<xs:restriction base="xs:string">

<xs:enumeration value="choice"></xs:enumeration>

<xs:enumeration value="string"></xs:enumeration>

<xs:enumeration value="password"></xs:enumeration>

<xs:enumeration value="email"></xs:enumeration>

<xs:enumeration value="checkbox"></xs:enumeration>

<xs:enumeration value="number"></xs:enumeration>

<xs:enumeration value="hostname"></xs:enumeration>

</xs:restriction>

</xs:simpleType>

</xs:attribute>

<xs:attribute name="identical" type="xs:string" use="optional">

<xs:annotation>

<xs:documentation>Use to check equality with other parameter</xs:documentation>

</xs:annotation>

</xs:attribute>

<xs:attribute name="readonly" type="xs:boolean" use="optional" />

</xs:complexType>

</xs:element>

<xs:element name="variables">

<xs:annotation>

<xs:documentation>Environment variables for the deployment scripts</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element minOccurs="0" maxOccurs="unbounded" name="variable">

<xs:annotation>

<xs:documentation>Single environment variable with a name and a

string value.</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:attribute name="name" use="required">

<xs:annotation>

<xs:documentation>Environment variable name.</xs:documentation>

</xs:annotation>

<xs:simpleType>

<xs:restriction base="xs:string">

<xs:whiteSpace value="preserve" />

<xs:minLength value="1" />

</xs:restriction>

</xs:simpleType>

</xs:attribute>

<xs:attribute name="value" use="required">

<xs:annotation>

<xs:documentation>Environment variable value.</xs:documentation>

</xs:annotation>

<xs:simpleType>

<xs:restriction base="xs:string">

<xs:minLength value="1" />

</xs:restriction>

</xs:simpleType>

</xs:attribute>

</xs:complexType>

</xs:element>

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="persistentresources">

<xs:annotation>

<xs:documentation>Persistent resources to be kept during upgrade</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="resource" minOccurs="0" maxOccurs="unbounded" />

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:schema>

 

 

Read Also

  Example Codes    
  Working with Libraries    
  Understanding the Pacakge Structure    
  Preparing the Package Using the Deployment Tool