On 03/10/2014 13:14, Konstantin Kolinko wrote:
> 2014-10-03 15:50 GMT+04:00  <ma...@apache.org>:
>> Author: markt
>> Date: Fri Oct  3 11:50:14 2014
>> New Revision: 1629185
>>
>> URL: http://svn.apache.org/r1629185
>> Log:
>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=43548
>> Add an XML schema for the tomcat-users.xml file.
>>
>> Added:
>>     tomcat/trunk/conf/tomcat-users.xsd   (with props)
>> Modified:
>>     tomcat/trunk/conf/tomcat-users.xml
>>     tomcat/trunk/java/org/apache/catalina/users/MemoryUserDatabase.java
>>     tomcat/trunk/res/confinstall/tomcat-users_1.xml
>>     tomcat/trunk/webapps/docs/changelog.xml
>>
>> Modified: tomcat/trunk/conf/tomcat-users.xml
>> URL: 
>> http://svn.apache.org/viewvc/tomcat/trunk/conf/tomcat-users.xml?rev=1629185&r1=1629184&r2=1629185&view=diff
>> ==============================================================================
>> --- tomcat/trunk/conf/tomcat-users.xml (original)
>> +++ tomcat/trunk/conf/tomcat-users.xml Fri Oct  3 11:50:14 2014
>> @@ -15,7 +15,10 @@
>>    See the License for the specific language governing permissions and
>>    limitations under the License.
>>  -->
>> -<tomcat-users>
>> +<tomcat-users xmlns="http://tomcat.apache.org/xml";
> 
> Your namespace above does not match the one used in xsi:schemaLocation
> attribute and one used as targetNamespace in the schema file.

Thanks. I was trying different versions and I thought I had them
aligned. I'll get them fixed.

> 
>> +              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>> +              xsi:schemaLocation="http://tomcat.apache.org tomcat-users.xsd"
>> +              version="1.0">
>>  <!--
>>    NOTE:  By default, no user is included in the "manager-gui" role required
>>    to operate the "/manager/html" web application.  If you wish to use this 
>> app,
>> @@ -33,4 +36,5 @@
>>    <user username="both" password="tomcat" roles="tomcat,role1"/>
>>    <user username="role1" password="tomcat" roles="role1"/>
>>  -->
>> +
>>  </tomcat-users>
>>
>> Added: tomcat/trunk/conf/tomcat-users.xsd
>> URL: 
>> http://svn.apache.org/viewvc/tomcat/trunk/conf/tomcat-users.xsd?rev=1629185&view=auto
>> ==============================================================================
>> --- tomcat/trunk/conf/tomcat-users.xsd (added)
>> +++ tomcat/trunk/conf/tomcat-users.xsd Fri Oct  3 11:50:14 2014
>> @@ -0,0 +1,43 @@
>> +<?xml version="1.0" encoding="UTF-8" ?>
>> +<xs:schema xmlns="http://www.w3.org/2001/XMLSchema";
>> +           targetNamespace="http://tomcat.apache.org";
> 
> I wonder whether it is OK to use above URL as a namespace. It is not
> distinctive.
> 
> Other configuration files (such as server.xml) have rather different
> elements, but (in theory) may be in the same namespace.

I think adding xml at the end makes sense.

Mark


> 
>> +           xmlns:users="http://tomcat.apache.org";
>> +           xmlns:xs="http://www.w3.org/2001/XMLSchema";
>> +           elementFormDefault="qualified"
>> +           attributeFormDefault="unqualified"
>> +           version="1.0">
>> +  <xs:element name="tomcat-users">
>> +    <xs:complexType>
>> +      <xs:sequence>
>> +        <xs:element name="role" minOccurs="0" maxOccurs="unbounded">
>> +          <xs:complexType>
>> +            <xs:attribute name="rolename" use="required" 
>> type="users:entityname" />
>> +            <xs:attribute name="description" type="xs:string" />
>> +          </xs:complexType>
>> +        </xs:element>
>> +        <xs:element name="group" minOccurs="0" maxOccurs="unbounded">
>> +          <xs:complexType>
>> +            <xs:attribute name="groupname" use="required" 
>> type="users:entityname" />
>> +            <xs:attribute name="description" type="xs:string" />
>> +            <xs:attribute name="roles" type="xs:string" />
>> +          </xs:complexType>
>> +        </xs:element>
>> +        <xs:element name="user" minOccurs="0" maxOccurs="unbounded">
>> +          <xs:complexType>
>> +            <xs:attribute name="username" use="required" 
>> type="users:entityname" />
>> +            <xs:attribute name="fullname" type="xs:string" />
>> +            <xs:attribute name="password" type="xs:string" />
>> +            <xs:attribute name="roles" type="xs:string" />
>> +            <xs:attribute name="groups" type="xs:string" />
>> +          </xs:complexType>
>> +        </xs:element>
>> +      </xs:sequence>
>> +      <xs:attribute name="version" type="xs:string" />
>> +    </xs:complexType>
>> +  </xs:element>
>> +  <xs:simpleType name="entityname">
>> +    <xs:restriction base="xs:string">
>> +      <xs:minLength value="1"/>
>> +    </xs:restriction>
>> +  </xs:simpleType>
>> +</xs:schema>
>> \ No newline at end of file
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to