]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-12, CSPACE-13: First iteration of a schema and example document for a service...
authorAron Roberts <aron@socrates.berkeley.edu>
Fri, 27 Feb 2009 22:23:13 +0000 (22:23 +0000)
committerAron Roberts <aron@socrates.berkeley.edu>
Fri, 27 Feb 2009 22:23:13 +0000 (22:23 +0000)
sandbox/aron/schema/serviceResponse.rng [new file with mode: 0644]
sandbox/aron/schema/serviceResponse.xml [new file with mode: 0644]

diff --git a/sandbox/aron/schema/serviceResponse.rng b/sandbox/aron/schema/serviceResponse.rng
new file mode 100644 (file)
index 0000000..c4d759d
--- /dev/null
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+
+       serviceResponse.rng
+
+       A schema defining the representation of the data returned in
+       response to a request.  This may include a result code and
+       message, as well as a block containing any arbitrary XML-based data.
+       
+       This schema was created for the CollectionSpace system,
+       http://www.collectionspace.org/
+       
+       It is written in the XML syntax of the RELAX NG schema language,
+       http://relaxng.org/
+
+-->
+
+<grammar
+       xmlns="http://relaxng.org/ns/structure/1.0"
+       datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+
+       <start>
+    
+               <element
+                       name="response">
+               
+                       <!-- ######################### -->
+                       <!-- Result                    -->
+                       <!-- ######################### -->
+                       
+                       <!-- The result of the operation. -->
+                       <element name="result">
+                       
+                               <!--
+                                       A service-dependent result code, which must be
+                                       at least one character in length.
+                               -->
+                               <element name="resultCode">
+                                       <data type="normalizedString">
+                                               <param name="minLength">1</param>
+                                       </data>
+                               </element>
+                               
+                               <!--
+                                       An (optional) service-dependent message,
+                                       presumably corresponding to the result code.
+                               -->
+                               <element name="resultMessage">
+                                       <choice>
+                                               <empty/>
+                                               <data type="normalizedString" />
+                                       </choice>
+                               </element>
+                               
+                       </element>
+               
+               
+                       <!-- ######################### -->
+                       <!-- Data                      -->
+                       <!-- ######################### -->
+               
+                       <!--
+                               The data returned to the caller after performing the operation.
+
+                               The data may be any one of the following:
+                               - Empty (blank);
+                               - Any text; or
+                               - Any combination of elements, each of which may have attributes,
+                                 text nodes, and child elements.
+                       -->
+                       
+                       <!--
+                               Note: we may want to add a MIME type attribute, and to consider how to
+                               structure this for potentially returning multipart MIME data or the like,
+                               for use cases where we might need to return multiple media objects, etc.
+                       -->
+                       <element name="data">
+                               <choice>
+                                       <empty/>
+                                       <text/>
+                                       <ref name="anyElement"/>
+                               </choice>
+                       </element>
+
+               </element>
+       
+       </start>
+       
+       <!--
+               See the "Name Classes" section in the RELAX NG tutorial,
+               http://relaxng.org/tutorial-20011203.html#IDAFLZR
+       -->
+  <define name="anyElement">
+    <element>
+      <anyName/>
+      <zeroOrMore>
+                               <choice>
+                                       <attribute>
+                                               <anyName/>
+                                       </attribute>
+                                       <text/>
+                                       <ref name="anyElement"/>
+                               </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+       
+</grammar>
+
diff --git a/sandbox/aron/schema/serviceResponse.xml b/sandbox/aron/schema/serviceResponse.xml
new file mode 100644 (file)
index 0000000..daeed3d
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+
+       serviceResponse.xml
+
+       A hypothetical instance of an serviceResponse document.
+
+       This document was created for the CollectionSpace system,
+       http://www.collectionspace.org/
+
+-->
+
+<!-- Note: this root element may require a namespace. -->
+<response>
+       <result>
+               <resultCode>1005</resultCode>
+               <resultMessage></resultMessage>
+       </result>
+       <!--
+               The 'data' element below may be empty, contain any text,
+               or consist of any XML element, which may have attributes,
+               text nodes, and child elements.
+       -->
+       <data>foo</data>
+</response>