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

JAXP issue 63 : attribute is accessible with invalid namespace

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 7
    • xml
    • 1.4
    • generic
    • generic

        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).

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

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: