Reply to: Handling ID references in XmetalMarch 16, 2011 at 11:45 pm
There is no way to suppress individual validation errors while leaving the document in an invalid state so you cannot do both 1 and 2. If you wish to have option 1 then I think you will need to turn validation off entirely. See the following posting: http://forums.xmetal.com/index.php/topic,1120.0.html
The only other thing I can think of would be to modify the DTD so that the IDREF is not a true IDREF, but perhaps CDATA. In this case XMetaL will not enforce the XML IDREF rules for the attribute. Perhaps this is desireable if you wish to rely on some other system to match the two attributes? You haven't provided enough information to know that is the case, but I get the feeling you might have other systems involved here.
For option 2 do you want to completely automate this inside XMetaL Author? The user would not be involved at all? If that is the case you must be able to imagine a system that can automatically decide which ID values to match with IDREF values all by itself. I cannot imagine such a system myself, but perhaps you can. As long as specific logic can be defined then you should be able to write a script to implement it.
If the user needs to be involved to provide feedback on which ID and IDREF to match up then we probably need to think about some kind of user interface. If you can describe what that might look like I can probably make some further suggestions. However, at its simplest you would likely need to obtain a list of all IDREF values that do not have a matching ID value and display those to the user in some fashion. The user could then select either the ID or the IDREF and subsequently select its match. If some external source also needs to be involved (perhaps a database lookup or something else) then you would need to hook into that as well.
You can find a simple example that matches two elements using their attribute values in the Journalist demo:
1. Create a new Journalist document.
2. Open the “Journalist 2” toolbar.
3. Click on the “red book” icon to “Insert BiblioItem”.
4. Inside the
5. Place your cursor inside a
6. Click on the “open book” icon to “Insert Citation”. You will see a dialog that lists all the