Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - elementFormDefault [Thread Next] RE: elementFormDefaultTo: "'Kresimir Karamazen'" <k.karamazen@-------.-->, <xmlschema-dev@--.---> Date: 10/27/2008 4:12:00 PM 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 > > > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
