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] ASN.1 is an XML Schema Language (Fix those lists!) and Bin

[ Lists Home | Date Index | Thread Index ]



Rich Salz ha scritto:
> 
> I think you misunderstand Simon.  Does ASN.1/X.694 have the 
> equivalent of a "text node"?  For example:
> 	<foo>this is <item>1<item> line of text with
>         <item>2</item> numbers in it.</foo>
> 
> What about
> 	<foo>A second line with <item>1<item>, <item>2</item>, no,
>         <item>3</item> numbers.</foo>
> 
> In XML Schema, those match the same definition of foo.  How 
> do you write the equivalent in ASN.1/X.694?


ASN.1 supports mixed content in the "Extended XML encoding rules"
(EXTENDED-XER).

You can write a type definition such as the following:

----------------------
MyElementTypeWithMixedContent ::= [EMBED-VALUES] SEQUENCE {
	embed-values SEQUENCE OF UTF8String,
	an-attribute [ATTRIBUTE] INTEGER,
	another-attribute [ATTRIBUTE] UTF8String,
	a-child-element AnotherElementType,
	another-child-element INTEGER
}
----------------------

[EMBED-VALUES] and [ATTRIBUTE] are examples of "XER encoding instructions".


The [EMBED-VALUES] encoding instruction assigned to the SEQUENCE type causes
the multiple strings of the "embed-values" component (the first component of
the SEQUENCE) to provide the text that is interleaved with the child
elements (before the first one, between each pair, and after the last one).
In this example, there are two (mandatory) child elements ("a-child-element"
and "another-child-element"), so there must be exactly three strings
(possibly empty) in the SEQUENCE OF UTF8String.

The type above is an example of what X.694 generates when translating an XML
Schema schema to ASN.1.

The type above can be encoded in any of the standard "encoding rules" of
ASN.1 (BER, PER, DER, EXTENDED-XER, etc.).  If encoded in EXTENDED-XER, it
produces XML with mixed content.  If encoded in PER or BER, it produces a
binary encoding.  In any encoding rules except EXTENDED-XER, the "SEQUENCE
OF" component is encoded as a normal "SEQUENCE OF" (only EXTENDED-XER
recognizes XER encoding instructions).

Alessandro Triglia
OSS Nokalva


> 
>         /r$
> 
> --
> Rich Salz                  Chief Security Architect
> DataPower Technology       http://www.datapower.com
> XS40 XML Security Gateway  http://www.datapower.com/products/xs40.html
> XML Security Overview      
> http://www.datapower.com/xmldev/xmlsecurity.ht> ml
> 
> 
> 
> 
> -----------------------------------------------------------------
> 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