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

In transformation - Indentation is lost when StAXResult is used to output

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P3 P3
    • 1.4-pool
    • 1.4.0
    • xml
    • generic
    • generic

      In case of transformation - when we use StAXResult in the output
      indentation is lost , newline characters are not taken care of ..
      but this works if we use StreamResult instead

      In case of StreamResult , behaviour depends on what we set through
      transformer.setOutputProperty() - whether 'yes' or 'no' !

      but with StAXResult there is no change in behaviour according to
      what we set using transformer.setOutputProperty()


      ------------------- cities101.out with StAXResult -------------------------------------
      <?xml version="1.0" encoding="UTF-8"?><countries><country name="France"><city>Paris</city><city>Nice</city><city>Lyon</city></country><country name="Italia"><city>Roma</city><city>Milano</city><city>Firenze</city><city>Napoli</city></country><country name="Espana"><city>Madrid</city><city>Barcelona</city></country></countries>
      --------------------------- cities108.out with StreamResult ---------------------------
      <?xml version="1.0" encoding="UTF-8"?>
      <countries>
      <country name="France">
      <city>Paris</city>
      <city>Nice</city>
      <city>Lyon</city>
      </country>
      <country name="Italia">
      <city>Roma</city>
      <city>Milano</city>
      <city>Firenze</city>
      <city>Napoli</city>
      </country>
      <country name="Espana">
      <city>Madrid</city>
      <city>Barcelona</city>
      </country>
      </countries>
      ------------------------------------------------------------------------------------------

      Attached testcase - Test3.java will show this behaviour

            spericas Santiago Pericasgeertsen
            saksunw Sreejith Ak (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: