summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2011-10-11 08:28:48 (GMT)
committerChristian Mollekopf <chrigi_1@fastmail.fm>2011-10-11 08:28:48 (GMT)
commit06c3b1aeec4bca4ae773a4f31f3d6fc711d5d036 (patch)
tree647b2b2920d1af6f48fb968bc04c2522e7ff9751
downloadlibkolabxml-06c3b1aeec4bca4ae773a4f31f3d6fc711d5d036.tar.gz
initial commit
-rw-r--r--schemas/base.xsd53
-rw-r--r--schemas/note.xsd33
-rw-r--r--testfiles/testnote.xml18
3 files changed, 104 insertions, 0 deletions
diff --git a/schemas/base.xsd b/schemas/base.xsd
new file mode 100644
index 0000000..d0e6c2b
--- /dev/null
+++ b/schemas/base.xsd
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.kolab.org/Kolab"
+ xmlns="http://www.kolab.org/Kolab"
+ elementFormDefault="qualified">
+
+ <xs:complexType name="XMLBase" abstract="true">
+ <xs:sequence>
+ <xs:element name="uid">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1"/>
+ <xs:whiteSpace value="collapse"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="body" type="xs:string"/>
+ <xs:element name="categories">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:pattern value="(\w+(,\w+)+)?"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="creation-date" type="xs:dateTime"/>
+ <xs:element name="last-modification-date" type="xs:dateTime"/>
+ <xs:element name="sensitivity" type="SensitivityType" default="public"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded"
+ name="inline-attachment" type="xs:string"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded"
+ name="link-attachment" type="xs:string"/>
+ <xs:element name="product-id" type="xs:string"/>
+ </xs:sequence>
+ <xs:attribute name="version" type="xs:double"/>
+ </xs:complexType>
+
+ <xs:simpleType name="Color">
+ <xs:restriction base="xs:string">
+ <xs:length value="7"/>
+ <xs:pattern value="#([a-f;0-9]){6}"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="SensitivityType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="private"/>
+ <xs:enumeration value="confidential"/>
+ <xs:enumeration value="public"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:attribute name="version" type="xs:float"/>
+</xs:schema> \ No newline at end of file
diff --git a/schemas/note.xsd b/schemas/note.xsd
new file mode 100644
index 0000000..810bfb8
--- /dev/null
+++ b/schemas/note.xsd
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.kolab.org/Kolab"
+ xmlns="http://www.kolab.org/Kolab"
+ elementFormDefault="qualified">
+
+ <xs:include schemaLocation="base.xsd" />
+
+ <xs:element name="note" type="Note"/>
+
+ <xs:complexType name="Note">
+ <xs:complexContent>
+ <xs:extension base="XMLBase">
+ <xs:sequence>
+ <xs:element name="summary" type="xs:string"/>
+ <xs:element name="background-color" type="Color"/>
+ <xs:element name="foreground-color" type="Color"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <!-- xs:complexType name="ExtendedNote">
+ <xs:complexContent>
+ <xs:extension base="Note">
+ <xs:sequence>
+ <xs:any namespace="##any" processContents="skip"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType-->
+</xs:schema> \ No newline at end of file
diff --git a/testfiles/testnote.xml b/testfiles/testnote.xml
new file mode 100644
index 0000000..652f5b2
--- /dev/null
+++ b/testfiles/testnote.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dns:note version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dns="http://www.kolab.org/Kolab" xsi:schemaLocation="http://www.kolab.org/Kolab note.xsd">
+ <!-- Common fields -->
+ <dns:uid>uid</dns:uid>
+ <dns:body></dns:body>
+ <dns:categories></dns:categories>
+ <dns:creation-date>2004-05-04T15:00:00Z</dns:creation-date>
+ <dns:last-modification-date>2004-05-04T15:00:00Z</dns:last-modification-date>
+ <dns:sensitivity>public</dns:sensitivity>
+ <dns:inline-attachment></dns:inline-attachment>
+ <dns:link-attachment></dns:link-attachment>
+ <dns:product-id></dns:product-id>
+ <!-- Note specific fields -->
+ <dns:summary>summarytext</dns:summary>
+ <dns:background-color>#000000</dns:background-color>
+ <dns:foreground-color>#ffff00</dns:foreground-color>
+</dns:note>
+