Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4358042

CDATA sections expanded by JAXP

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.1
    • 1.3.0
    • xml
    • 1.1fcs
    • generic
    • generic
    • Verified



      Name: skT45625 Date: 07/31/2000


      java version "1.2.2"
      HotSpot VM (1.0.1, mixed mode, build f)



      The JAXP 1.0.1 validating parser seems to "expand" CDATA sections
      when it is parsing them. Taking a look at the following example:

      test.dtd:
      <!ELEMENT A(#PCDATA)>

      test.xml:
      <!DOCTYPE A SYSTEM "file:test.dtd">
      <A> <![CDATA[Hello]]> abcd <![CDATA[World]]> &lt; <![CDATA[xyz]]> </A>

      When the JAXP validating parser parses the above and the output
      is write out, the product is:

      <A> <![CDATA[Hello abcd ]]><![CDATA[World ]]>&lt; <![CDATA[xyz ]]></A>

      It seems that the CDATA sections are expanded to include all characters
      before the next CDATA section, a character reference, or an end tag.

      p.s. It would be useful if you add an XML category to the bug list
      above (and on the previous page). I could not find an appropriate
      place to file this bug.

      ALso, I tried to include the character reference "&lt;", but it might
      be converted to the character "<" when submitted.
      (Review ID: 107768)
      ======================================================================

            egoei Edwin Goei (Inactive)
            skondamasunw Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: