[
Lists Home |
Date Index |
Thread Index
]
Bob Wyman wrote:
>
> Alessandro wrote:
> > You can certainly define a content model with <i>'s and <p>'s and
> <b>'s
> > in ASN.1 as you can do in XML Schema.... It should be easy for you
> > to do this, by looking at the example above and generalizing it.
>
> The ASN.1 module below is more general than the examples
> posted by others. It is also more complete. When combined
> with an E-XER encoder/decoder this module will handle XML like:
>
> <text class='random'>Some default text <b>Bold<i>bold and
> italics</i> Just Bold </b> No Bold <i id='X'>italics</i> No
> Italics </text>
>
> I believe that this is what Simon was asking for. Does this do it?
Yes. This ASN.1 module defines a type "Text" that, when using EXTENDED-XER,
is encoded as an XML element <text> with unconstrained attributes and with
mixed content, containing an unconstrained number of the elements <b>, <i>,
<u> in any combination and order, each of them having the same properties as
the <text> element, and so on recursively.
Alessandro
>
> -----------------------------------------
> TextDemo DEFINITIONS XER INSTRUCTIONS AUTOMATIC TAGS ::=
> BEGIN
>
> Text ::= [NAME AS UNCAPITALIZED] Foo
>
> Foo ::= [NAME AS UNCAPITALIZED] [ELEMENT] [EMBED-VALUES] SEQUENCE {
> embed-values SEQUENCE OF UTF8String,
> tags [ANY-ATTRIBUTES] AttrList (CONSTRAINED BY {}),
> choice-list [UNTAGGED] SEQUENCE OF [UNTAGGED] CHOICE {
> b Foo,
> i Foo,
> u Foo
> }
> } (CONSTRAINED BY {})
>
> AttrList ::= SEQUENCE OF UTF8String
>
> ENCODING-CONTROL XER
> GLOBAL-DEFAULTS MODIFIED-ENCODINGS
> END
> -------------------------------------------
>
> Since this issue seems fairly sensitive, I'd appreciate
> guidance on cleaning this little example up from any of the
> ASN.1 guru types that may be reading this...
>
> bob wyman
>
>
> -----------------------------------------------------------------
> 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>
|