adds namespace config element to XSD + fixes error message for duplicate namespace prefixes

Wed, 04 Oct 2017 13:06:24 +0200

author
Mike Becker <universe@uap-core.de>
date
Wed, 04 Oct 2017 13:06:24 +0200
changeset 321
eb8885a87866
parent 320
12ed560c926c
child 322
d2ca9c2a2fac

adds namespace config element to XSD + fixes error message for duplicate namespace prefixes

dav/config.c file | annotate | diff | comparison | revisions
docs/schema/config.xsd file | annotate | diff | comparison | revisions
--- a/dav/config.c	Tue Oct 03 16:59:39 2017 +0200
+++ b/dav/config.c	Wed Oct 04 13:06:24 2017 +0200
@@ -528,7 +528,7 @@
             } else {
                 print_error(
                         node->line,
-                        "unknown attribute %s\n", (char*)attr->name);
+                        "unexpected attribute %s\n", (char*)attr->name);
                 return 1;
             }
         }
@@ -545,7 +545,7 @@
     }
     
     if(dav_get_namespace(context, prefix)) {
-        fprintf(stderr, "Error: namespace prefix '%s' already used\n", prefix);
+        print_error(node->line, "namespace prefix '%s' already used\n", prefix);
         return 1;
     }
     
--- a/docs/schema/config.xsd	Tue Oct 03 16:59:39 2017 +0200
+++ b/docs/schema/config.xsd	Wed Oct 04 13:06:24 2017 +0200
@@ -56,6 +56,11 @@
         </xs:all>
     </xs:complexType>
     
+    <xs:complexType name="namespace">
+        <xs:attribute name="prefix" type="xs:string" use="required"/>
+        <xs:attribute name="uri" type="xs:anyURI" use="required"/>
+    </xs:complexType>
+    
     <xs:simpleType name="sslVersionEnum" >
         <xs:restriction base="xs:string">
             <xs:enumeration value="TLSv1" />
@@ -111,8 +116,9 @@
         <xs:complexType>
             <xs:sequence minOccurs="0" maxOccurs="unbounded">
                 <xs:element name="key"
-                            minOccurs="0" type="t:encryptionKey">
-                </xs:element>
+                            minOccurs="0" type="t:encryptionKey"/>
+                <xs:element name="namespace"
+                            minOccurs="0" type="t:namespace"/>
                 <xs:element name="http-proxy"
                             minOccurs="0" type="t:networkProxy" />
                 <xs:element name="https-proxy"

mercurial