python - How to get the namspace of a url -


what namespace of following url.

http://slhepp0034.ctsslou.visteon.com/login/login.htm#v37632/p10454

and wsdl format, if write in soap wsdl format

understand basics first. xml namespace? xml namespaces used providing uniquely named elements , attributes in xml document. defined in w3c recommendation. xml instance may contain element or attribute names more 1 xml vocabulary. if each vocabulary given namespace, ambiguity between identically named elements or attributes can resolved.

a simple example consider xml instance contained references customer , ordered product. both customer element , product element have child element named id. references id element therefore ambiguous; placing them in different namespaces remove ambiguity.

an xml namespace declared using reserved xml attribute xmlns or xmlns:prefix, value of must valid namespace name.

for example, following declaration maps "xhtml:" prefix xhtml namespace:

for eg. xmlns:xhtml="http://www.w3.org/1999/xhtml"

any element or attribute name starts prefix "xhtml:" considered in xhtml namespace, if or ancestor has above namespace declaration.

it possible declare default namespace. example:xmlns="http://www.w3.org/1999/xhtml" in case, element without namespace prefix considered in xhtml namespace, if or ancestor has above default namespace declaration.

attributes never subject default namespace. attribute without explicit namespace prefix considered not in namespace.

xml namespaces 1.1 introduces option undeclare other namespace.

different specifications have taken different approaches on how namespace information presented applications.

nearly programming models allow name of element or attribute node retrieved three-part name: local name, namespace prefix, , namespace uri. applications should avoid attaching significance choice of prefix, information provided because can helpful human readers. names considered equal if namespace uri , local name match.

in addition, models provide way of determining namespaces have been declared given element. information needed because xml vocabularies allow qualified names (containing namespace prefixes) appear in content of elements or attributes, in names. there 3 main ways information can provided:

as attribute nodes named "xmlns" or "xmlns:xxx", namespaces written in source xml document. model presented dom. namespace declarations: distinguished attributes, corresponding one-to-one relevant attributes in source xml document. model presented jdom. in-scope namespace bindings: in model, application able determine namespaces in scope given element, not able determine elements contain actual declarations. model used in xpath, xslt, , xquery. 

if know these basics, hope question answered.


Comments