[opencms-dev] AW: Nested Structured Content and Locale

bessette Bessette at pokemon-seattle.com
Wed May 2 16:16:48 CEST 2007


SWEET!  You don't know how much this will help me.

Thanks,
Eric


Nick Panienski wrote:
> 
> Hi Eric, you have to declare the third complex type in another schema.
> Include this schema in your original one and you can use your definiting
> for your third complex type.
>  
> Example:
> 
> test.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:include
> schemaLocation="opencms://system/modules/de.company.module/schemas/testElements.xsd"
> />
> 	
> 	<xsd:element name="ABCTests" type="OpenCmsABCTests"/>
> 	
> 	<xsd:complexType name="OpenCmsABCTests">
> 		<xsd:sequence>
> 			<xsd:element name="ABCTest" type="OpenCmsABCTest" minOccurs="0"
> maxOccurs="unbounded"/>
> 		</xsd:sequence>
> 	</xsd:complexType>
> 	
> 	<xsd:complexType name="OpenCmsABCTest">
> 		<xsd:sequence>
> 			<xsd:element name="test" type="OpenCmsTest" minOccurs="0"
> maxOccurs="unbounded" />			
> 		</xsd:sequence>
> 		<xsd:attribute name="language" type="OpenCmsLocale" use="required"/>
> 	</xsd:complexType>
> 	
> </xsd:schema>
> 
> testElement.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="Tests" type="OpenCmsTests"/>
> 	
> 	<xsd:complexType name="OpenCmsTests">
> 		<xsd:sequence>
> 			<xsd:element name="test" type="OpenCmsTest" minOccurs="0"
> maxOccurs="unbounded"/>
> 		</xsd:sequence>
> 	</xsd:complexType>
> 
> 	<xsd:complexType name="OpenCmsTest">
> 		<xsd:sequence>
> 			<xsd:element name="text" type="OpenCmsString" minOccurs="0"
> maxOccurs="1" />		
> 			<xsd:element name="link" type="OpenCmsString" minOccurs="0"
> maxOccurs="3" />
> 		</xsd:sequence>
> 		<xsd:attribute name="language" type="OpenCmsLocale" use="optional"/>
> 	</xsd:complexType>
>  
> 	<xsd:annotation>
> 		<xsd:appinfo>
> 			<layouts>
> 				<layout element="link" widget="VfsFileWidget" />
> 			</layouts>	
> 		</xsd:appinfo>
> 	</xsd:annotation>  	
> 
> </xsd:schema>
> 
> HTH
> 

-- 
View this message in context: http://www.nabble.com/Nested-Structured-Content-and-Locale-tf3644477.html#a10286854
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.




More information about the opencms-dev mailing list