Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-2033

SerializationHandler interface should inlude DTDHandler

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.7
    • Serialization
    • Security Level: No security risk; visible to anyone (Ordinary problems in Xalan projects. Anybody can view the issue.)
    • None
    • PatchAvailable

    Description

      (Note that SerializationHandler is public in the Java sense, but is not a public API, so this issue is marking some internal development work that should be done).

      The SerializationHandler interface, which is implemented by Xalan's serializers is a kitchen-sink of other interfaces. It includes these public APIs:
      org.xml.sax.ContentHandler
      org.xml.sax.ErrorHandler
      org.xml.sax.ext.LexicalHandler
      org.xml.sax.ext.DeclHandler

      It appears that this interface:
      org.xml.sax.DTDHandler
      which has these two methods:
      void notationDecl(String name, String publicId, String systemId);
      void unparsedEntityDecl(String name, String publicId,
      String systemId, String notationName);
      should be added.

      DeclHandler, that is already included in SerializationHandler has this method:
      void elementDecl(String name, String model);

      When an XML document like this one (from Xalan's expression02.xml testcase) is parsed, and serialized:
      when parsing the XML input to the transformation:
      <?xml version="1.0"?>
      <!DOCTYPE doc [
      <!NOTATION gif SYSTEM "../www.foo.com" >
      <!ENTITY hatch-pic SYSTEM "../grafix/OpenHatch.gif" NDATA gif >
      <!ELEMENT doc (#PCDATA)>
      ]>

      the serializer handles the !ELEMENT just fine, and creates the surrounding !DOCTYPE, bucause the !ELEMENT is handled via the DeclHandler interface. However, there is no way to similarly serialize the !NOTATION or !ENTITY because these are handled via the DTDHandler interface.

      Attachments

        1. serializer.patch6.DTD.txt
          12 kB
          Brian Minchau
        2. serializer.patch5.DTD.txt
          13 kB
          Brian Minchau
        3. serializer.patch4.DTD.txt
          13 kB
          Brian Minchau

        Activity

          People

            minchau@ca.ibm.com Brian Minchau
            minchau@ca.ibm.com Brian Minchau
            Ilene Seelemann Ilene Seelemann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: