What is a <group> in Relax NG?

G

Gerben Abbink

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?
 
G

George Bina

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,017
Latest member
GreenAcreCBDGummiesReview

Latest Threads

Top