Comments
bruce.armstrong wrote: Somebody just said it better than I did, and with more chops to say it: Open Letter to Mark Zuckerberg, Sheryl Sandberg & Facebook Mobile
Cloud Expo on Google News


2008 West
DIAMOND SPONSOR:
Data Direct
SOA, WOA and Cloud Computing: The New Frontier for Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
GOLD SPONSORS:
Appsense
User Environment Management – The Third Layer of the Desktop
Cordys
Cloud Computing for Business Agility
EMC
CMIS: A Multi-Vendor Proposal for a Service-Based Content Management Interoperability Standard
Freedom OSS
Practical SOA” Max Yankelevich
Intel
Architecting an Enterprise Service Router (ESR) – A Cost-Effective Way to Scale SOA Across the Enterprise
Sensedia
Return on Assests: Bringing Visibility to your SOA Strategy
Symantec
Managing Hybrid Endpoint Environments
VMWare
Game-Changing Technology for Enterprise Clouds and Applications
Click For 2008 West
Event Webcasts

2008 West
PLATINUM SPONSORS:
Appcelerator
Get ‘Rich’ Quick: Rapid Prototyping for RIA with ZERO Server Code
Keynote Systems
Designing for and Managing Performance in the New Frontier of Rich Internet Applications
GOLD SPONSORS:
ICEsoft
How Can AJAX Improve Homeland Security?
Isomorphic
Beyond Widgets: What a RIA Platform Should Offer
Oracle
REAs: Rich Enterprise Applications
Click For 2008 Event Webcasts
SYS-CON.TV
Top Links You Must Click On


The Specific ElementFormDefault Schema Attribute
The need for a schema definition language

Here is my 'five-minute XML' series where by I give you scheduled byte size guides.

Today's issue is good for those people who happen to be starting out with XML.

In "XML Schema - Overview" (5 Minute XML #7), I reported the need for a schema definition language. I defined principle syntax for the purpose of indicating the namespace from the schema document and W3C URI (for referencing components and attributes not defined from the targetNamespace).

In conclusion I referred to the following schema attribute: <xs:schema elementFormDefault="qualified" ...>.

Here, I am hoping to explain precisely why and how this attribute is used and additionally precisely what influences it brings to bear.

Put simply an XML schema is seen as a group of rules or specification if you like, that the programmer would likely make use of to spell out the structure of an XML document. One example is with a database schema will describe the data which can be within a database (table structure, data types, etc.) An XML Schema is a lot the same for an XML document, it is effectively a rule set.

A schema itself might be contains components from a variety of schemas each in its own namespace. A schema developer will have to make a decision whether or not to uncover or possibly conceal these namespaces to the instance document. The elementFormDefault schema attribute allows them to do just this.

Setting elementFormDefault="unqualified" (the default) will hide (or localise) the namespaces, while setting it to "qualified" definitely will expose the namespaces outlined in the schema to the instance document.

Such as the schema below describes a car which sources components through three or more other schemas. The chassis, wheels and interior are generally resulting from individual makers.

Car.xsd
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="*.w3.org/2001/XMLSchema"
targetNamespace="*.car.org"
xmlns="*.car.org"
xmlns:ford="*.ford.com"
xmlns:toyota="*.toyota.com"
xmlns:audi="*.audi.com"
elementFormDefault="unqualified">
<xsd:import namespace="*.ford.com"
schemaLocation="Ford.xsd"/>
<xsd:import namespace="*.toyota.com"
schemaLocation="Toyota.xsd"/>
<xsd:import namespace="*.audi.com"
schemaLocation="Audi.xsd"/>
<xsd:element name="camera">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="chassis" type="Ford:chassis"/>
<xsd:element name="wheels" type="Toyota:wheels"/>
<xsd:element name="interior" type="Audi:interior"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

Take note the import elements. These accept entry to elements via the diverse manufacturers. Word moreover that the schema attribute elementFormDefault will be set to unqualified. This process covers the many different manufacturers' namespaces from virtually any instance document. Such an instance record may possibly look and feel something like this:

Car.xml
<?xml version="1.0"?>
<my:car xmlns:my="http://www.car.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.car.org Car.xsd">
<chassis>
<description>
Ford F-Series F-150 Regular Cab 2WD
</description>
</chassis>
<wheels alloys="true">
<tyres>Pirelli P3000</tyres>
</wheels>
<interior>
<seatCoverMaterial>leather</seatCoverMaterial>
</interior>
</my:camera>

Only the car root element namespace qualifier is subjected in the instance record, above. The various car brands providing the actual numerous components are at this point concealed or ‘localized' to the schema definition. The instance file doesn't worry itself with where the components are usually taken from. Just that they are accessible.

If, on the other hand, elementFormDefault was indeed set to qualified we would probably have a different story...

These will probably be introduced in another 5 Minute XML article.

A large cornucopia of info is available on the subject of XML for folks who would choose to understand more. For the definitive guide, visit www.W3.org.

Hopefully the above mentioned is beneficial to somebody out there. Much more information will be coming very soon.

About Tony Gupta
Tony Gupta has worked in the world of IT for almost 20 years now with a special emphasis on XML and web standards technologies since 1994 when XML started to take off. In his personal life he enjoys motor racing and prestige cars. He is also a part-time property developer and has a real passion for renovating old barns.

Enterprise Open Source Magazine Latest Stories . . .
Grid Dynamics, an eCommerce technology solutions company, and GridGain Systems, makers of an open source in-memory platform for Big Data processing, on Wednesday announced the expansion of their partnership which began in 2008. Grid Dynamics provides personalization and big data solut...
Before embarking on using open source cloud technology for your web property, a basic understanding of cloud, as it’s used in the industry, is essential. While there might be exceptions, here are the definitions. A software application delivered on the web instead of installing standa...
Private clouds solve many problems for enterprises and bring unique operational challenges along with them. There are dozens of companies of all sizes that will build you a private cloud and turn over the keys – then what? Trying to convert a traditional enterprise IT operations team t...
The networking industry has gone through different waves over last 30+ years. In the ’80s, the first wave was all about connecting and sharing; how to connect a computer to other peripheral devices and other computers. There were many players who developed technology and services to ad...
If your organization already uses virtualized infrastructure, you are well on your way to providing IT as a Service. But as businesses demand faster results in today’s competitive market, organizations look to gain more benefits from cloud computing than just virtualized infrastructure...
In this CTO Power Panel at the 10th International Cloud Expo, moderated by Cloud Expo Conference Chair Jeremy Geelan, industry-leading CTOs & VPs of Technology will discuss such topics as: Which do you think is the most important cloud computing standard still to tackle? Who should...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON Featured Whitepapers
ADS BY GOOGLE