Very helpful, thanks Ken.
--- In rng-users@yahoogroups.com, "G. Ken Holman" <gkhol...@...> wrote:
>
> At 2009-09-07 12:26 +0000, rossajmcd wrote:
> >I have something like:
> >
> >...
> >element myelement { attribute name { "id" }, text},
> >...
> >
> >at the moment, and I would like to replace the 'text' with:
> >
> >...
> >...{ "id" }, "value1" | "value2"},
> >...
> >
> >I have tried all sorts of different things but I always get a syntax error.
>
> You want a choice between two values, that choice is expressed in parentheses.
>
> I hope the example below helps.
>
> . . . . . . . Ken
>
> t:\ftemp>type ross.rnc
> element myelement { attribute name { "id" }, ( "value1" | "value2" ) }
> t:\ftemp>type ross.xml
> <myelement name="id">value1</myelement>
>
> t:\ftemp>rnc ross.rnc ross.xml
>
> t:\ftemp>type ross2.xml
> <myelement name="id">value3</myelement>
>
> t:\ftemp>rnc ross.rnc ross2.xml
> t:\ftemp\ross2.xml:1:40: error: bad character content for element
>
> t:\ftemp>
>
>
> --
> Interested in these classes? http://www.CraneSoftwrights.com/r/i/
> Crane Softwrights Ltd. http://www.CraneSoftwrights.com/r/
> Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
> Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18
> Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18
> G. Ken Holman mailto:gkhol...@...
> Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/r/bc
> Legal business disclaimers: http://www.CraneSoftwrights.com/legal
>