[opencms-dev] Localization of xmlcontent validation errors

Olaitan Olamilehin olaitan.olamilehin at moremr.com
Tue Feb 9 10:19:06 CET 2010

Hi Everyone,

Am trying to localize errors generated from validating unique field
values. Basically, I am using <xsd:unique> for the validation not

        <xsd:element name="items" type="Items">
          <xsd:unique name="productName">
            <xsd:selector xpath="item"/>
            <xsd:field    xpath="ProductName"/>

I know <validationrules> allows you to set appropriate localized
messages but the validation is based on regular expressions.  See
example below:

           <rule element="Title" regex="!.*[Ee]rror.*" message="${key.editor.errormessage.Article.mustnotcontainerror|${validation.path}}" />
However, in my case am not validating the field value but the occurrence
of the field value (i.e that the field value is unique). The validation
works just fine using <xsd:unique> but I would like to localize the xsd
errors that is shown. Currently, the xsd error is not user-friendly. See

        XML validation error : 
        <error column="46" line="27">cvc-identity-constraint.4.1: Duplicate unique value [test] declared for identity constraint "productName" of element "items".</error>

Any help would be much appreciated. Thanks in anticipation of a quick


More information about the opencms-dev mailing list