Search code examples
xmlxml-namespacesw3c

Namespace and no namespace tag in the same XML is according with the W3C recommendation?


See the example XML below:

<?xml version="1.0"?>
<request serviceName="MyService" xmlns:model="http://me.myself.com/model">
<model:user>USER</model:user>
<model:pass>PASS</model:pass>
<package>PackageNumber</package>
<types>Float</types>

I know that this XML is correctly parsed and valid. I also know that the <user> and <pass> tags has the namespace "model" and the other tags has no namespace (or namespace denoted by the empty string xmlns="").

My doubt is if this XML is still according with the W3C recommendations or if I need denote a namespace (different of empty) for all the tags? I tried to find this information direct in recommendations and in MDN tutorial, but is not clear to me


Solution

  • Yes, your document is well-formed, namespaces and all.