Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5733

StaxSource doesn't produce correct SAX events with default namespace

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0
    • 3.0.1
    • Core
    • None
    • Unknown

    Description

      There's idiomatic XSLT copy transformation:

      <xsl:stylesheet version="1.0"
                      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      
          <xsl:template match="@*|node()">
              <xsl:copy>
                  <xsl:apply-templates select="@*|node()" />
              </xsl:copy>
          </xsl:template>
      
      </xsl:stylesheet>
      

      Using current org.apache.cxf.staxutils.StaxSource for such transformation applied on this input document:

      <root xmlns="urn:org.apache.cxf:test">Text</root>
      

      produces the following result with Xalan 2.7.1:

      < xmlns="urn:org.apache.cxf:test">Text</>
      

      After getting rid of the hack commented with:

              // Adding namespace declaration as attributes is necessary because
              // the xalan implementation that ships with SUN JDK 1.4 is bugged
              // and does not handle the startPrefixMapping method
      

      And using correct order of events:

      1. start prefix mapping
      2. start element
      3. end element
      4. end prefix mapping

      The result was correct on both:

      • Xalan 2.7.1
      • JDK 1.6.0_04 (and laters)

      JDK 1.6.0_04 is the first JDK that ships with JAX-WS 2.1 which seem to be required by CXF.

      regards
      Grzegorz Grzybek

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            ggrzybek Grzegorz Grzybek
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: