Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - RE: RE: RE: RE: unique question >Thread Next - Is a token element with a carriage return, or leading/trailing spaces, valid? Re: RE: RE: RE: RE: unique questionTo: "Michael Kay" <mike@--------.--->, xmlschema-dev@--.--- Date: 2/15/2007 1:04:00 PM Hi Michael! Thanks for your explanation! Please allow me one more question. I have now the following schema definition: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" targetNamespace="http://www.xyz.com" xmlns="http://www.xyz.com" xmlns:x="http://www.xyz.com"> The xmlns:x namespace is only used for the xs:unique. When I create an example xml from the schema with XMLSpy">XMLSpy all the created elements have the namespace prefix x attached. <x:root xsi:schemaLocation="http://www.xyz.com mg_ns.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="http://www.xyz.com"> Can I avoid this? I just want to use the default namespace in my xml file! Thanks Markus -------- Original-Nachricht -------- Datum: Thu, 15 Feb 2007 10:30:40 -0000 Von: "Michael Kay" <mike@s...> An: "\'Markus Gamperl\'" <markus.gamperl@g...>, xmlschema-dev@w... CC: Betreff: RE: RE: RE: RE: unique question > > > > > But why isn't the default namespace enough within xs:unique? > > Is this the definition of xs:unique? What's the sense of the > > default namespace... > > For better or worse, the XPath 1.0 specification states that an unprefixed > name in a path expression represents a name in no namespace, regardless of > any default namespace that might be in scope. > > The original motivation for this, I think, was the scenario where XPath is > embedded within XSLT and the default namespace for the source document is > different from that for the result document. But like everything else to > do > with namespaces, it has tripped a lot of people up over the years. > > XPath 2.0 makes the default namespace for unprefixed element names > something > that can be defined in the context, so XML Schema could, if it wished, say > that it is taken from the default namespace of the enclosing element. > > Michael Kay > http://www.saxonica.com/ > -- Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten Browser-Versionen downloaden: http://www.gmx.net/de/go/browser From mike@s... Thu Feb 15 12:03:57 2007 Received: from aji.w3.org ([133.27.228. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
