Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - inheritance problem (newbie) >Thread Next - Re: inheritance problem (newbie) Re: inheritance problem (newbie)To: Jan Limpens <jan.limpens@-----.---> Date: 9/17/2004 5:52:00 PM Hi Jan, > don't know what to do now. I already stole the idea from > http://www.xmlpatterns.com/ExtensibleContentModelMain.shtml, but as it > seems this is not working... That sample seems to be based on an older version of XML Schema, see: <xsd:schema xmlns:xsd="http://www.w3.org/1999/XMLSchema" while the current version defines http://www.w3.org/2001/XMLSchema as the XML Schema namespace. You probably want something along the lines: base.xsd: ========= <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://limpens.com/blogbase" xmlns="http://limpens.com/blogbase" elementFormDefault="qualified"> <xs:element name="BlogInfo"> <xs:complexType> <xs:sequence> <xs:element name="BlogTitle" type="xs:string"/> <xs:element name="BlogDescription" type="xs:string"/> <xs:element ref="Entry" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="lang" type="xs:language"/> </xs:complexType> </xs:element> <xs:complexType name="EntryType"> <xs:sequence> <xs:element name="Title"/> <xs:element name="Body"> <xs:complexType> <xs:sequence> <xs:element name="Para" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="lang" type="xs:language"/> <xs:attribute name="pubdate" type="xs:dateTime"/> </xs:complexType> <xs:element name="Entry" type="EntryType"/> <xs:element name="Blog"> <xs:complexType> <xs:sequence> <xs:element ref="BlogInfo"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> derived.xsd =========== <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://limpens.com/blog/illustrationblog" xmlns="http://limpens.com/blog/illustrationblog" elementFormDefault="qualified" xmlns:bb="http://limpens.com/blogbase"> <xs:import namespace="http://limpens.com/blogbase" schemaLocation="base.xsd"/> <xs:element name="ImageEntry" type="ImageEntryType"/> <xs:complexType name="ImageEntryType"> <xs:complexContent> <xs:extension base="bb:EntryType"> <xs:sequence> <xs:element name="SlideShow"> <xs:complexType> <xs:sequence> <xs:element name="Image" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="ImageTitle"/> <xs:element name="ImageDescription"/> <xs:element name="ImageUrl"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> </xs:schema> sample.xml ========== <?xml version="1.0" encoding="UTF-8"?> <ImageEntry xmlns="http://limpens.com/blog/illustrationblog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://limpens.com/blog/illustrationblog file:/F:/test/derived.xsd"> <Title xmlns="http://limpens.com/blogbase"></Title> <Body xmlns="http://limpens.com/blogbase"> <Para></Para> </Body> <SlideShow> <Image> <ImageTitle></ImageTitle> <ImageDescription></ImageDescription> <ImageUrl></ImageUrl> </Image> </SlideShow> </ImageEntry> Hope that helps, George ----------------------------------------------- George Cristian Bina <oXygen/> XML Editor & XSLT Editor/Debugger www.---.com From nobody@w... Fri Sep 17 12:05:25 2004 Received: from wiggum.w3.org ([128.30.52.23]) by frink.w3.org with esmtp (Exim 4.34) id 1C8HUT-0004h | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
