OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: Should we care about elements order ?

[ Lists Home | Date Index | Thread Index ]
  • From: Michael Rys <mrys@microsoft.com>
  • To: 'Ronald Bourret' <rpbourret@rpbourret.com>, Daniel.Barclay@digitalfocus.com
  • Date: Fri, 20 Oct 2000 17:08:39 -0700

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@microsoft.com, rys@acm.org
We store the Web and more...


> -----Original Message-----
> From: Ronald Bourret [mailto:rpbourret@rpbourret.com]
> Sent: Friday, October 20, 2000 2:03 PM
> To: Daniel.Barclay@digitalfocus.com
> Cc: xml-dev@lists.xml.org
> 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
> 




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS