AlphaQ
AlphaQ

Reputation: 676

Error parsing XML: Prefix must not be bound to reserved namespace explicitly

I cannot fix this error even after trying the mentioned techniques in other posts. I don't have crashlytics in my application. It's rather simple. The issue persists even after cleaning the build and invalidating caches. The following code is present in the values.xml file with a curly red line under the resources keyword.

    <resources
    xmlns:ns1="urn:oasis:names:tc:xliff:document:1.2"
    xmlns:ns2="http://schemas.android.com/tools"
    xmlns:ns3="http://www.w3.org/2000/xmlns/">
  ...

I know this question was asked a few times but I'm not able to fix the error in my application.

Upvotes: 2

Views: 4486

Answers (1)

Michael Kay
Michael Kay

Reputation: 163322

The declaration of ns3 is invalid because the namespace URI http://www.w3.org/2000/xmlns/ is reserved.

See section 3 of the XML Namespaces 1.1 specification at http://www.w3.org/TR/xml-names11/

The prefix xmlns is used only to declare namespace bindings and is by definition bound to the namespace name http://www.w3.org/2000/xmlns/. It must not be declared or undeclared. Other prefixes must not be bound to this namespace name, and it must not be declared as the default namespace. Element names must not have the prefix xmlns.

Upvotes: 2

Related Questions