Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: RE: RE: RE: RE: unique question

From: "Markus Gamperl" <markus.gamperl@---.-->
To: "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.


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