Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Namespace Processing in XML

Tags:

xml

Can anybody tell me what exactly does one mean by namespace processing. I have read everything about xml namespaces, and xml schemas, but haven't been able find anywhere what does the above term means.

I believe its a name for some normal task, but I'd like to be sure what it means.

Thanks.

like image 566
Rajat Avatar asked Oct 03 '22 05:10

Rajat


1 Answers

The documentation on FEATURE_PROCESS_NAMESPACES says

This feature determines whether the parser processes namespaces.

"Namespace processing" in this context just means "expecting that an XML file is going to use the semantics defined in the XML Namespaces standard, and parsing accordingly."

Here's the deal. If a file is supposed to be parsed with namespace processing then <foo:bar/> is supposed to an empty element named bar in the namespace associated with the prefix foo. If the same file is supposed to be parsed without namespace processing then <foo:bar/> is an empty element named foo:bar. (XML 1.0 does not mandate namespaces and makes the colon a valid element name.) A document consisting of this:

<foo:bar/>

Can be valid or invalid depending on whether namespace processing is off or on.

like image 116
Louis Avatar answered Oct 13 '22 10:10

Louis