Print

Print


Hi Martin,

Time is my issue today, so I can't give you a well-tested solution. Let 
me instead quickly give you the tools and a guideline.

http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-idno.html

http://www.tei-c.org/release/doc/tei-p5-doc/en/html/TD.html

(+ optionally a RelaxNG tutorial/spec)

In chapter 22, search for "rng:choice" -- that might eliminate the need 
for the RNG specification.

In the idno spec (first item above), set the declaration display to XML, 
to match the Guidelines.

You are interested in this fragment:

  <rng:optional>
   <rng:attribute name="type">
    <rng:ref name="data.enumerated"/>
   </rng:attribute>
  </rng:optional>
  <rng:zeroOrMore>
   <rng:choice>
    <rng:text/>
    <rng:ref name="model.gLike"/>
    <rng:ref name="idno"/>
   </rng:choice>
  </rng:zeroOrMore>

this is what gives you the default, and you want to be able to suggest 
an alternative (optional) pattern, where @type has a specific value of 
your choice and is obligatorily followed by xsd:anyURI.

As I said, I'd normally test this before giving the answer to you, but 
this has been an intensive week for me, and it continues to be so.

Good luck in your tinkering efforts :-)

   Piotr

On 06/02/15 14:32, Martin de la Iglesia wrote:
> Hi Piotr,
>
> thanks for trying to help, but I'm afraid I still don't get it: how do I
> express the branching condition in RelaxNG, and where exactly does the
> RelaxNG go in the ODD? Maybe you could provide an example code snippet?
>
> Many thanks in advance,
>
> Martin
>
>
>