[
Lists Home |
Date Index |
Thread Index
]
- From: Chuck White <chuckwh@pacbell.net>
- To: xml-dev@lists.xml.org
- Date: Wed, 27 Dec 2000 19:23:25 -0800
Given that unique IDs in a database are integers, how does one map unique
IDs from that database to an ID attribute value type? Is anybody mapping
data using ID against database unique identifiers that have integer data
types?
The solution that comes to my mind that I haven't tried would be to generate
rowsets (I'm specifically looking at Order Numbers) and use XSLT to generate
ID attributes with letter prefixes from the generated Order elements so that
<rowset>
<Order_ID>30011</Order_ID>
<IO_ID>11111</IO_ID>
<rowset>
becomes
<rowset>
<Order_ID io_id="o:11111">30011</Order_ID>
<rowset>
Maybe my question should be more general. Are there any best practices out
there for mapping against databases using DTDs? Even if I use a schema, it
seems like the QName constraints on ID makes its use prohibitive without
jumping over the hurdle of transformation.
I know the thing was probably designed with the DOM in mind, but ID also
seems like a perfect candidate for managing primary and foreign key values,
if not for this small problem. Maybe I'm missing something here, and it's
worth a flame to find out if I am.
thanks,
Chuck White
Author, Mastering XML Premium Edition, Sybex Books
(February 2001)
Internet Explorer 5 Developer's Guide, IDG Books
http://www.javertising.com
|