[thelist] XML DTD: multiple IDREFs?

PeterV peter at poorbuthappy.com
Sun Jul 7 07:42:01 CDT 2002


Hi all,
I'm writing a DTD (I know, I should use schemas), and I use ID and IDREF as
attributes, like this:

<!ELEMENT occurrencetyperef EMPTY>
<!ATTLIST occurrencetyperef
         idref IDREF #REQUIRED
 >
<!ELEMENT parent (#PCDATA)>
<!ATTLIST parent
         idref IDREF #REQUIRED
 >

So element "parent" and element "occurrencetyperef" both reference other
elements that use unique ID's.
The problem is that I want two different elements to have two different
ID's, but if I use ID and IDREF to enforce the id's in the DTD, I can only
refer to one type of id. Does this make sense? That makes me think: maybe I
shouldn't enforce this in the DTD? Any tips?
Peter





More information about the thelist mailing list