OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] can you use inheritance (extension) in relax ng?

[ Lists Home | Date Index | Thread Index ]

> -----Original Message-----
> From: James Clark [mailto:jjc@jclark.com]
> On Sat, 2003-10-25 at 12:17, Robert Koberg wrote:
> > Hi,
> >
> > I was wondering how something like this would be represented in RNG:
> >
> > <xs:complexType name="SiteNode">
> >     <xs:sequence>
> >       <xs:group ref="lsb:core.elems"/>
> >     </xs:sequence>
> >     <xs:attributeGroup ref="lsb:navigable.attrs"/>
> >   </xs:complexType>
> >
> > <xs:element name="folder">
> >     <xs:complexType>
> >       <xs:complexContent>
> >         <xs:extension base="lsb:SiteNode">
> >           <xs:sequence>
> >             <xs:group ref="lsb:folder.elems"/>
> >           </xs:sequence>
> >         </xs:extension>
> >       </xs:complexContent>
> >     </xs:complexType>
> >   </xs:element>
> >
> > Does RNG support extending elements like above?
> 
> Yes, since RNG patterns handle both elements and attributes, you can do
> extension just by referencing the base definition.  In compact syntax:
> 
> SiteNode = core.elems, navigable.attrs
> folder = element folder { SiteNode, folder.elems }

Cool -- and more compact :)

I have to study RNC... After reading the threads here it seems that most
prefer RNC over RNG and by far over XML Schema?

Thanks,
-Rob

> 
> James






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS