Home Forums General XMetaL Discussion Handling ID references in Xmetal Reply To: Handling ID references in Xmetal

Derek Read

Reply to: Handling ID references in Xmetal

The mere existence of an ID attribute with a matching value is enough to allow the document to validate. The value must be an exact match.

XMetaL (Author and XMAX) is fulfilling the following requirement during validation in this case:

Whether your customization chooses to put any relevance on this “linkage” is up to the maker of the customization and will also be very much dictated (or at least guided) by the maker of the DTD or Schema and their intentions for the ID and IDREF (which also leads to questions about the intended usage of the XML if it is to be transformed to another format at some point).

I have seen customizations created by clients that list all the ID values and IDREFs next to each other in a table inside a modal form (presumably to allow the author to more easily work with them) and I have seen customizations where clicking on the element containing an IDREF will take you to its match, and vice versa (though in the case of an ID there may be more than one IDREF). You may wish to implement something elaborate that lets someone choose (from a list in a form for example) from a list of ID values when inserting an element containing an IDREF.

Any additional functionality such as this, if required, would be primarily done via scripting using the APIs provided for these purposes (see: XMetaL Developer Programmers Guide).