XML.com: XML From the Inside Out

XML.comWebServices.XML.comO'Reilly Networkoreilly.com
  Articles | Weblogs | Newsletter | Safari Bookshelf
advertisement

Article:
 XML Schema Design Patterns: Is Complex Type Derivation Unnecessary?
Subject: The ASN.1 Version of the above
Date: 2003-11-01 15:17:12
From: Bob Wyman

As long as Tom Gaven has given the RELAX NG version of your WXS, it might be useful to look at the ASN.1 version. It is not as compact as RELAX NG, but is certainly more compact than the WXS version and, in my opinion, much easier to understand. It encodes the same XML as the WXS or RELAX NG versions.


Xml-deviant DEFINITIONS AUTOMATIC TAGS ::=
BEGIN


IMPORTS
Date
FROM XSD;


XML-Deviant ::= [NAME AS "XML-Deviant"] SEQUENCE {
firstSubscribed [ATTRIBUTE] Date OPTIONAL,
mailReader [ATTRIBUTE] XSD.String OPTIONAL,
numPosts INTEGER OPTIONAL,
signature CHOICE {
nil BOOLEAN (TRUE) ,
signature XSD.String} ,
email XSD.String OPTIONAL}


XML-Deviant-derivations ::= [USE-TYPE] CHOICE {
xML-Deviant XML-Deviant,
dareObasanjo DareObasanjo }


DareObasanjo ::= SEQUENCE {
firstSubscribed Date,
mailReader XSD.String("Microsoft Outlook") OPTIONAL,
numPosts INTEGER,
signature XSD.String,
email XSD.String}
END



Previous Message Previous Message   Next Message Next Message

Sponsored By:


Contact Us | Our Mission | Privacy Policy | Advertise With Us | | Submissions Guidelines
Copyright © 2008 O'Reilly Media, Inc. | (707) 827-7000 / (800) 998-9938