[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

ID and IDREF and databases

  • From: Chuck White <chuckwh@p...>
  • To: xml-dev@l...
  • Date: Wed, 27 Dec 2000 19:23:25 -0800

generate.id.attributes
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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.