Uploaded image for project: 'XalanC'
  1. XalanC
  2. XALANC-435

omit-xml-declaration requires indent="yes" to behave as expected

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Duplicate
    • 1.8
    • CurrentCVS
    • XalanC
    • None
    • RedHat 9 with full patches (including all Progeny updates), kernel 2.4.20, i686, Xerces 2.5.0.

    Description

      (Examples taken from O'Reilly's Learning XSLT by Michael Fitzgerald, which is how I discovered the bug.)

      Here is escape.xml:
      – cut –
      <title>O'Reilly</title>
      – cut –

      Here is escape.xsl:
      – cut –
      <stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform">
      <output method="xml" omit-xml-declaration="yes"/>

      <template match="/">
      <publisher xmlns="">
      <value-of select="title" xmlns="http://www.w3.org/1999/XSL/Transform"/>
      <text disable-output-escaping="yes" xmlns="http://www.w3.org/1999/XSL/Transform"> & Associates</text>
      </publisher>
      </template>

      </stylesheet>
      – cut –

      'xalan escape.xml escape.xsl' gives:

      <?xml version="1.0" encoding="UTF-8"?><publisher>O'Reilly & Associates</publisher>

      The stylesheet explicitly states 'omit-xml-declaration', but it is printed anyway. One way I found to achieve expected behavior is to change the output element of escape.xsl to read:

      <output method="xml" indent="yes" omit-xml-declaration="yes"/>

      A trivial issue, to be sure, but it may be a side-effect of some other flaw.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jesusfreak Sean Warden
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: