XML namespaces and attributes

前端 未结 4 665
梦谈多话
梦谈多话 2020-11-27 15:43

I\'m trying to understand how namespaces work in XML. When I have an element like foo:bar, the attributes will often not have namespaces on them. But sometimes they will. Ar

4条回答
  •  庸人自扰
    2020-11-27 16:12

    Examples to illustrate using the Clark notation, where the namespace prefix is replaced with the namespace URL in curly brackets:

    
    
    
    

    is

    <{}bar
        {http://www.foo.com/}baz="baz"
        {}qux="qux"/>
    <{http://www.foo.com/}bar
        {http://www.foo.com/}baz="baz"
        {}qux="qux"/>
    <{http://www.foo.com/}bar
        {http://www.foo.com/}baz="baz"
        {}qux="qux"/>
    

提交回复
热议问题