Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 11th, 2005, 10:25 AM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default Standard Implementation of Embeded relations

I have a peculiar implementation request for an XML file, which contains a relational model, which wich will be created by concatenating strings with SQL and writing the string to a file that will be saved as a .XML file.

The request is to place the relations embeded in the midle of a set as follows:

<Customer>
     <Name>John</Name>
     <Address>123 main</Address>
          <Orders>
                <OrderID>1001</OrderID>
                <ProductID>21</ProductID>
          </Orders>
     <LastName>Doe</LastName>
</Customer>


Our Implementation is as follows:

<Customer>
     <Name>John</Name>
     <Address>123 main</Address>
     <LastName>Doe</LastName>
          <Orders>
                <OrderID>1001</OrderID>
                <ProductID>21</ProductID>
          </Orders>
</Customer>

Notice that the related information is at the end of the set, breaking the <Customer/> in the middle of the set instead of at the end.

Is there a standard for this?

ADO.NET allows for insertion of mapped relations, but this relations are set to the end of <Customer/>. SQL Server does the same when a relation is created with an UNION statement:

I have researched over 10 manuals and countless web sites to include the W3c and the implementations that I find do the relations as I showed them. At the end of <Customer/> .

Is this request whithin an acceptable standard? Is there a tool that does the relation in the midle of the set?

Please help as I have been unable to find an answer.

Thanks.

Sal



Sal
__________________
Sal
 
Old August 13th, 2005, 04:34 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Using a DTD you can have ID and IDREFS, using schema you have key and keyref. SQL Server's FOR XML supports the former.

--

Joe (Microsoft MVP - XML)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dataset relations not working like expected panda869 C# 0 March 2nd, 2008 12:04 PM
data relations synchronization igalk474 ADO.NET 0 July 21st, 2007 05:36 AM
tables relations helkayal SQL Server 2000 4 April 19th, 2005 03:18 PM
Relations (Urgent plz) Samikaraeen Pro VB.NET 2002/2003 0 July 15th, 2004 03:50 AM
get table-relations from database GARAK ADO.NET 0 February 12th, 2004 07:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.