Reputation: 57
Is there a way in XML DTD to force two attributes of the same element to have different values?
I'm writing an XML application representing a graph, using DTD and not XML Schema.
I declared the element Link
, having two attributes host1
and host2
referring to the attribute hostName
of the Host
element with IDREF
.
I would like to add a kind of constraint (if any) to forbid host1
and host2
having the same value (referring to the same host).
Upvotes: 1
Views: 262
Reputation: 111541
No, DTD can't express that constraint. Other options include:
Upvotes: 2