RelaxNG Problem with ID and IDREF

This should cover W3C XML Schema, Relax NG and DTD related problems.
kruncher
Posts: 26
Joined: Tue Mar 31, 2009 5:47 pm

RelaxNG Problem with ID and IDREF

Post 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
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: RelaxNG Problem with ID and IDREF

Post 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
George Cristian Bina
kruncher
Posts: 26
Joined: Tue Mar 31, 2009 5:47 pm

Re: RelaxNG Problem with ID and IDREF

Post 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
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: RelaxNG Problem with ID and IDREF

Post 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
George Cristian Bina
Post Reply