[opencms-dev] Configuration File with a Schema

Marc Schlegel my.mailing.lists at gmx.de
Mon Jan 7 14:48:43 CET 2008


Hello again.

I am facing the next problem. I would like to have a configuration file 
for my template similar to the one TemplateOne provides. So I copied the 
schema and removed anything I don't need.

This is whats left (for testing)

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified">
    <xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>
    <xsd:element name="templateconfiguration" type="TemplateConfiguration"/>
   
    <xsd:complexType name="TemplateConfiguration">
        <xsd:sequence>
            <xsd:element name="config" type="Configuration" 
minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="Configuration">
        <xsd:sequence>
            <xsd:element name="layout.version" type="OpenCmsString" 
minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>


My config.xml file now looks like

<?xml version="1.0" encoding="UTF-8"?>
<templateconfiguration 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="opencms://system/modules/de.fun_alliance.frontend.template/schemas/config.xsd">
  <config>
    <layout.version><![CDATA[internet]]></layout.version>
  </config>
</templateconfiguration>

But when I try to save this I am getting errors, that the 
xml-content-definition-schema cannot be created.
I've read that I need to add something to opencms-modules.xml when 
adding structured content, but I couldn't find anything for a simple 
configuration xml.

I am trying to get this running for some hours now and I don't have a 
clue whats wrong.
Any help is appreciated.



More information about the opencms-dev mailing list