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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 6u21
    • xml
    • 1.4
    • x86
    • windows_xp
    • Verified

      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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: