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 ]

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 }

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