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

SYS-CON.TV
Cloud Expo & Virtualization 2009 East
PLATINUM SPONSORS:
IBM
Smarter Business Solutions Through Dynamic Infrastructure
IBM
Smarter Insights: How the CIO Becomes a Hero Again
Microsoft
Windows Azure
GOLD SPONSORS:
Appsense
Why VDI?
CA
Maximizing the Business Value of Virtualization in Enterprise and Cloud Computing Environments
ExactTarget
Messaging in the Cloud - Email, SMS and Voice
Freedom OSS
Stairway to the Cloud
Sun
Sun's Incubation Platform: Helping Startups Serve the Enterprise
POWER PANELS:
Cloud Computing & Enterprise IT: Cost & Operational Benefits
How and Why is a Flexible IT Infrastructure the Key To the Future?
Click For 2008 West
Event Webcasts
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.

Latest Cloud Developer Stories
HP said Wednesday that it would lay off 8% of workforce, 27,000 people, by October or 2014. It figures the move will save it $3 billion-$3.5 billion and expects to re- invest the money in cloud, security and Big Data.
With Cloud Expo 2012 New York (10th Cloud Expo) now under three weeks away, what better time to introduce you in greater detail to the distinguished individuals in our incredible Speaker Faculty for the technical and strategy sessions at the conference... We have technical and...
What do the CTOs of the CIA and the U.S. Dept. of Justice and the CIO of the National Reconnaissance Office have in common with the CEOs of Eucalyptus, GoGrid, ActiveState, Appcara, OpSource and Nortonworks, the CTOs of Rackspace, SoftLayer, SOA Software and AppZero, the Founder ...
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...
ServerCentral, Chicago’s leading provider of colocation, cloud, network connectivity, and managed services, announced on Tuesday that its high performance cloud will debut on June 11 at the 10th International Cloud Expo, held June 11-14 at the Javits Center in New York City. “Se...
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

Breaking Cloud Computing News
Acceleware® Ltd. ("Acceleware" or the "Company") (TSX VENTURE:AXE), a leading developer of high perf...