RelaxNG Problem with ID and IDREF

This should cover W3C XML Schema, Relax NG and DTD related problems.
kruncher
Posts: 26

RelaxNG Problem with ID and IDREF

Tue Mar 31, 2009 5:52 pm

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: 2100

Re: RelaxNG Problem with ID and IDREF

Tue Mar 31, 2009 5:59 pm

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

Re: RelaxNG Problem with ID and IDREF

Tue Mar 31, 2009 6:09 pm

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: 2100

Re: RelaxNG Problem with ID and IDREF

Wed Apr 01, 2009 3:11 pm

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

Return to “XML Schemas”

Who is online

Users browsing this forum: No registered users and 1 guest