AW: [opencms-dev] error creating xmlcontent

Ulrich Rueth lists at rueth.info
Tue Apr 5 20:44:47 CEST 2005


Funny enough, I'm getting a completely different exception:

java.lang.RuntimeException: No XML schema set for content definition
	at
org.opencms.xml.content.CmsXmlContent.getContentDefinition(CmsXmlContent.jav
a:507)
	at org.opencms.xml.content.CmsXmlContent.<init>(CmsXmlContent.java:128)
	at
org.opencms.xml.content.CmsXmlContentFactory.unmarshal(CmsXmlContentFactory.
java:244)
	...

No idea so far. I compared it to my schemas but found no error...

Regards
Ulrich

-----Ursprüngliche Nachricht-----
Von: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org]Im Auftrag von Ivan Saracino
Gesendet: Dienstag, 5. April 2005 20:14
An: The OpenCms mailing list
Betreff: RE: [opencms-dev] error creating xmlcontent



Ulrich thx for the answer.

Here are the two schemas:

1) path:
/system/modules/it.site.www/xmlcontentdefinitions/menudx/myLinks.xsd


<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
  <xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>
  <xsd:element name="MyLinks" type="OpenCmsMyLinks"/>
  <xsd:complexType name="OpenCmsMyLinks">
    <xsd:sequence>
      <xsd:element name="MyLink" type="OpenCmsMyLink" minOccurs="0"
maxOccurs="unbounded" />
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="OpenCmsMyLink">
    <xsd:sequence>
     	<xsd:element name="Nome" type="OpenCmsString" />
      <xsd:element name="Url" type="OpenCmsVfsFile" />
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>


2) path:
/system/modules/it.site.www/xmlcontentdefinitions/menudx/menudestra.xsd

	<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
	<xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>
	<xsd:includeschemaLocation="opencms://system/modules/it.site.www/xmlcontent
definitions/menudx/myLinks.xsd"/>
	<xsd:element name="MenuDestras" type="OpenCmsMenuDestras" />
	<xsd:complexType name="OpenCmsMenuDestras">
		<xsd:sequence>
			<xsd:element name="MenuDestra" type="OpenCmsMenuDestra" minOccurs="0"
maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="OpenCmsMenuDestra">
	<xsd:sequence>
		<xsd:element name="TitoloMenu" type="OpenCmsVfsFile"  />
		<xsd:element name="Link" type="OpenCmsMyLink" minOccurs="0"
maxOccurs="unbounded" />
	</xsd:sequence>
	<xsd:attribute name="language" type="OpenCmsLocale" use="optional"/>
	</xsd:complexType>
	<xsd:annotation>
		<xsd:appinfo>
			<layouts>
				<layout element="TitoloMenu" widget="ImageGalleryWidget" />
			</layouts>
		</xsd:appinfo>
  </xsd:annotation>
</xsd:schema>

The first schema is nested into the second.

I think the problem is in the first schema but I did not find it.

Here are the two xml generic file:


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

<MenuDestras xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="opencms://system/modules/it.site.www/xmlconte
ntdefinitions/menudx/menudestra.xsd">
  <MenuDestra language="en">
    <TitoloMenu/>
    <Link>
      <Nome/>
      <Url/>
    </Link>
    <Link>
      <Nome/>
      <Url/>
    </Link>
    <Link>
    </Link>
  </MenuDestra>
</MenuDestras>


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

<MyLinks xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="opencms://system/modules/it.site.www/xmlconte
ntdefinitions/menudx/mylinks.xsd">
  <MyLink>
    <Nome/>
    <Url/>
  </MyLink>
</MyLinks>




___________________________________________________________

  Ivan Saracino ivan.saracino at newmedia.it
  NewMedia Solutions srl - Via San Gregorio 6, 20124 Milano
  Tel (+39) 02 202316.1 - Fax (+39) 02 202316.50
  site:   http://www.newmediasolutions.it
  portal: http://www.newmedia.it
___________________________________________________________

-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Ulrich Rueth
Sent: martedì 5 aprile 2005 18.50
To: The OpenCms mailing list
Subject: AW: [opencms-dev] error creating xmlcontent

Ivan,

make sure that the types you define start with "OpenCms...". The first one
must be named exactly like the second one, but with an "s" appended, like
"OpenCmsMyArticles" for the first one and "OpenCmsMyArticle" for the second
one.

If you post (parts of) your schema here, it would be easier to help.

Regards
Ulrich

-----Ursprungliche Nachricht-----
Von: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org]Im Auftrag von Ivan Saracino
Gesendet: Dienstag, 5. April 2005 18:39
An: opencms-dev at opencms.org
Betreff: [opencms-dev] error creating xmlcontent



Hi all,

I lost one day without finding a solution.

I created a .xsd schema file for a new xmlcontent.
When I try to create (save) a generic-xml file according to this schema
(edit controlcode...) this error appears:

Invalid OpenCms content definition XML schema structure: Expected two type
elements [Code 400 - Error in xml processing].

I created few days ago other xmlcontent without problems and I'm SURE the
xml file and its schema are correct.

Has somebody experienced this problem too?
thx all.

___________________________________________________________

  Ivan Saracino ivan.saracino at newmedia.it
  NewMedia Solutions srl - Via San Gregorio 6, 20124 Milano
  Tel (+39) 02 202316.1 - Fax (+39) 02 202316.50
  site:   http://www.newmediasolutions.it
  portal: http://www.newmedia.it
___________________________________________________________



_______________________________________________
This mail is send to you from the opencms-dev mailing list To change your
list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev



_______________________________________________
This mail is send to you from the opencms-dev mailing list To change your
list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev



_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list