W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2004

Re: Namespace problem

From: Mik Lernout <mik@futurestreet.org>
Date: Wed, 18 Aug 2004 11:06:25 +0200
Message-ID: <41231C11.6030601@futurestreet.org>
To: Burak Emir <Burak.Emir@epfl.ch>
CC: Volker.Zink@porabo.ch, xmlschema-dev@w3.org

Er... correct me if I am wrong but this prefix-in-attributes-thingie is 
not really related to XMLSchema but rather to XML.

The basic idea is that in any location in an XML file there is always a 
namespace context: a mapping of prefixes to namespaces. The usage of 
this mapping in element names or in attribute names/values does not 
really matter. Even the actual value of the prefix is not really 
important, it is what namespace it represents in that specific spot of 
the XML file....

Mik

PS: You mentioned that you are working on schema validator, in which 
language is it and is it open source? I am also doing one in java and 
maybe we could merge some work...


Burak Emir wrote:

>
> Hello Volker,
>
> 1. which parser are you using? Is it possible that is has 
> namespace-support disabled?
>
> 2. [unsure] does it work when you remove the "plem:" prefix from the 
> schema (both in root and in the type="plem:" attribute) ?
>
> I am implementing a schema validator myself, and I stubbed my toe on a 
> similar thing. The fact is, common sense would suggest namespaces make 
> element names unique by adding the URI to them. It would then be ok to 
> forget the namespace prefixes, representing element names as {uri:name}.
>
> Unfortunately, in XML schema this is not the entire truth - one has to 
> remember also the prefixes, because they appear in attribute values. I 
> consider this a real shortcoming of the XML schema definition language 
> - it is counter-intuitive, because one is forced to mix the structure 
> of the definition (a declaration xmlns:foo="..." in the root element 
> <schema ...>) with the structure of the instances (as in type="foo:...").
>
> Since there is no element "plem:...", it could be that your software 
> just "forgot" about that prefix, and defaulted it to "" - in any case, 
> a bug.
>
> cheers,
> Burak
>
> Volker Zink wrote:
>
>> when validating (strict) the included XML-document versus the 
>> included schema i get following error (its the only error):
>>
>> Invalid per cvc-complex-type.1.2.4:
>>   element {grips://xml.recom-verlag.de/comm/plem}:fallImportExport 
>> not allowed here (1) in element 
>> {grips://xml.recom-verlag.de/comm/plem}:fallInterface, expecting 
>> [{None}:fallImportExport]:
>>
>> I think by setting the targetNamespace in the schema, the elements 
>> and types are in the namespace 
>> "grips://xml.recom-verlag.de/comm/plem", so why is the namespace 
>> 'None' expected (and whats the meaning of the []-brackets)?
>>
>> Thanks
>>
>> Volker Zink
>
>
> <snip/>
>
>
Received on Wednesday, 18 August 2004 09:06:41 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:15:10 UTC