feklee
feklee

Reputation: 7695

xmlns precedence?

<?xml version="1.0" encoding="utf-8"?>
<request xmlns:a="http://example.com/a1">
    <a:description xmlns:a="http://example.com/a2">foo bar</a:description>
</request>

In which namespace is a:description, in http://example.com/a1 or in http://example.com/a2?

Upvotes: 0

Views: 41

Answers (1)

BeniBela
BeniBela

Reputation: 16917

http://example.com/a2

Children override the parent.

The namespace declaration already affects the element it is declared on (otherwise you could not set the namespace on the first element).

Upvotes: 2

Related Questions