Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-1395

Code for reading and writing binary DTDs using ASN.1 encoding

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Contributions
    • None
    • Patch Available
    • Moderate

    Description

      The class javax.swing.text.html.parser.DTD has a method read() for loading a binary DTD. The format of this binary file is not specified, so the current implementation uses serialization. This approach has several problems, so it was suggested in harmony-dev the use of ASN.1 to encode the DTD information.
      Attached is a zip file with a set of classes for encoding and decoding a DTD, using the ASN.1 framework already in use in javax.crypto; and two bdtds, one for HTML 3.2 and one for HTML 4.01. Also attached is a patch for DTD.java and DTDUtilities.java.

      The proposed format is:
      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 [0] IMPLICIT SET OF INTEGER OPTIONAL,
      inclusions [1] IMPLICIT SET OF INTEGER OPTIONAL,
      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 }

      Attachments

        1. ASN1_01.patch
          7 kB
          Miguel Montes
        2. ASN1_ITC-Contribution_20061005-UpperCase.zip
          32 kB
          Miguel Montes
        3. ASN1_ITC-Contribution_20060905.zip
          33 kB
          Miguel Montes
        4. ASN1_01.patch
          5 kB
          Miguel Montes
        5. ASF.LICENSE.NOT.GRANTED--ASN1_01.patch
          5 kB
          Miguel Montes
        6. ASF.LICENSE.NOT.GRANTED--ASN1_ITC-Contribution_20060905.zip
          33 kB
          Miguel Montes

        Activity

          People

            Unassigned Unassigned
            mmontes Miguel Montes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: