Page 1 of 1

RelaxNG Problem with ID and IDREF

Posted: Tue Mar 31, 2009 5:52 pm
by kruncher
Hi,

In my XML schema I have two separate identifier types as it were. I am using @xml:id and @name. They each identify a different type of content.

I have got @xml:id working nicely by using data "ID" and "IDREF" for the @ref.

How do I add a second class of ID/IDREF without causing a conflict?

Many thanks!
Lea Hayes

Re: RelaxNG Problem with ID and IDREF

Posted: Tue Mar 31, 2009 5:59 pm
by george
Hi Lea,

ID/IDREF/IDREFS are global so you cannot have different layers.
What you can do however is to use Schematron, eventually embedded in Relax NG to perform these type of checks.

Best Regards,
George

Re: RelaxNG Problem with ID and IDREF

Posted: Tue Mar 31, 2009 6:09 pm
by kruncher
Thanks George,

I haven't used a lot of Schematron yet, but I think that I can probably work that out. How can Schematron be embedded in RelaxNG? Will this effect the "Schema Converter (Trang)" tools output when generating XSD files?

I've seen something about "key" and "keyRef", but I cannot seem to find anything about this in the RelaxNG specification. Could this be what I need?

Thanks again,
Lea Hayes

Re: RelaxNG Problem with ID and IDREF

Posted: Wed Apr 01, 2009 3:11 pm
by george
Hi Lea,

You can see a sample that shows ISO Schematron rules embedded RelaxNG in [oxygen]/samples/schematron/iso/tournament/Tournament.rng.

No, the XSD output will not be affected.

AFAIK there is no equivalent for XSD identity constraints (key, keyref) in Relax NG.

Best Regards,
George