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

 


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: Re: [relax-ng-comment] parameterized element definition


The only way to do this at the moment is to use multiple files.  Create a
file "param.rnc" with (in compact syntax):

ParamDataType = element value { SubDataType }

Then do this:

TextData = text
IntData = xsd:int
mystring = grammar { include "param.rnc" SubDataType = parent TextData }
mynumber = grammar { include "param.rnc" SubDataType = parent IntData }


----- Original Message -----
From: "Michael Weber" <mweber@informatik.hu-berlin.de>
To: <relax-ng-comment@lists.oasis-open.org>
Sent: Thursday, April 18, 2002 6:29 PM
Subject: [relax-ng-comment] parameterized element definition


> Dear all,
>
> I wonder, if there is a paramterized element definition in RELAX NG.
> I want to define a set of elements, which pass another definitions to
> their subelements.  Though, I can describe a pattern which behaves
> similarly. For instance, I want to have
>
> <define name="ParamDataType" param="SubDataType">
>   <element name="value>
>     <ref name="SubDataType/>
>   </element>
> </define>
>
> So the sub-elements or the detailed definition of value depends
> on the definition of that SubDataType.
>
> I want to use the above definition, e.g. with
>
> <define name="TextData">
>   <text/>
> </define>
>
> <define name="IntData">
>   <data type="int"/>
> </define>
>
> <element name="mystring">
>   <ref name="ParamDataType" param="TextData"/>
> </element>
>
> <element name="mynumber">
>   <ref name="ParamDataType" param="IntData"/>
> </element>
>
> These definitions should be similar to the following two definitions
>
> <element name="mystring">
>   <element name="value">
>     <text/>
>   </element>
> </element>
>
> <element name="mynumber">
>   <element name="value">
>     <data type="int"/>
>   </element>
> </element>
>
> Is there a similar solution for this kind of problems in RELAX NG?
>
> TIA
>
> Kind regards
>
> Micha
> --
> Michael Weber             Tel. +49-30-2093-3075; Fax +49-30-2093-3067
> Institut f. Informatik, HU Berlin, Unter den Linden 6, D-10099 Berlin
> mailto:mweber@informatik.hu-berlin.de
> http://www.informatik.hu-berlin.de/~mweber
>
>
> ----------------------------------------------------------------
> To subscribe or unsubscribe from this elist use the subscription
> manager: <http://lists.oasis-open.org/ob/adm.pl>
>
>
>



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC