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

javax.xml.namespace.NamespaceContext#getPrefix does not follow API documents

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 6u21
    • Fix Version/s: 1.4.0
    • Component/s: xml
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      1.4
    • CPU:
      x86
    • OS:
      windows_xp
    • Verification:
      Verified

      Description

      javax.xml.namespace.NamespaceContext#getPrefix does not seem to following API documents.

      According to the following page,
      http://download.oracle.com/javase/6/docs/api/javax/xml/namespace/NamespaceContext.html#getPrefix%28java.lang.String%29

      XMLConstants.XML_NS_PREFIX ("xml") should be return for XMLConstants.XML_NS_URI ("http://www.w3.org/XML/1998/namespace").
      XMLConstants.XMLNS_ATTRIBUTE ("xmlns") should be return for XMLConstants.XMLNS_ATTRIBUTE_NS_URI ("http://www.w3.org/2000/xmlns/").

      However, "null" returns for both cases in the attached test case.

      CONFIGURATION:
      JDK :6u21(and later)
      OS : WIndowsXP(SP3, Japanese)

      REPRODUCE:
      1. Compile the attached test case c.java
      2. Invoke "java c"

      The following message show up.

      F:\temp> java c
      null
        expected result: xml
      null
        expected result: xmlns

      The above "null"s should be "xml" and "x,lns" respectively.

        Attachments

          Activity

            People

            • Assignee:
              joehw Joe Wang
              Reporter:
              tbaba Tadayuki Baba (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: