BizTalk Utilities CV ,   Jobs ,   Code library  
 
 
Page 8 of 9

 

Previous Page Table Of Contents Next Page

XML Structures for Existing Databases, cont.

Discard Unreferenced ID attributes

Finally, we need to discard those ID attributes that we created in Rule 5 that do not have IDREF(S) pointing to them. Since we created these attributes in the process of building the XML structures, discarding them if they are not used does not sacrifice information, and saves developers the trouble of generating unique values for the attributes.

Rule 11: Remove Unwanted ID Attributes.

Remove ID attributes that are not referenced by IDREF or IDREFS attributes elsewhere in the XML structures.

Applying Rule 11 to our example gives us our final structure. On review, the InvoiceID, LineItemID, MonthlyPartTotalID, MonthlyTotalID, and MonthlyCustomerTotalID attributes are not referenced by any IDREF or IDREFS attributes. Removing them, we arrive at our final structure, ch03_ex01.dtd:

<!ELEMENT SalesData (Invoice*, Customer*, Part*, MonthlyTotal*)>

<!ATTLIST SalesData

            Status (NewVersion | UpdatedVersion | CourtesyCopy) #REQUIRED>

<!ELEMENT Invoice (LineItem*)>

<!ATTLIST Invoice

             InvoiceNumber CDATA #REQUIRED

             TrackingNumber CDATA #REQUIRED

             OrderDate CDATA #REQUIRED

             ShipDate CDATA #REQUIRED

             ShipMethod (USPS | FedEx | UPS) #REQUIRED

             CustomerIDREF IDREF #REQUIRED>

<!ELEMENT Customer EMPTY>

<!ATTLIST Customer

             CustomerID ID #REQUIRED

             Name CDATA #REQUIRED

             Address CDATA #REQUIRED

             City CDATA #REQUIRED

             State CDATA #REQUIRED

             PostalCode CDATA #REQUIRED>

<!ELEMENT Part EMPTY>

<!ATTLIST Part

             PartID ID #REQUIRED

             PartNumber CDATA #REQUIRED

             Name CDATA #REQUIRED

             Color CDATA #REQUIRED

             Size CDATA #REQUIRED>

<!ELEMENT MonthlyTotal (MonthlyCustomerTotal*, MonthlyPartTotal*)>

<!ATTLIST MonthlyTotal

             Month CDATA #REQUIRED

             Year CDATA #REQUIRED

             VolumeShipped CDATA #REQUIRED

             PriceShipped CDATA #REQUIRED>

<!ELEMENT MonthlyCustomerTotal EMPTY>

<!ATTLIST MonthlyCustomerTotal

             VolumeShipped CDATA #REQUIRED

             PriceShipped CDATA #REQUIRED

             CustomerIDREF IDREF #REQUIRED>

<!ELEMENT MonthlyPartTotal EMPTY>

<!ATTLIST MonthlyPartTotal

             VolumeShipped CDATA #REQUIRED

             PriceShipped CDATA #REQUIRED

             PartIDREF IDREF #REQUIRED>

<!ELEMENT LineItem EMPTY>

<!ATTLIST LineItem

             Quantity CDATA #REQUIRED

             Price CDATA #REQUIRED

             PartIDREF IDREF #REQUIRED>

 

Page 8 of 9

 

Previous Page Table Of Contents Next Page
 

Recent Jobs

Sr. Software Engineer - Analytics
Immediate Mainframe openings for Ch
Immediate TANDEM-TAL openings for C
Immediate ASP.NET/C# Openings for C
Sr. Software Engineer

View all Jobs (Add yours)
View all CV (Add yours)



conference calling services
water softener
Teleconference
Host Department NOLIMIT Web Hosting
MSN
sunglasses
online fax


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP