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

JAXP issue 63 : attribute is accessible with invalid namespace

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 7
    • Fix Version/s: 1.4.0
    • Component/s: xml
    • Labels:
    • Subcomponent:
    • Introduced In Version:
    • Resolved In Build:
      1.4
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        Refer to: https://jaxp.dev.java.net/issues/show_bug.cgi?id=63

        attributes with defined prefix (namespace) is accessible with "empty" namespace.

        for example

        xml: <prefix:rootElem xmlns:prefix="something" prefix:attr="attrValue" />

        code:
            public void startElement(String uri, String localName, String qName,
        Attributes atts) throws SAXException {

                super.startElement(uri, localName, qName, atts);

                String attr_WithNs = atts.getValue("something", "attr");
                String attr_NoNs = atts.getValue("", "attr");

        }


        attr_NoNs should be null but atts.getValue returns same thing as is set in
        attr_WithNs.

        This is confirmed regression (introduced in JDK6_18, present in OpenJDK7).

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                joehw Joe Wang
                Reporter:
                joehw Joe Wang
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: