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

RE: Should we care about elements order ?

  • From: Michael Rys <mrys@m...>
  • To: 'Ronald Bourret' <rpbourret@r...>, Daniel.Barclay@d...
  • Date: Fri, 20 Oct 2000 17:08:39 -0700

sibling order
SQLServer 2000 provides sibling order with OpenXML (as meta information in
the edgetable) and by the order of the rowset to XML serialization with FOR
XML. 

Best regards
Michael
--
Program Manager, SQL Server XML Technologies
mrys@m..., rys@a...
We store the Web and more...


> -----Original Message-----
> From: Ronald Bourret [mailto:rpbourret@r...]
> Sent: Friday, October 20, 2000 2:03 PM
> To: Daniel.Barclay@d...
> Cc: xml-dev@l...
> Subject: Re: Should we care about elements order ?
> 
> 
> Daniel Barclay wrote:
> 
> > How can sibling order be unimportant?  Don't you need to 
> preserve the
> > sibling order in XML to preserve the order in Java?  (You 
> don't know if
> > the Java order is significant, so you have to preserve it to be an
> > accurate serialization of the Java data.)
> 
> As my example showed (repeated below), two documents with two 
> different
> sibling orders can be used to populate the same object:
> 
>    <Part>
>       <Number>123</Number>
>       <Desc>Turkey wrench</Desc>
>       <Price>10.95</Price>
>    </Part>
> 
> and:
> 
>    <Part>
>       <Price>10.95</Price>
>       <Desc>Turkey wrench</Desc>
>       <Number>123</Number>
>    </Part>
> 
> both populate:
> 
>    object part {
>       number = 123
>       desc = "Turkey wrench"
>       price = 10.95
>    }
> 
> The part object has no notion of an order among number, desc, 
> and price.
> 
> Where sibling order might be important for objects is when 
> more than one
> sibling maps to the *same* property. For example, multiple LineItem
> children of a SalesOrder would map to an array of line items:
> 
>    class SalesOrder {
>       int number;
>       Date date;
>       Customer cust;
>       LineItem[] lineItems;
>    }
> 
> This assumes that the property is ordered (an array). I believe that
> some OO languages allow you to have unordered, multi-valued 
> properties,
> such as sets.
> 
> Note that in any case this order isn't necessarily transferrable to a
> relational database. This is because there is no notion of order among
> rows in a table. (The child LineItem elements would be stored in a
> separate table, as is the case for any multi-valued property.)
> 
> > (Or do all the serialization methods you've seen explicitly 
> add an index
> > so that XML sibling order no longer matters?)
> 
> You have to either add an index or designate an 
> attribute/child element
> as the index. In the example above, each line item probably has a
> number, so you could use that as the index, but there is no guarantee
> that such an attribute/child element will be present.
> 
> Please note that the only product that I'm sure that does 
> this is my own
> (XML-DBMS). I seem to remember seeing an order property in the DAD
> mapping language in DB2. I've never seen any mention of 
> sibling order in
> white papers or web pages discussing other products.
> 
> Note that in the above case, you can use an ORDER BY clause to specify
> sibling order when the mapping from XML to database is done with a
> SELECT statement. However, this requires there to be a data 
> field which
> can be used to order children of the same type, which is not always
> true.
> 
> -- 
> Ronald Bourret
> Programming, Writing, and Training
> XML, Databases, and Schemas
> http://www.rpbourret.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.