[opencms-dev] XSD: validationrules

Georg Raffer georg.nc at gmail.com
Thu Jan 19 10:20:22 CET 2006


hi guys,

can anyone please explain how the validationrules in OpenCms XML content 
objects work?

For my example (see below): The field matchcode must not be empty. How 
exactly must "rule" look like?
Thanks in advance!

bye, Georg


Here is the important part of my xsd file:

  <xsd:complexType name="OpenCmsAktion">
    <xsd:sequence>
      <xsd:element name="Title" type="OpenCmsString" />
      <xsd:element name="Matchcode" type="OpenCmsString" />
    </xsd:sequence>
    <xsd:attribute name="language" type="OpenCmsLocale" use="optional" />
  </xsd:complexType>

  <xsd:annotation>
    <xsd:appinfo>
      <resourcebundle 
name="org.opencms.frontend.templateone.modules.workplace" />
      <mappings>
        <mapping element="Title" mapto="property:Title" />       
      </mappings>
      <layouts/>
      <validationrules>
        <rule element="Matchcode" regex="!.*[Ee]rror.*" 
message="${key.editor.errormessage.Article.mustnotcontainerror|${validation.path}}" 
/>
      </validationrules>     
      <defaults/>
    </xsd:appinfo>
  </xsd:annotation>




More information about the opencms-dev mailing list