I have this code :
<st:friend xmlns:st='areacode:819'>
<st:name xmlns:st='urn:555'>Company</st:name>
<type>B</type>
</st:friend>
Can someone explain me why st is declared twice?
I have this code :
<st:friend xmlns:st='areacode:819'>
<st:name xmlns:st='urn:555'>Company</st:name>
<type>B</type>
</st:friend>
Can someone explain me why st is declared twice?
Your XML example isn't well formed as it does not close the <st:friend> element but I'll assume that you meant to close it after the <type> element.
What is going on here is that the <st:name> element is redefining what namespace the st prefix refers to (to urn:555). This definition applies to the <st:name> element only (and would apply to child elements too if there were any). Once you are past the closing tag <st:name/>, the st prefix refers again to its original namespace (areacode:819).