Miguel,

>-----Original Message-----
>From: Miguel Montes [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, July 26, 2006 5:40 PM
>To: harmony-dev@incubator.apache.org
>Subject: Re: [classlib][html] Should we try to be binary compatible with
>Sun's bdtd?
>
>On 7/26/06, Ivanov, Alexey A <[EMAIL PROTECTED]> wrote:
>>
>>
>> >-----Original Message-----
>> >From: Tim Ellison [mailto:[EMAIL PROTECTED]
>> >Sent: Wednesday, July 26, 2006 1:32 PM
>> >To: harmony-dev@incubator.apache.org
>> >Subject: Re: [classlib][html] Should we try to be binary compatible with
>> >Sun's bdtd?
>> >
>> >On 25/07/06, Miguel Montes <[EMAIL PROTECTED]> wrote:
>> >> Hi:
>> >> Working on the HTML parser, I found the following problem.
>> >> The HTML parser can be parameterized by a DTD. The class
>> >> javax.swing.text.html.parser.DTD has a method read(DataInputStream),
>> that
>> >> reads a DTD in binary format. AFAIK, there is no public specification
>> of
>> >> this format, and the recent contribution of the HTML component
>> (HARMONY-
>> >948)
>> >> seems to use its own binary format.
>> >> Although I donĀ“t know if there are applications out there using this
>> >method
>> >> to load custom DTDs, the method is public, so I think we should be
>> >> compatible with Sun. That is, we should be able to read Sun's bdtd,
>and
>> >our
>> >> bdtd should be readable by Sun's implementation.
>> >
>> >I agree that it would be good to aim for interoperability here.
>> >
>> >> Am i missing something? Does anyone know if there is a specification?
>> Is
>> >it
>> >> OK to reverse engineer the file "html32.bdtd"?
>> >
>> >I don't know of a spec, if you don't find one after some searching it
>> >may be something we want to go back and ask Sun.  I recommend that you
>> >don't reverse engineer their implementation/format to figure it out.
>> >In the meantime we shall have to remain incompatible.
>>
>> I don't know about any spec. The bug on Sun site [1] seems to prove there
>> is no spec for the binary format of DTD.
>>
>> In this implementation binary format is just a serialized version of DTD
>> based on HTML 4.01 Transitional.
>>
>> Why do we need to read the binary DTD of Sun? Harmony classlib will have
>> its own bdtd, which it is able to deal with. IMHO if we need to, we can
>> create our own html32.bdtd.
>
>
>The method is public, so anyone can use it to read his own DTD. If it were
>private, or with package visibility, there wouldn't be any problem. The
>problem is with Sun's design. The implementation is completely exposed,
>with
>a lot of public fields. But being the method public, I think we should be
>interoperable. If someone decides to build his own DTD, it should work with
>any implementation.

Yes, it should but there's no write method to write out a new DTD. There's only 
read which doesn't specify the format. So actually there's no way for anyone to 
use DTD.read method.

>
>Maybe what i'm saying is not even possible. Maybe there is no such thing as
>a "Sun format", and they don't even try to preserve compatibility between
>versions. (although I tested that the JDK 1.5 can read the bdtd from 1.4.2).

I believe this file hasn't changed in 1.5. And other files in html.parser 
package might not have changed. 

>
>
>But that leads to another question. Doesn't the use of serialization tie us
>to a specific version of the class? What if the implementation changes? If
>we are not going to support Sun's format, I think we shouldn't make the
>same
>mistake as them. We should define a format, make it public, and adhere to
>it.
>

This sounds reasonable. We can define a format, so that anyone could prepare 
its own binary DTD.
On the other hand, using other DTD but HTML one with Swing HTML implementation 
has almost no meaning. HTML package is designed to handle HTML only. For 
instance, the JavaDoc for DocumentParser [1] says: "actually, you can specify a 
DTD, but you should really only use this class with the html dtd in swing".

Using serialization does tie us to a specific version of the class. If the 
implementation changes, we'll have to regenerate binary form.


Any other thoughts?


Regards,
Alexey.

[1] 
http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/text/html/parser/DocumentParser.html

>
>[1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4216248
>>
>> Regards,
>> Alexey.
>>
>> >
>> >Regards,
>> >Tim
>> >
>> >--
>> >
>> >Tim Ellison ([EMAIL PROTECTED])
>> >IBM Java technology centre, UK.
>>
>> --
>> Alexey A. Ivanov
>> Intel Middleware Product Division
>>
>> ---------------------------------------------------------------------
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
>--
>Miguel Montes

--
Alexey A. Ivanov
Intel Middleware Product Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to