What is a <group> in Relax NG?

Discussion in 'XML' started by Gerben Abbink, Nov 23, 2006.

  1. In Relax NG, I understand all other group operators (interleave, choice,
    oneOrMore, zeroOrMore, optional), but what is the purpose of <group>? Can
    you give an example?
     
    Gerben Abbink, Nov 23, 2006
    #1
    1. Advertising

  2. Gerben Abbink

    George Bina Guest

    Hi,

    The group pattern is equivalent with a sequence in XML Schema, it
    contains a set of patterns that should follow one after the other. In
    Relax NG groups are generally implicit if you specify one pattern after
    the other but you can also make explicit groups using the group
    element. When you need that? Imagine you want to define a choice of
    either a followed by b or x followed by y. Then you need to write

    <choice>
    <group>
    <element name="a">...</element>
    <element name="b">...</element>
    </group>
    <group>
    <element name="x">...</element>
    <element name="y">...</element>
    </group>
    </choice>

    Best Regards,
    George
    ---------------------------------------------------------------------
    George Cristian Bina
    <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
    http://www.oxygenxml.com

    Gerben Abbink wrote:
    > In Relax NG, I understand all other group operators (interleave, choice,
    > oneOrMore, zeroOrMore, optional), but what is the purpose of <group>? Can
    > you give an example?
     
    George Bina, Nov 24, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jari Kujansuu
    Replies:
    0
    Views:
    824
    Jari Kujansuu
    Sep 4, 2003
  2. James McComb
    Replies:
    1
    Views:
    386
    Bob Foster
    Nov 20, 2003
  3. Pieter
    Replies:
    6
    Views:
    436
    Pieter
    Nov 28, 2003
  4. Morten W. Petersen
    Replies:
    0
    Views:
    456
    Morten W. Petersen
    Feb 2, 2004
  5. Geert

    RELAX NG text constraint

    Geert, Dec 4, 2004, in forum: XML
    Replies:
    0
    Views:
    426
    Geert
    Dec 4, 2004
Loading...

Share This Page