[DDI-CDG] XInclude and DDI, unique ID’s over several XML files

Joachim Wackerow wackerow at zuma-mannheim.de
Mon May 10 12:45:22 EDT 2004


Dear all,

Regarding my notes to “XInclude and DDI” [1] Tom Piazza pointed me to 
the problem that ID's must be unique across all the members of a 
compound document composed by XInclude.

I see the following ways to make sure that several files combined by 
XInclude have unique ID’s:

1. Organisational approach
The codebook editor must obey the rule, that every id attribute must 
have a study prefix study (IDNo).
For example: ID="V7"  ->  ID="MZ1996_V7"

I think this approach is only practical in small working groups. We are 
practicing this alternative in another project. There we document survey 
instruments with DocBook. Each instrument is documented in a separate 
DocBook article instance. All documents are combined with XInclude in 
one DocBook book instance.


2. Formal approach by XSL
A DDI instance could be rewritten by a XSL style sheet to rename all 
ID's in the mentioned way. Example stylesheet see the attachment.


3. Formal approach by XML Schema
With XML Schema it is possible to set constraints on attributes [2]. 
Perhaps we could formalize the creation of the prefix by this means. I 
don't know a similar technique for a DTD.

Perhaps it is possible to define a identity constraint on the attribute 
“ID” with “keyref” of XML Schema.

Logic: New_ID = /codeBook/stdyDscr/citation/titlStmt/IDNo + ID
Example: ‘MZ1996_V7’ = ‘MZ1996’ + ‘_’ + ‘V7’


References

[1] Notes on XInclude and DDI
http://lion.icpsr.umich.edu/pipermail/ddi-cdg/2004-March/000010.html
[2] XML Schema Part 1: Structures, Identity-constraint Definitions
http://www.w3.org/TR/xmlschema-1/#cIdentity-constraint_Definitions

Regards, Achim

-------------- next part --------------
A non-text attachment was scrubbed...
Name: prefix_ID_with_IDNo.xsl
Type: text/xml
Size: 1519 bytes
Desc: not available
Url : http://www.icpsr.umich.edu/pipermail/ddi-cdg/attachments/20040510/e1ac874f/prefix_ID_with_IDNo.xml


More information about the DDI-CDG mailing list