Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 97113 invoked from network); 24 Aug 2006 10:54:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Aug 2006 10:54:08 -0000 Received: (qmail 32941 invoked by uid 500); 24 Aug 2006 10:54:05 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 32901 invoked by uid 500); 24 Aug 2006 10:54:05 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 32890 invoked by uid 99); 24 Aug 2006 10:54:04 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Aug 2006 03:54:04 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS,UPPERCASE_25_50 X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of stepan.mishura@gmail.com designates 64.233.162.207 as permitted sender) Received: from [64.233.162.207] (HELO nz-out-0102.google.com) (64.233.162.207) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Aug 2006 03:54:03 -0700 Received: by nz-out-0102.google.com with SMTP id v1so300122nzb for ; Thu, 24 Aug 2006 03:53:43 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=fpi2l8Apk7spcEMl3veGURkvkIMQyNUKs/dINNyj5uudrQj3vivHb4ElyN3Wnec49SDyKHULXpu8YI8Gh5wc7W79q0GJ8Ne9iHODYohS4V7B8iPJQwg/P3T3h289zHTSEJ2mX0KFSUmltfiEXDDHfivAhoBcUc6TSudvnIY8yFo= Received: by 10.65.239.13 with SMTP id q13mr1940016qbr; Thu, 24 Aug 2006 03:53:43 -0700 (PDT) Received: by 10.65.242.13 with HTTP; Thu, 24 Aug 2006 03:53:43 -0700 (PDT) Message-ID: <6e47b64f0608240353s69ef93a4g49c5891cad6cd8ef@mail.gmail.com> Date: Thu, 24 Aug 2006 17:53:43 +0700 From: "Stepan Mishura" To: harmony-dev@incubator.apache.org Subject: Re: [classlib][html] Please evaluate proposed ASN.1 notation for HTML DTD In-Reply-To: <9b6bea40608231012t3cd8a5aerb5c63e8f03016a43@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_74912_4172179.1156416823209" References: <6e47b64f0608230310n5c8f9dc6me4cef4bca88beeec@mail.gmail.com> <9b6bea40608231012t3cd8a5aerb5c63e8f03016a43@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_74912_4172179.1156416823209 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/24/06, Miguel Montes wrote: > > Thanks Stepan. So, it should be > > BDTD ::= SEQUENCE { > name UTF8String, > entity SET OF HTMLEntity, > element SET OF HTMLElement > } > > HTMLEntity ::= SEQUENCE { > name UTF8String, > value INTEGER, > general [0] IMPLICIT BOOLEAN DEFAULT FALSE, > parameter [1] IMPLICIT BOOLEAN DEFAULT FALSE, > data UTF8String > } > > HTMLElement ::= SEQUENCE { > index INTEGER, > name UTF8String, > type INTEGER, > oStart BOOLEAN, > oEnd BOOLEAN, > exclusions SET OF INTEGER, > inclusions SET OF INTEGER, > attributes SET OF HTMLElementAttributes OPTIONAL, > contentModel HTMLContentModel > } > > HTMLContentModel ::= SEQUENCE OF SEQUENCE { > type INTEGER, > index INTEGER > } > > HTMLElementAttributes ::= SEQUENCE { > name UTF8String, > type INTEGER, > modifier INTEGER, > defaultValue UTF8String OPTIONAL, > possibleValues SET OF UTF8String OPTIONAL > } > > > If we want exclusions and inclusions in HTMLElement to be optional, it > should be something like > > HTMLElement ::= SEQUENCE { > index INTEGER, > name UTF8String, > type INTEGER, > oStart BOOLEAN, > oEnd BOOLEAN, > exclusions [0] IMPLICIT SET OF INTEGER OPTIONAL, > inclusions [1] IMPLICIT SET OF INTEGER OPTIONAL, > attributes SET OF HTMLElementAttributes OPTIONAL, > contentModel HTMLContentModel > } > > Is this right? Yes, that is right. - Stepan. On 8/23/06, Stepan Mishura wrote: > > > > Hi Miguel, > > > > I've looked thought proposed ASN.1 notation and it looks OK for me. I > have > > only few comments. > > (However I don't know all details of DTD, i.e. I've not checked whether > > your > > notation correctly represents DTD so I'll comment only proposed > > ASN.1notation.) > > > > BTW, I've changed the subject if you don't mind. > > > > Common remark: a component of SEQUENCE(OF), SET(OF) should starts with a > > lower-case letter. > > > > Other comment see below. > > > > On 8/23/06, Miguel Montes wrote: > > > > > Hi: > > > We are working on the html parser, and need to have working DTD. The > > > current > > > implementation of DTD.read(), based on serialization, has some > problems, > > > and > > > I think we should have a well defined binary format. I suggest the > > > following > > > ASN.1 format, and if there is consensus on it, we could contribute the > > > code > > > to read and write it. > > > I would like to hear the opinion of Stepan and anyone who has worked > > with > > > ASN.1 before. > > > > > > BDTD ::= SEQUENCE { > > > Name UTF8String, > > > Entity SET OF HTMLEntity, > > > Element SET OF HTMLElement > > > } > > > > > > HTMLEntity ::= SEQUENCE { > > > Name UTF8String, > > > Value INTEGER, > > > General BOOLEAN DEFAULT FALSE, > > > Parameter BOOLEAN DEFAULT FALSE, > > > Data UTF8String > > > } > > > > > > This won't work. I'll try to explain. We have 2 DEFAULT components here. > > If > > a component is declared as DEFAULT then it is also OPTIONAL and can be > > missed. A decoder can detect which component is missed only if a in > block > > of > > OPTIONAL components plus next mandatory component all elements are > > distinct. > > > > We have the next block: > > general BOOLEAN DEFAULT FALSE > > parameter BOOLEAN DEFAULT FALSE > > data UTF8String > > > > So 1-st and 2-nd elements are not distinct. This can be fixed by tagging > > some elements. I'd use implicit tagging, for example: > > > > general BOOLEAN DEFAULT FALSE > > parameter [0] IMPLICIT BOOLEAN DEFAULT FALSE > > > > or > > > > general [0] IMPLICIT BOOLEAN DEFAULT FALSE > > parameter [1] IMPLICIT BOOLEAN DEFAULT FALSE > > > > Thanks, > > Stepan. > > > > P.S. I'll let you know if I have more corrections. > > > > > > > > > > > > > HTMLElement ::= SEQUENCE { > > > Index INTEGER, > > > Name UTF8String, > > > Type INTEGER, > > > OStart BOOLEAN, > > > OEnd BOOLEAN, > > > Exclusions SET OF INTEGER, > > > Inclusions SET OF INTEGER, > > > Attributes SET OF HTMLElementAttributes OPTIONAL, > > > ContentModel HTMLContentModel, > > > } > > > > > > HTMLContentModel ::= SEQUENCE OF SEQUENCE { > > > Type INTEGER, > > > Index INTEGER > > > } > > > > > > HTMLElementAttributes ::= SEQUENCE { > > > Name UTF8String, > > > Type INTEGER, > > > Modifier INTEGER, > > > DefaultValue UTF8String OPTIONAL, > > > PossibleValues SET OF UTF8String OPTIONAL > > > } > > > -- > > > Miguel Montes > > > > > ------------------------------------------------------ Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org For additional commands, e-mail: harmony-dev-help@incubator.apache.org ------=_Part_74912_4172179.1156416823209--