All pastes #957342 Raw Edit

Ryan

public xml v1 · immutable
#957342 ·published 2008-03-25 22:22 UTC
rendered paste body
<?xml version="1.0" encoding="UTF-8" standalone="no"?><xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"           xmlns:xs="http://www.w3.org/2001/XMLSchema"           targetNamespace="http://www.pranaframework.org/objs">    <xs:annotation>        <xs:documentation><![CDATA[            Prana Framework 0.4 Schema            Schema Authors: Ryan Gardner            This defines a simple and consistent way of creating a namespace            of ActionScript objects, managed by a Prana IOCContainer, read by            XmlObjectDefinitionParser.            Every attempt has been made to make this scheme comprehensive and correct.            One thing this schema does not do is allow you to use Spring "Bean" names            (but that's for my own sanity) - anyone wishing to modify it to allow the use            of either "objects / object" or "beans / bean" is free to do so.            I don't believe the parser is namespace aware at this point, so you should create            your document like this:                <?xml version="1.0" encoding="UTF-8" standalone="no"?>                <objects xmlns="http://www.pranaframework.org/objs"                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"                         xsi:schemaLocation="http://www.pranaframework.org/objs                         http://www.pranaframework.org/schema/objs/prana-objs-0.4.xsd">                    <!-- object and template definitions -->                                    </objects>            ]]>        </xs:documentation>    </xs:annotation>    <xs:element name="objects" >        <xs:complexType mixed="true">        <xs:sequence>            <xs:element type="templateType" name="template" maxOccurs="unbounded" minOccurs="0"/>            <xs:element type="objectType" name="object" maxOccurs="unbounded" minOccurs="0"/>        </xs:sequence>        </xs:complexType>    </xs:element>    <xs:complexType name="templateType">        <xs:annotation>            <xs:documentation> <![CDATA[                A template is used to assist in creation of other objects.                To use a template, you can specify variables in braces. Here is an example:                <template id="remoteObject">                    <object class="mx.rpc.remoting.mxml.RemoteObject">                        <property name="destination" value="GenericDestination"/>                        <property name="endpoint" ref="remoteGateway"/>                        <property name="source" value="ApplicationDomain.Services.${serviceClass}"/>                    </object>                </template>                and used like:                <object id="serviceLocator" class="org.pranaframework.cairngorm.CairngormServiceLocator"                        factory-method="getInstance">                    <property name="assetService" template="remoteObject">                        <param name="serviceClass" value="AssetService"/>                    </property>                    <property name="packageService" template="remoteObject">                        <param name="serviceClass" value="PackageService"/>                    </property>                    <property name="userService" template="remoteObject">                        <param name="serviceClass" value="UserService"/>                    </property>                </object>              ]]>            </xs:documentation>        </xs:annotation>        <xs:sequence>            <xs:element type="objectType" name="object"/>        </xs:sequence>        <xs:attribute type="xs:string" name="id" use="optional"/>    </xs:complexType>    <xs:complexType name="constructor-argType">        <xs:annotation>            <xs:documentation>Constructor arguments are currently passed in as a comma-delimited string.            </xs:documentation>        </xs:annotation>        <xs:simpleContent>            <xs:extension base="xs:string">                <xs:attribute type="xs:string" name="value" use="optional"/>            </xs:extension>        </xs:simpleContent>    </xs:complexType>    <xs:complexType name="propertyType" mixed="true">        <xs:sequence maxOccurs="1">            <xs:element type="templateParamType" name="param" minOccurs="0"/>            <xs:element type="arrayType" name="array" minOccurs="0"/>            <xs:element type="arrayCollectionType" name="array-collection" minOccurs="0"/>            <xs:element type="dictionaryType" name="dictionary" minOccurs="0"/>            <xs:element type="xs:string" name="ref" minOccurs="0"/>        </xs:sequence>        <xs:attribute type="xs:string" name="name" use="optional"/>        <xs:attribute type="xs:string" name="value" use="optional"/>        <xs:attribute type="xs:string" name="ref" use="optional"/>        <xs:attribute type="xs:string" name="template" use="optional"/>    </xs:complexType>    <xs:complexType name="dictionaryType">        <xs:annotation>            <xs:documentation><![CDATA[                A dictionary contains a list properties specified like this:                <property name="level">                    <dictionary>                        <entry>                            <key>a key</key>                            <value>a</value>                        </entry>                        <entry>                            <key>another key</key>                            <value>1</value>                        </entry>                        <entry>                            <key>true</key>                            <value>                                <array>                                    <value>b</value>                                    <value>c</value>                                </array>                            </value>                        </entry>                    </dictionary>                </property>              ]]>            </xs:documentation>        </xs:annotation>        <xs:sequence>            <xs:element type="dictionaryEntryType" name="entry" maxOccurs="unbounded" minOccurs="0"/>        </xs:sequence>    </xs:complexType>    <xs:complexType name="dictionaryEntryType">        <xs:sequence>            <xs:element name="key" type="xs:string"/>            <xs:element name="value">                <xs:complexType mixed="true">                    <xs:sequence>                        <xs:element type="arrayType" name="array" minOccurs="0"/>                    </xs:sequence>                </xs:complexType>            </xs:element>        </xs:sequence>    </xs:complexType>    <xs:complexType name="arrayType">        <xs:sequence>            <xs:element type="xs:string" name="value" maxOccurs="unbounded" minOccurs="0"/>            <xs:element type="xs:string" name="ref" minOccurs="0"/>        </xs:sequence>    </xs:complexType>    <xs:complexType name="arrayCollectionType">        <xs:annotation>            <xs:documentation>The array-collection contains a list of value nodes. Each value node contains a string.            </xs:documentation>        </xs:annotation>        <xs:sequence>            <xs:element name="value" type="xs:string" maxOccurs="unbounded" minOccurs="0"/>        </xs:sequence>    </xs:complexType>    <xs:complexType name="objectType" mixed="true">        <xs:annotation>            <xs:documentation>The Object type defines the basic Object that is injected by the IoC container.            </xs:documentation>        </xs:annotation>        <xs:sequence>            <xs:element type="propertyType" name="property" maxOccurs="unbounded" minOccurs="0">            </xs:element>            <xs:element type="constructor-argType" name="constructor-arg" minOccurs="0"/>        </xs:sequence>        <xs:attribute type="xs:string" name="class" use="required"/>        <xs:attribute type="xs:string" name="id" use="optional"/>        <xs:attribute type="xs:string" name="factory-method" use="optional"/>        <xs:attribute type="scopeType" name="scope" use="optional"/>        <xs:attribute type="xs:boolean" name="lazy-init" use="optional"/>        <xs:attribute type="xs:string" name="init-method" use="optional"/>        <xs:attribute type="xs:boolean" name="singleton" use="optional"/>    </xs:complexType>    <xs:complexType name="templateParamType">        <xs:annotation>            <xs:documentation>                Template parameters have a name and a value. Currently only string replacement for parameter values is                allowed.            </xs:documentation>        </xs:annotation>        <xs:simpleContent>            <xs:extension base="xs:string">                <xs:attribute type="xs:string" name="name" use="required"/>                <xs:attribute type="xs:string" name="value" use="required"/>            </xs:extension>        </xs:simpleContent>    </xs:complexType>    <xs:simpleType name="scopeType">        <xs:annotation>            <xs:documentation>Scope can be either prototype or singleton.</xs:documentation>        </xs:annotation>        <xs:restriction base="xs:string">            <xs:enumeration value="prototype"/>            <xs:enumeration value="singleton"/>        </xs:restriction>    </xs:simpleType></xs:schema>