|
|
| About site: Data Formats/Markup Languages/XML/Namespaces - Namespaces in XML (alternate explanation) |
Return to Computers also Computers |
| About site: http://www.jclark.com/xml/xmlns.htm |
Title: Data Formats/Markup Languages/XML/Namespaces - Namespaces in XML (alternate explanation) An attempt by James Clark at a less confusing alternative explanation of the mechanism described in the XML Namespaces Recommendation. |
|
|
|
|
Vfxweb_com Sales of used PCs and Macs, components, peripherals and related hardware.
| Three_Soft_USA Prepares for Network +, A+, Cisco, MCSE 2000, Oracle DBA, Oracle Developer, E Commerce, Web Design, MOUS. Located in Virginia, United States.
| Heat_Sinks_Inc_ Supplier of pin and plate fin heat sinks.
| Learn_the_Net__Harnessing_E-mail Explains the features and usage of e-mail step by step. From About.com: Internet for Beginners.
| My_Flash_Resource A collection of tutorials, thoughts and interests of a Flash Animator and Developer.
| QuCalc Library of Mathematica functions whose purpose is to simulate quantum circuits and solve problems of quantum computation.
|
|
| Alexa statistic for http://www.jclark.com/xml/xmlns.htm |
Please visit: http://www.jclark.com/xml/xmlns.htm
|
| Related sites for http://www.jclark.com/xml/xmlns.htm |
| J-Cubed_Ltd Linux system specialists. Bespoke software development, database and E-commerce systems. Bournemouth, UK. | | Lint_Plus Source code analyzer, detects problems compilers cannot catch, by Cleanscape Software. | | Padua Creators of the Torture demo series. | | CCR_-_Cycom_Cash_Register Cash register and customer relationship management program with simple but integrated product/customer/contact lists. It contains a simple booking system as well for hair salons. A free beta version i | | Sibelius RISC OS version of the leading music notation package. | | 1st_Download_Center Shareware, freeware, and demo programs directory with screenshots, description and direct dowload links. All programs sorted by category. Accept PAD files submission. | | VMware A popular multi-function virtualizer for Windows and Linux. | | XHTML_1_0_Reference Complete reference with examples and relevant links to the W3C standard. | | Darryl_Lane_Internet_Marketer Web site development specializing in real estate companies. | | Visual_Retail_Plus,_Inc_ POS and inventory management solutions for multi-register and multi-store operations. | | ASP_Net_Resource_Index Contains listings for web applications, components and controls, hosting, software and server and finally tutorials and code snips. | | NewsBreaks__Google_Seeks_to_Restore_Deja_Functionality Richard W. Wiggins' article: "Since the February acquisition, Google has restored some of the lost searching functionality, and the company also says that by mid-May users of the Google Usenet index w | | Techniques_for_Scientific_C++ Useful techniques for implementing scientific programs in C++. Emphasis on using templates to improve performance. | | Notes_on_Fortran_Programming Information about Fortran, programming, tools, floating point type, external environment. | | Are_You_Ready_For_C99? Kuro5hin story about the new ANSI and ISO standard. (February 23, 2001) | | CleverNet_Multimedia Offers design, search engine promotion, hosting, graphics, maintenance, and management services. | | Bleeding_At_the_Keyboard Gregory Rawlins text of step by step guide on learning Java. | | Zigstone_Technology Offers site design, redesign, maintenance and database integration. | | Net_Dynasty Website and graphic design, e-commerce, database development, and search engine optimization. Based in Minneapolis, Minnesota, United States. | | Construction_Estimating_Program_for_General_Contractors Unique easy to use construction estimating software solution for general contractors, concrete, framing, civil and site work, bridge, and utility contractors, familiar spreadsheet based system, fast s |
|
This is websites2007.org cache of m/ as retrieved on 2008.08.28 websites2007.org's cache is the snapshot that we took of the page as we crawled the web. The page may have changed since that time.
|
XML NamespacesXML NamespacesJames Clark <jjc@jclark.com>The XML NamespacesRecommendation seems to be causing a great deal of confusion. This noteattempts an alternative explanation of the mechanism described in theRecommendation which I hope will be less confusing.In the data model implied by XML, an XML document contains a tree ofelements. Each element has an element type name (sometimes called the tag name)and a set of attributes; each attribute consists of a name and a value.Applications typically make use of the element type name and attributes of anelement in determining how to process the element. In XML 1.0 withoutnamespaces, element type names and attribute names are unstructured stringsusing a restricted set of characters, similar to identifiers in programminglanguages. I'll call these names local names. This is problematic in adistributed environment like the Web. One XML document may use partelements to describe parts of books, another may use part elements todescribe parts of cars. An XML application has no way of knowing how to processa part element unless it has some additional information external tothe document.The XML Namespaces Recommendation tries to improve this situation byextending the data model to allow element type names and attribute names to bequalified with a URI. Thus a document that describes parts of cars can usepart qualified by one URI; and a document that describes parts ofbooks can use part qualified by another URI. I'll call the combinationof a local name and a qualifying URI a universal name. The role of theURI in a universal name is purely to allow applications to recognize the name.There are no guarantees about the resource identified by the URI. The XMLNamespaces Recommendation does not require element type names and attributenames to be universal names; they are also allowed to be local names.Documents using this extended data model can be written by extending the XMLsyntax to allow universal names written as a URI in curly brackets followed bythe local name. With this syntax,<{http://www.cars.com/xml}part />would specify an element whose element type name is a universal name withlocal name part and URI http://www.cars.com/xml. The XMLNamespaces Recommendation does not take this approach, because XML 1.0parsers would not be able to handle such documents. However, I will use theabove syntax to explain the syntax actually used by the XML NamespacesRecommendation.The XML Namespaces Recommendation expresses universal names in an indirectway that is compatible with XML 1.0. In effect the XML NamespacesRecommendation defines a mapping from an XML 1.0 tree where element type namesand attribute names are local names into a tree where element type names andattribute names can be universal names. The mapping is based on the idea of aprefix. If an element type name or attribute name contains a colon, then themapping treats the part of the name before the colon as a prefix, and the partof the name after the colon as the local name. A prefix foorefers to the URI specified in the value of the xmlns:fooattribute. So, for example<cars:part xmlns:cars="http://www.cars.com/xml"/>maps to<{http://www.cars.com/xml}part/>Note that the xmlns:cars attribute has been removed by the mapping.This works for attribute names just as for element type names. For example <NAME HTML:CLASS="largeSansSerif" xmlns:HTML="http://www.w3.org/TR/REC-html40" >Layman, A</NAME>maps to<NAME {http://www.w3.org/TR/REC-html40}CLASS="largeSansSerif" >Layman, A</NAME>All these xmlns attributes are rather cumbersome, so the XMLNamespaces Recommendation allows them to be inherited: if a prefixfoo is used in a tag, but the element does not have anxmlns:foo attribute, then the value of the parent element'sxmlns:foo attribute will be used; if the parent does nothave an xmlns:foo attribute, then the value of thegrandparent element's xmlns:foo attribute will be used, andso on. For example, <RESERVATION xmlns:HTML="http://www.w3.org/TR/REC-html40"> <NAME HTML:CLASS="largeSansSerif">Layman, A</NAME> <SEAT CLASS="Y" HTML:CLASS="largeMonotype">33B</SEAT> <HTML:A HREF="http://www.jclark.com//cgi-bin/ResStatus">Check Status</HTML:A> <DEPARTURE>1997-05-24T07:55:00+1</DEPARTURE></RESERVATION>maps to<RESERVATION> <NAME {http://www.w3.org/TR/REC-html40}CLASS="largeSansSerif" >Layman, A</NAME> <SEAT CLASS="Y" {http://www.w3.org/TR/REC-html40}CLASS="largeMonotype">33B</SEAT> <{http://www.w3.org/TR/REC-html40}A HREF="http://www.jclark.com//cgi-bin/ResStatus" >Check Status</{http://www.w3.org/TR/REC-html40}A> <DEPARTURE>1997-05-24T07:55:00+1</DEPARTURE></RESERVATION>In many cases, most of the elements in a document have universal elementtype names that have the same URI. The XML Namespaces Recommendation has aspecial syntax to make this more convenient. An attribute xmlnsspecifies a URI that qualifies all unprefixed element type names. Thexmlns attribute is inherited just like the xmlns: prefixedattributes. For example,<section xmlns='urn:com:books-r-us'> <title>Book-Signing Event</title> <signing> <author title="Mr" name="Vikram Seth" /> <book title="A Suitable Boy" price="$22.95" /> </signing></section>maps to<{urn:com:books-r-us}section> <{urn:com:books-r-us}title >Book-Signing Event</{urn:com:books-r-us}title> <{urn:com:books-r-us}signing> <{urn:com:books-r-us}author title="Mr" name="Vikram Seth" /> <{urn:com:books-r-us}book title="A Suitable Boy" price="$22.95" /> </{urn:com:books-r-us}signing></{urn:com:books-r-us}section>Note that the xmlns attribute does not affect unprefixed attributenames.An empty value for xmlns makes the mapping treat unprefixed elementtype names as local names (which is the default behaviour in the absence ofxmlns attributes). Thus<section xmlns='urn:com:books-r-us'> <title>Book-Signing Event</title> <signing xmlns=''> <author title="Mr" name="Vikram Seth" /> <book title="A Suitable Boy" price="$22.95" /> </signing></section>maps to<{urn:com:books-r-us}section> <{urn:com:books-r-us}title >Book-Signing Event</{urn:com:books-r-us}title> <signing> <author title="Mr" name="Vikram Seth" /> <book title="A Suitable Boy" price="$22.95" /> </signing></{urn:com:books-r-us}section>It is important to realise that the XML Namespaces Recommendation does notchange the behaviour of XML 1.0 parsers in any way. The mapping from prefixesto URIs is a separate processing layer that operates on the element treeresulting from XML 1.0 parsing. Note in particular that it does not change theprocessing of the DTD. For example<!DOCTYPE doc [<!ATTLIST foo:x att CDATA "foo">]><doc xmlns:foo="http://www.foo.com" xmlns="http://www.foo.com"> <x/> <foo:x/></doc>maps to<{http://www.foo.com}doc> <{http://www.foo.com}x/> <{http://www.foo.com}x att="foo"/></{http://www.foo.com}doc>This includes validation. The XML Namespaces Recommendation does not definea kind of validity distinct from XML 1.0 validity. Thus<!DOCTYPE doc [<!ELEMENT doc (x)><!ELEMENT x EMPTY><!ATTLIST x xmlns CDATA #FIXED "http://www.jclark.com/"><!ELEMENT foo:x EMPTY><!ATTLIST foo:x xmlns:foo CDATA #FIXED "http://www.jclark.com/">]><doc><foo:x/></doc>is invalid just as it would be in XML 1.0, even though<!DOCTYPE doc [<!ELEMENT doc (x)><!ELEMENT x EMPTY><!ATTLIST x xmlns CDATA #FIXED "http://www.jclark.com/">]><doc><x/></doc>is valid, and they both map to<doc><{http://www.jclark.com/}x/></doc>It would of course be very useful to have namespace-aware validation: to beable to associate each URI used in a universal name with some sort of schema(similar to a DTD) and be able to validate a document using multiple such URIswith respect to the schemas for all of the URIs. The XML NamespacesRecommendation does not provide this. The reason is is that DTDs havemany other problems and missing features in addition to lack ofnamespace-awareness. So the plan is to come up with a new schema mechanism thatfixes the problems with DTDs and, as part of this, providesnamespace-awareness. This work is being done by the XML Schema WG.Last updated: 1999/02/04 |
|
| |
An | attempt | by | James | Clark | at | a | less | confusing | alternative | explanation | of | the | mechanism | described | in | the | XML | Namespaces | Recommendation. |
|
http://www.jclark.com/xml/xmlns.htm
Namespaces in XML (alternate explanation) 2008 August
dvd rental
dvd
An attempt by James Clark at a less confusing alternative explanation of the mechanism described in the XML Namespaces Recommendation.
Rules
|
© 2008 Internet Explorer 5+ or Netscape 6+
|
|
Recommended Sites: 1.
Arts -
Business -
Computers -
Games -
Health -
Home -
Kids and Teens -
News -
Recreation -
Reference -
Regional -
Science -
Shopping -
Society -
Sports -
World
Miss Gallery
- Top Anime Hentai
- DVD rental by mail
- Credit Cards - Secured Loan - Remortgages - Hotel Las Vegas - Loans
|