[opencms-dev] Summary HowTo on nested XML content schemas

Ulrich Rueth lists at rueth.info
Wed Dec 29 18:46:58 CET 2004


Dear list,

I fought quite a bit until I got my nested XML content schemas running.
Therefore I will share the summary of my experiences with all of you. Please
read Alexander's HowTo first
(http://mail.opencms.org/pipermail/opencms-dev/2004q4/013609.html), the
following is only additional. In addition, have a close look at the nested
xml content demo delivered with OpenCms 6.

- The element type names must start with "OpenCms...", the names of the
elements must be the same string as the type name, but without the
"OpenCms". Example:

	<xsd:element name="MyArticles" type="OpenCmsMyArticles"/>
	<xsd:complexType name="OpenCmsMyArticles">
		...
	</xsd:complexType>

- If nesting elements, the nested schema definition must be in a separate
file with the identical structure and imported _after_ the global opencms
import statement:

	<xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>
	<xsd:include
schemaLocation="opencms://system/modules/info.rueth.opencms.articles/schemas
/myownschema.xsd"/>

- The "singular" (second) type definition _must_ define the attribute
<xsd:attribute name="language" type="OpenCmsLocale" use="required"/>. But it
may be optional. Other attribute definitions seem not be allowed, they
should rather be used as normal elements in the sequence element.

Regards
Ulrich




More information about the opencms-dev mailing list