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

RE: Comparison of Xml documents


RE:  Comparison of Xml documents
Alaric B Snell wrote:
> in ASN.1 you can specify if order is important within a 
> compound object - if order matters it's a SEQUENCE, 
> otherwise it's a SET :-)
    Alaric, you may be overstating the case for ASN.1 here. There are
two kinds of ordering discussed in Pierre Garnier's message. I think
ASN.1 only handles one of them which is clearly the one you mentioned,
however, some folk might think you also meant the other.
    In ASN.1 you can specify that things are either a SEQUENCE or a
SET. Elements within a SEQUENCE are ordered while elements within a
SET are not. Thus, given:

    ordered ::= SEQUENCE {
       part1 INTEGER,
       part2 INTEGER
    }

   Your XML encoding could be:
    <ordered>
      <part1>1111</part1>
      <part2>2222</part2>
    </ordered>

   But, the following would be illegal since part2 comes before part1:
    <ordered>
      <part2>2222</part2>
      <part1>1111</part1>
    </ordered>

    If you want to be able to provide part1 and part2 in either order,
you would define a SET instead. You would write:
    ordered ::= SET {
       part1 INTEGER,
       part2 INTEGER
    }

	But this is only one kind of ordering mentioned in Pierre's
message. This is ordering of the structural elements of a message. I
think he also wants to have elements ordered according to their
values. Thus, if you allowed multiple "part1"s to appear in a SEQUENCE
or SET, the question is which should come first? Pierre seems to
indicate that he wants the order determined by the value of instances
of the elements -- not by their types. i.e. he wants to permit:
    <ordered>
      <part>111</part>
      <part>222</part>
    </ordered>

   while prohibiting:
    <ordered>
      <part>222</part>
      <part>111</part>
    </ordered>

    I don't think ASN.1 supports this kind of constraint in the
standard syntax. Or, have I missed something in the spec?

		bob wyman



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.