What's the XML namespace of this element?

Hi,

Suppose I have such elements in my XML document:

...

<xs:appinfo>

<CustomXML>

<Something>something</Something>

</CustomXML>

</xs:appinfo>

"xs" is declared as the default schema namespace. My question is: how would a parser interpret the inner elements of xs:appinfo? In which namespace do they belong?

I ask because I'm parsing the code in C# and it keeps adding "xmlns="" " to the CustomXML element, which makes me assume that otherwise it'd treat these elemenets as schema elements.

1 Answer

Relevance
  • indi01
    Lv 5
    8 years ago
    Favorite Answer

    I think you should make it explicit they belong to the schema namespace

    <xs:appinfo>

    <xs:CustomXML>

    <xs:Something>something</xs:Something>

    </xs:CustomXML>

    </xs:appinfo>

    • Login to reply the answers
Still have questions? Get your answers by asking now.