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

 

Previous Page Table Of Contents Next Page

XML Structures for Existing Databases, cont.

Add Missing Elements to the Root Element

A significant flaw may have been noticed in the final structure we arrived at in the last section - when building documents using this DTD, there's no place to add a <Customer> element. It's not the root element of the document, and it doesn't appear in any of the element content models of any of the other elements in the structure. This is because it is only pointed to, not contained.

Elements that turn out to only be referenced by IDREF(S) need to be added as allowable element content to the root element of the DTD. Then, when creating the document, the orphaned elements are created within the root element and then pointed to, where appropriate.

Applying this rule to our example, we see that we are missing the <Customer> and <Part> elements. Adding these as allowable structural content to our root element gives us:

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

<!ATTLIST SalesData

            Status (NewVersion | UpdatedVersion | CourtesyCopy) #REQUIRED>

<!ELEMENT Invoice (LineItem*)>

...

Rule 10: Add Missing Elements.

For any element that is only pointed to in the structure created so far, add that element as allowable element content of the root element. Set the cardinality suffix of the element being added to *.

 

Page 7 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)



halloween mask
water softener
Teleconference
Host Department NOLIMIT Web Hosting
MSN
sunglasses
fax server


    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