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

Line wrapping and indenting while pretty-printing

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.7
    • None
    • Xalan
    • None
    • Window XP and Apple OS X

    Description

      When using the pretty-printing fearure in LSSeralizer the output looks like

      <?xml version="1.0" encoding="UTF-8"?><Server cookie="-7dfe3a9b:11377ee20de:-7fdd" deviceType="Admin" failureText="Protocol Version not supported" friendlyName="CSMP2610" ipAddress="10.1.41.70" licenseStatus="0" macAddress="00-14-22-38-AA-43" result="Failed" serialNumber="09665" type="checkProtocolVersion">
      <VersionInfo>
      <AdminServer versionBuild="23" versionMajor="3" versionMinor="1" versionOther="5" versionPatch="5"/>
      </VersionInfo>
      <Event eid="85008" hr="0" timeStamp="1183127997"/>
      </Server>

      When using XMLSerializer it looks like

      <?xml version="1.0" encoding="UTF-8"?>
      <Server cookie="-7dfe3a9b:11377ee20de:-7fdd" deviceType="Admin"
      failureText="Protocol Version not supported" friendlyName="CSMP2610"
      ipAddress="10.1.41.70" licenseStatus="0" macAddress="00-14-22-38-AA-43"
      result="Failed" serialNumber="09665" type="checkProtocolVersion">
      <VersionInfo>
      <AdminServer versionBuild="23" versionMajor="3" versionMinor="1" versionOther="5" versionPatch="5"/>
      </VersionInfo>
      <Event eid="85008" hr="0" timeStamp="1183127997"/>
      </Server>

      where elements with a long list of attributes are wrapped and indented to make the XML more readable. LSSerializer should do the same. It would also be nice to specify the maximum line width in the API, otherwise a default of 80 or 100 characters would be fine (or whatever the default is used in XMLSerializer).

      While this problem is trivial, it is blocking me from converting my code from using the deprecated XMLSerializer to using the official LSSerializer instead.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kolotyluk Eric Kolotyluk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: