X Tutup
Skip to content

Commit bc6a3bf

Browse files
author
Russ Miles
committed
SESPRINGPYTHONPY-68: Updated schema to incorporate a specific type for properties. This allowed us to then specify a list collection as being the contents of a property. Also included for consistency against the Spring Java schema is support for the value attribute, the ref attribute and embedded element, and nested component declarations.
git-svn-id: https://src.springframework.org/svn/se-springpython-py/trunk/springpython@178 ce8fead1-4192-4296-8608-a705134b927f
1 parent 304bcc5 commit bc6a3bf

File tree

1 file changed

+83
-4
lines changed

1 file changed

+83
-4
lines changed

xml/schema/context/spring-python-context-1.0.xsd

Lines changed: 83 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,7 @@
151151
</xsd:complexType>
152152
</xsd:element>
153153

154-
<!-- TODO Right now properties are specific with element content, as opposed
155-
to using the value attribute -->
156-
<!--type="propertyType" -->
157-
<xsd:element name="property" >
154+
<xsd:element name="property" type="propertyType" >
158155
<xsd:annotation>
159156
<xsd:documentation><![CDATA[
160157
Component definitions can have zero or more properties.
@@ -169,6 +166,8 @@
169166
<xsd:element ref="description" minOccurs="0"/>
170167
<xsd:choice minOccurs="0" maxOccurs="1">
171168
<xsd:element ref="value"/>
169+
<xsd:element ref="ref"/>
170+
<xsd:element ref="list"/>
172171
<xsd:any namespace="##other" processContents="strict"/>
173172
</xsd:choice>
174173
</xsd:sequence>
@@ -179,6 +178,13 @@
179178
]]></xsd:documentation>
180179
</xsd:annotation>
181180
</xsd:attribute>
181+
<xsd:attribute name="ref" type="xsd:string">
182+
<xsd:annotation>
183+
<xsd:documentation><![CDATA[
184+
A short-cut alternative to a nested "<ref component='...'/>".
185+
]]></xsd:documentation>
186+
</xsd:annotation>
187+
</xsd:attribute>
182188
<xsd:attribute name="value" type="xsd:string">
183189
<xsd:annotation>
184190
<xsd:documentation><![CDATA[
@@ -224,6 +230,79 @@
224230
</xsd:complexType>
225231
</xsd:element>
226232

233+
<xsd:element name="ref">
234+
<xsd:annotation>
235+
<xsd:documentation><![CDATA[
236+
Defines a reference to another component in this factory or an external
237+
factory (parent or included factory).
238+
]]></xsd:documentation>
239+
</xsd:annotation>
240+
<xsd:complexType>
241+
<xsd:complexContent>
242+
<xsd:restriction base="xsd:anyType">
243+
<xsd:attribute name="component" type="xsd:string">
244+
<xsd:annotation>
245+
<xsd:documentation><![CDATA[
246+
The name of the referenced bean.
247+
]]></xsd:documentation>
248+
</xsd:annotation>
249+
</xsd:attribute>
250+
<xsd:attribute name="local" type="xsd:IDREF">
251+
<xsd:annotation>
252+
<xsd:documentation><![CDATA[
253+
The name of the referenced bean. The value must be a bean ID and thus can
254+
be checked by the XML parser. This is therefore the preferred technique
255+
for referencing beans within the same bean factory XML file.
256+
]]></xsd:documentation>
257+
</xsd:annotation>
258+
</xsd:attribute>
259+
</xsd:restriction>
260+
</xsd:complexContent>
261+
</xsd:complexType>
262+
</xsd:element>
263+
264+
<xsd:element name="null">
265+
<xsd:annotation>
266+
<xsd:documentation>
267+
Denotes a Python None value. Necessary because an empty "value" tag
268+
will resolve to an empty String, which will not be resolved to a
269+
None value unless a special PropertyEditor does so.
270+
</xsd:documentation>
271+
</xsd:annotation>
272+
<xsd:complexType mixed="true">
273+
<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
274+
</xsd:complexType>
275+
</xsd:element>
276+
277+
<!-- Collection Elements -->
278+
<xsd:group name="collectionElements">
279+
<xsd:sequence>
280+
<xsd:choice minOccurs="0" maxOccurs="unbounded">
281+
<xsd:element ref="component"/>
282+
<xsd:element ref="ref"/>
283+
<xsd:element ref="value"/>
284+
<xsd:element ref="null"/>
285+
<xsd:element ref="list"/>
286+
<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
287+
</xsd:choice>
288+
</xsd:sequence>
289+
</xsd:group>
290+
291+
<xsd:element name="list" type="listOrSetType">
292+
<xsd:annotation>
293+
<xsd:documentation><![CDATA[
294+
A list can contain multiple inner component, ref, collection, or value
295+
elements. The necessary conversion is automatically performed
296+
by the ComponentFactory.
297+
]]></xsd:documentation>
298+
</xsd:annotation>
299+
</xsd:element>
300+
301+
<!-- 'list' and 'set' collection type -->
302+
<xsd:complexType name="listOrSetType">
303+
<xsd:group ref="collectionElements"/>
304+
</xsd:complexType>
305+
227306
<!-- simple internal types -->
228307
<xsd:simpleType name="defaultable-boolean">
229308
<xsd:restriction base="xsd:NMTOKEN">

0 commit comments

Comments
 (0)
X Tutup