Differences between a 'local name' and 'qualified name' in a xml attribute

后端 未结 2 626
感情败类
感情败类 2021-02-13 12:35

Can you please help me understand what is the difference between \'local name\' and \'qualified name\' in a xml attribute? From http://developer.android.com/reference/org/xml/sa

2条回答
  •  梦谈多话
    2021-02-13 13:14

    A local name is one which isn't qualified by a namespace. The fully qualified one includes the namespace, if any.

    It's probably worth reading the W3C recommendation on XML names to get the full details.

    Basically if you don't have xmlns anywhere in your XML file, you probably won't need to worry about namespaces. If you do have namespaces, you'll probably want to create a fully qualified name when checking for element names etc.

    Note that attributes are generally less likely to use namespaces than elements, in my experience.

提交回复
热议问题