[opencms-dev] /* How to create new ARTICLE? */

Ivo Pescia ivo.pescia at numcom.com
Thu Jan 19 16:04:32 CET 2006


Hi, 
 
i barely remember something which might help you solve your problem:
 
i think your not allowed to use:
<xsd:element name="myarticles" type="OpenCmsMyArticles" />

<xsd:complexType name="OpenCmsMyArticles">

 

but you have to calle the types

OpenCmsMyArticles   ->   OpenCmsMyarticles
 
 
try if this solves your problem. maybe someone else knows more.
It's been a few months i've been doing strucutred content.
 
hth

________________________________

From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Wils
Sent: Donnerstag, 19. Januar 2006 15:36
To: opencms-dev at opencms.org
Subject: [opencms-dev] /* How to create new ARTICLE? */
Importance: High


 

Hi people,

I am using this step-by-step:
http://mail.opencms.org/pipermail/opencms-dev/2004q4/013609.html
 
i has:
 
/sites/wils/myfolder/

In "myfolder" i has:
- myarticle
- myarticle.xsd
 
When try create myarticle i take an error:
"Caused by: org.opencms.xml.CmsXmlException: Invalid OpenCms content
definition XML schema structure:
Element "/xsd:schema/xsd:complexType[1]/xsd:sequence/xsd:element"
attribute "type" value must be "OpenCmsMyarticle" not
"OpenCmsMyArticle".
at
org.opencms.xml.CmsXmlContentDefinition.validateAttribute(CmsXmlContentD
efinition.java:512) "
 
 
Please look at my 2 files struture:


1 - myarticle:



<?xml version="1.0" encoding="UTF-8" ?>

<myarticles xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="opencms://sites/wils/myfolder/myarticle.x
sd">

<myarticle language="en">

<title><![CDATA[Sample article 1]]></title>

</myarticle>

</myarticles>

 

2 - myarticle.xsd

<?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="myarticles" type="OpenCmsMyArticles" />

<xsd:complexType name="OpenCmsMyArticles">

<xsd:sequence>

<xsd:element name="myarticle" type="OpenCmsMyArticle" minOccurs="0"
maxOccurs="unbounded" />

</xsd:sequence>

</xsd:complexType>

<xsd:complexType name="OpenCmsMyArticle">

<xsd:sequence>

<xsd:element name="title" type="OpenCmsString" />

</xsd:sequence>

<xsd:attribute name="language" type="OpenCmsLocale" use="required" />

</xsd:complexType>

<xsd:annotation>

<xsd:appinfo>

<mapping element="Title" mapto="property:Title" />

</xsd:appinfo>

</xsd:annotation>

</xsd:schema>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060119/d03ec34e/attachment.htm>


More information about the opencms-dev mailing list