473,594 Members | 2,812 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XSD: What is elementFormDefa ult="qualified" for?

Hi everyone

I am a new poster to this group, so hello to you all!

Having just started a new job I have been thrown in the deep end with
some heavy XML work so I am finding my feet and I am sure that this
will be the first of many posts on here!

My first question is to do with Complex Types in XSD. I have figured
out what a complex type is, and I have found that what the API provider
is doing, is to do <xs:extension /> in a secondary set of XSDs.

What I have noticed is that at the top of the XSD in the <xs:schema />
opening tag, it says elementFormDefa ult="qualified" - and I was just
wondering if somebody could tell me what it is there for because I
can't find any documentation on what it does?

Many thanks in advance


May 12 '06 #1
5 4342
Hi Darren,

"daz_oldham " <Da************ **@gmail.com> writes:
What I have noticed is that at the top of the XSD in the <xs:schema />
opening tag, it says elementFormDefa ult="qualified" - and I was just
wondering if somebody could tell me what it is there for because I
can't find any documentation on what it does?

elementFormDefa ult="qualified" declaration indicates that all elements,
even local (i.e., those defined within complexType) should be qualified
in the instance documents.


May 12 '06 #2
Thanks Boris, I know that you're answer is spot-on but still with my
newbie hat on - what does "qualified" mean?

I know that is a very novice question, but as I say, I am really new to
all this!

Many thanks


May 15 '06 #3
All "qualified" elements and attributes are in the targetNamespace of the
schema and all "unqualifie d" elements and attributes are in no namespace.
All global elements and attributes are qualified.

Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.

"daz_oldham " <Da************ **@gmail.com> wrote in message
news:11******** **************@ j33g2000cwa.goo glegroups.com.. .
Thanks Boris, I know that you're answer is spot-on but still with my
newbie hat on - what does "qualified" mean?

I know that is a very novice question, but as I say, I am really new to
all this!

Many thanks


May 15 '06 #4
"Qualified" , in XML terms, means "Associated with a namespace, either by
the use of a declared prefix or via a default namespace declaration".

As to what elementFormDefa ult means: It indicates "whether or not
locally declared elements and attributes must be unqualified." See the
discussion and examples at


() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
May 15 '06 #5

"daz_oldham " <Da************ **@gmail.com> writes:
Thanks Boris, I know that you're answer is spot-on but still with my
newbie hat on - what does "qualified" mean?

Ok, I guess an example is in order:

<xsd:schema xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
targetNamespace ="http://www.example.com/library"
elementFormDefa ult="qualified" >

<xsd:element name="catalog">
<xsd:complexTyp e>
<xsd:sequence >
<xsd:element name="book" type="xsd:strin g" maxOccurs="unbo unded"/>
</xsd:complexType >

With this schema, your instance would then look lool like this:

<lib:catalog xmlns:lib="http ://www.example.com/library">
<lib:book>XML Schema</lib:book>

If you change the above schema to read elementFormDefa ult="uqualified ",
then the instance becomes:

<lib:catalog xmlns:lib="http ://www.example.com/library">
<book>XML Schema</book>

In XML Schema terms, in the first case, local element catalog/book belongs
to the http://www.example.com/library namespace (and therefore has to be
prefixed with the corresponding namespace prefix (lib in our case)). In
the second case, the same element does not belong to any namespace and
therefore can be used as-is in the instance document.
Boris Kolpackov
Code Synthesis Tools CC
Open-Source, Cross-Platform C++ XML Data Binding
May 16 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: johnsocs | last post by:
All I'm trying to write an xml schema for the following xml from the google web service api. In the schema I'm not sure how to describe the soapenv:encodingStyle attribute. Thanks. <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
by: jacksuyu | last post by:
I have two xsd files, in one xsd file, I defined a "key", I'd like to use "keyref" to refer to that "key" from another xsd file. But I always get attribute is empty error. my.xsd is my first xsd file with "key", myphone.xsd is the keyref file which need to refer to the "key" Thanks. my.xsd:
by: joewhitehair | last post by:
Using the XSD.exe tool, I created a number of classes from my XSD file. When I generate the WSDL for my web service, the schema does not have the proper Occurance constraints for the attributes. In this example, the MessageID element should always occur (minOccur=1, maxOccur=1), but the WSDL generates minOccur=0. I can't pinpoint why this is happening and I can't find a may to force this in the code either. Anyone have any insight? This...
by: TS | last post by:
Hi, i have a problem validating xml against schema. I used http://apps.gotdotnet.com/xmltools/xsdvalidator/Default.aspx validator and it says it is fine. Can you tell me why this doesn't work? Thanks! Schema: <?xml version="1.0"?> <xs:schema id="ReportInfo" targetNamespace="http://tempuri.org/Reports.xsd"
by: bibsoconner | last post by:
Hi, I hope someone can please help me. I'm having a lot of trouble with schema files in .NET. I have produced a very simple example that uses "include" to include other schema files. It all works with SPY, but when I pick "Validate Schema" from the .NET 2003 menu, it fails with message: "Type XType is not declared." As I hinted at in my subject line, I suspect that it has to do with including another schema multiple times.
by: Andrew Burgher | last post by:
Feeding the following .xsd into the XsdObjectGen (v1.4.2.0) tool produces an invalid attribute: with DataType="System.String". Has anybody seen this behaviour before? Is this a bug in XsdObjectGen? or a problem with the input schema? I'm trying to avoid hacking the generated code... In: <?xml version = "1.0" encoding = "UTF-8"?> <xsd:schema elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
by: CindyRob | last post by:
Using .NET framework 1.1 SP1, .NET framework SDK 1.1 SP1, Visual Studio .NET 2003, hotfixes 892202 and 823639. I create a proxy class using wsdl.exe, and in the serialized XML request, I see that any elements that are nested elements in the schema (not global elements) have their namespaces set to the null namespace. I can see that the proxy classes have serialization attributes specifying these nested elements as unqualified: ///...
by: filip.norrgard | last post by:
Hi All! I've been developing an ASP.Net 2.0 web application using the Visual Studio 2005 tools. Currently datagrids on a page are filled with data from a dataset (a .xsd file in the "project") that, in turn, gets the data from MySql server. Locally testing it on my PC (Windows XP SP2, FYI) it works and no errors appear. However, when I upload it to the webserver (Windows 2003 Web Edit. Server) I get the a parser error on the dataset...
by: Bobby Edward | last post by:
Using ASP.NET 3.5 and MySQL (thru DevArt MyDirect.NET)... On the production server I get a "Parser Error" for every XSD dataset. It works perfect on my dev machine. But, on the production server I get the error. To troubleshoot the issue I went back to my dev machine and changed all the connectionstrings from localhost to the remote/production server db and made sure everything works fine. I then uploaded all the files to the...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.