[opencms-dev] Problems using xml-templates

Thomas Kraft thomas.kraft at synyx.de
Mon Mar 31 18:15:29 CEST 2003


Hi there,

i tried to create a page and i get a error i can't explain (OpenCMS
Version 5 RC2):I have a Mastertemplate located in
/system/modules/templates/org.opencms.default/ with a content like this:
<?xml version="1.0"?>
<xmltemplate>
  <elementdef name="contenttemplate">
    <class>com.opencms.template.CmsXmlTemplate</class>
    <template>/synyx/templates/contenttemplate</template>
  </elementdef>
  <elementdef name="tabletemplate">
    <class>com.opencms.template.CmsXmlTemplate</class>
    <template>/synyx/templates/tabletemplate</template>
  </elementdef>
[...]
  <template>
    <element name="contenttemplate"/>
  </template>
<template>
</xmltemplate>

The Type of this file is xml-template (Why are the open-cms templates type
"plain" ??)
I have the defined subtemplates (contenttemplate + tabletemplate) located
in the /synyx/templates folder. These are type "xml-template", too.
they look like this:

[contenttemplate]

<?xml version="1.0"?>
<xmltemplate>
<template><![CDATA[ <html-code> ]]>
<element name="tabletemplate"/><![CDATA[<more-html-code>
]]>
</template>
</xmltemplate>

[tabletemplate]

<?xml version="1.0"?>
<xmltemplate>
<template><![CDATA[ <html-code> ]]>
</template>
</xmltemplate>

...

I created a html file called "index.html" in the /synyx/ folder of my
project using my own mastertemplate as "Template" of this html File.
When I click on this "index.html" file I created, a popup window occurs
displaying my site correctly. With all the html-code of the two templates
"contenttemplate" and "tabletemplate". That's fine. But when I try to
publish this projekt it doesn't work. The OpenCMS tells me the following
errors:
"The file /synyx/index.html" doesn't exist - skipping export

Exception com.opencms.core.CmsException: 17 Service not available.
Detailed error: There was an error while parsing XML page file
/synyx/templates/tabletemplate.root cause was com.opencms.core.CmsException: 20 Wrong XML content type.
Detailed error: XML document /synyx/templates/tabletemplate is not of the
expected type. This document is "xmltemplate" but it should be "PAGE"
(OpenCms XML Page File)
Now i ask me: Why is the document type of the wrong type? Why can't I use
XMLTemplates here in the context?
I would be very pleased if you could tell me where my failure is.

Thanks in advance,

Thomas Kraft





More information about the opencms-dev mailing list