Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: elementFormDefault

From: "Pete Cordell" <petexmldev@---------.--->
To: "Michael Kay" <mike@--------.--->, "'Kresimir Karamazen'"
Date: 10/27/2008 4:47:00 PM
Since Kresimir described both elementFormDefault qualified and unqualified 
in his original post I think its worth clarifying that the case Michael 
described is when elementFormDefault="qualified".

Note that an elements 'form' attribute can override the value of 
elementFormDefault for that element, so it's not totally down to the value 
of elementFormDefault.  That said I don't think I've ever seen the 'form' 
attribute used.

HTH,

Pete Cordell
Codalogic Ltd
Interface XML to C++ the easy way using XML C++
data binding to convert XSD schemas to C++ classes.
Visit http://www.codalogic.com/lmx/ for more info

----- Original Message ----- 
From: "Michael Kay" <mike@s...>
To: "'Kresimir Karamazen'" <k.karamazen@t...>; <xmlschema-dev@w...>
Sent: Monday, October 27, 2008 4:10 PM
Subject: RE: elementFormDefault





I think you've grasped it, but your terminology isn't quite right.

Firstly, it's all to do with whether or not the element is in a namespace,
which isn't quite the same as whether or not it has a prefix. An element
name with no prefix can still be in a namespace.

The rule is this. If the schema contains

 <xs:element name="x"/>

as a local element declaration (that is, not a child of <xs:schema>), then
the element must be in the target namesapce of the containing schema
document, if there is one. For example, if the target namespace is
http://target.com/, then the element might validly appear as

  <x xmlns="http://target.com/"/>

or

  <ppp:x xmlns:ppp="http://target.com/"/>

Of course the namespace declaration does not have to be on the <x> element
itself, it can be on any ancestor.

If the schema document does not have a target namespace, then it doesn't
matter whether the element form is qualified or unqualified.

Michael Kay
http://www.saxonica.com/


> -----Original Message-----
> From: xmlschema-dev-request@w...
> [mailto:xmlschema-dev-request@w...] On Behalf Of Kresimir Karamazen
> Sent: 27 October 2008 10:24
> To: xmlschema-dev@w...
> Subject: elementFormDefault
>
>
>
> To be able to understand clearly the meaning of
> elementFormDefault I have written a short reminder.
> Could you please tell me if the following doesn't hold true?
>
> When we have
>
> elementFormDefault="qualified"
>
> in some scope then in the scope: a locally declared element
> elm1 must appear with a prefix (i.e. pre:elm1) or otherwise
> it must be implicitly in a namespace of the parent element.
> This means that a locally declared element elm1 in such a
> scope (and unless it is used as a root element, what is
> anyway not the intention) will never violate the "qualified"
> restriction because if it does not have a prefix than it has
> an implicit namespace of the parent (which (namespace of the
> parent) may be empty). However it can happen that the
> instance does not validate if the elm1 has not been declared
> in that namespace.
>
> When we have
>
> elementFormDefault="unqualified"
>
> in some scope then in the scope: a locally declared element
> elm1 is not allowed to appear with a prefix (i.e. unallowed
> is pre:elm1) .
>
>
>
> ______________________________________________________________
> __________
>
> K.Karamazen
> Trinité Automatisering B.V.
> Post-adres:  Postbus 189, 1420 AD Uithoorn
> Bezoek-adres: J.N. Wagenaarweg 6, 1422 AK Uithoorn Tel. : 0297 382460
>
> Fax : 0297 273049
> Email: kk@t...
> Website: www.trinite.nl
>
>
>







transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent