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

Re: ASN.1 is an XML Schema Language (Fix those lists!)and Bina


debian asn.1
Amelia A. Lewis wrote:
> On Sat, 1 Nov 2003 23:16:03 -0500
> "Alessandro Triglia" <sandro@m...> wrote:
> 
>>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?
> 
> 
> Please note the question.  The answer doesn't address it.
> 
> 
>>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.
> 
> 
> But that isn't mixed content.  Not in the XML sense.  If I *must* write
> <p>String <b>emphasized</b> the end.</p>  But I *want* to write
> <p>String <b>some <i>real nonsense</i>, no?</b> Or perhaps
> <b>not</b>.</p>
> 
> Classic document-style mixed content.  Very useful stuff if, for
> instance, you're embedding documentation into a product description. 
> The example provided, if I understand it correctly, cannot support that.

Alessandro was just demonstrating mixed content - allowing arbitrary 
nesting of <i> and <b> is easy, just you define your 'text' type to be 
allowed to containg BoldText and ItalicText types - but BoldText and 
ItalicText are just aliases for Text, meaning they can be nested inside 
each other (or themselves!).

> ASN.1 as a non-mixed-content schema language for XML that has the
> ability to generate [unparsable, disastrously fragile*] compact binary
> structures has interesting use cases. 

Don't confuse "having the ability to generate [unparsable, disastrously 
fragile] compact binary structures" with "only being able to generate ...";

 > An inability to support mixed
> content means it isn't a replacement for DTDs, WXS, or RNG, all of which
> do have that capability.

Good job ASN.1 doesn't have such an inability, then, isn't it?

> 
> Amy!
 >

ABS


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.