XML and namespaces

Randy J. Ray rjray at blackperl.com
Mon Mar 17 21:27:54 GMT 2008

Simon Wistow wrote:
> Say I have a document that looks like
> <foo xmlns:bar="http://example.com/bar">
>   <bar:subelement attr="something"> 
>     value
>   </bar>
> </foo>
> is the elementname of the subelement "bar:subelement" or just 
> "subelement"?

The *tagname* is "subelement", and that is (should be) what an XML parser such
as XML::Parser or XML::LibXML will see in either the DOM structure or in the
element-start event.

The *Qualified Name*, or "QName" is "{http://example.com/bar}subelement",
though I'm not sure if that's the "official" notation per W3C, or if that's a
representation that I saw/read somewhere else...

Randy J. Ray      Sunnyvale, CA      http://www.rjray.org   rjray at blackperl.com

Silicon Valley Scale Modelers: http://www.svsm.org

More information about the london.pm mailing list