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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] RE : [xml-dev] Comparison of Xml documents

[ Lists Home | Date Index | Thread Index ]



> -----Original Message-----
> From: Bob Foster [mailto:bob@objfac.com] 
> Sent: Tuesday, November 25, 2003 10:56
> To: Alessandro Triglia
> Cc: bob@wyman.us; xml-dev@lists.xml.org
> Subject: Re: [xml-dev] RE : [xml-dev] Comparison of Xml documents
> 
> 
> Alessandro Triglia wrote:
> > Bob,
> > 
> > As I said yesterday,
> 
> Sorry to make you repeat yourself.
> 
> > **Roughly speaking**, WXS "sequence"s are mapped to ASN.1 
> SEQUENCEs, 
> > while WXS "all"s are mapped to ASN.1 SEQUENCEs plus explicit 
> > information about the order.  The order is made a part of 
> the abstract 
> > type definition and so is made available to the ASN.1 application.
> > 
> > So, although ASN.1 lacks, per se, an equivalent of the WXS 
> "all" model 
> > group, the ability to specify semantic significance in XML 
> encodings 
> > (which means lexical "variable order", as opposed to "any 
> order") is 
> > realized by writing something like the following:
> > 
> > -------------
> > MyAll ::= [USE-ORDER] SEQUENCE {
> >     order SEQUENCE OF ENUMERATED {a, b, c},
> >     a     INTEGER (1..1000),
> >     b     INTEGER (1..100),
> >     c     UTF8String }
> > -------------
> > 
> > This works as follows.  The abstract value:
> > 
> > v1 MyAll ::= { order {b, c, a}, 
> >     a 1000,  b 70,  c "hello" }
> > 
> > is encoded in XML as:
> > 
> > -------------
> > <v1>
> >     <b>70</b>
> >     <c>hello<c/>
> >     <a>1000</a>
> > </v1>
> > -------------
> > 
> > The abstract value:
> >   
> > v2 MyAll ::= { order {c, a, b}, 
> >     a 1000,  b 70,  c "hello" }
> > 
> > is encoded as:
> > 
> > -------------
> > <v2>
> >     <c>hello<c/>
> >     <a>1000</a>
> >     <b>70</b>
> > </v2>
> > -------------
> > 
> > In this way, even if the constructor is SEQUENCE (and not 
> "ALL"), the 
> > information about the order is present in the abstract 
> value, and is 
> > therefore accessible by the application, both when writing and when 
> > reading the abstract instance.
> > 
> > In other encoding rules the SEQUENCE OF ENUMERATED is encoded as a 
> > normal SEQUENCE OF, because there is no requirement for the 
> "lexical 
> > order" to be implemented as physical lexical order.  Notice 
> that it is 
> > always the same information, which may be "encoded" either as a 
> > physical order of child elements (in XML), or explicitly as 
> a SEQUENCE 
> > OF ENUMERATED (in other encoding rules).
> 
> I was rolling right along with you until now. (I know I'm in trouble 
> when I don't understand either sentence of a two-sentence paragraph.)
> 
> First things first, Encoding aside, do applications exchange abstract 
> values? In other words, is the value:
> 
>  > v2 MyAll ::= { order {c, a, b},
>  >     a 1000,  b 70,  c "hello" }
> 
> Recieved at the other end as a sequence of (c, a, b), i.e., in that 
> order, or not?


Applications exchange abstract values that are encoded in some set of
encoding rules (PER, BER, XER).  On the wire, they exchange bits and bytes
(possibly XML).  At the abstract level (as supported by most tools), they
exchange abstract values and aren't exposed to the bits on the wire.

The abstract value of "MyAll" is a sequence of four components (order, a, b,
c), and this is what applications will see.  

The XML encoding (more precisely, the EXTENDED-XER encoding) will be:

-------------
<x>
    <b>70</b>
    <c>hello<c/>
    <a>1000</a>
</x>
-------------

or

-------------
<x>
   <c>hello<c/>
   <a>1000</a>
   <b>70</b>
</x>
-------------

depending on the value of the "order" component.  {b, c, a} in the former,
{c, a, b} in the latter.

PER and BER, instead, will encode the four components (order, a, b, c) as a
normal sequence of four components, because the "XER encoding instruction"
[USE-ORDER]   affects only EXTENDED-XER and not the abstract syntax or other
encoding rules.

Alessandro



> 
> Thanks again.
> 
> Bob Foster
> 
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org 
> <http://www.xml.org>, an initiative of OASIS 
<http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://lists.xml.org/ob/adm.pl>






 

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

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