[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Hiding namespace prefixes in the instance document

From: Michael Kay <mike@saxonica.com>
Date: Wed, 4 Jan 2006 14:31:33 -0000
To: "'Antti Sissonen'" <antti_sissonen@hotmail.com>, <xmlschema-dev@w3.org>
Message-ID: <E1Eu9fz-0007fy-I6@maggie.w3.org>
chameleon namespace instance document

As George says, you need to concentrate on deciding which namespace the
elements are in; prefixes are purely cosmetic.

I think it's best when using schemas, in general, to use namespaces and
stick to them. I'm no fan of chameleon includes or redefines, they only lead
to confusion in the long run. You quickly find yourself having to write
transformations to move documents into and out of namespaces and it just
gets more and more messy.

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

> -----Original Message-----
> From: Antti Sissonen [mailto:antti_sissonen@hotmail.com] 
> Sent: 04 January 2006 11:45
> To: mike@saxonica.com; xmlschema-dev@w3.org
> Subject: RE: Hiding namespace prefixes in the instance document
> 
> 
> What I meant was not having namespace prefixes in the 
> instance document 
> since in this particular case the xml instance presents 
> business content and 
> the element naming should be exact.
> So if I am using a common element coming from a common 
> component schema it 
> should look like this:
> <Schema>
>   <Aggregate>
>     <MaterialBatchIdentifier>
>     ...
> 
> instead of:
> <Schema>
>   <Aggregate>
>     <common:MaterialBatchIdentifier>
> 
> Does that help?
> 
> I've understood that I can get rid of prefixes by using the 
> correct design 
> (venetian blind) and the default namespace definition 
> (xmlns="foo", not 
> xmlns:foo="foo") if only one namespace is declared for the 
> instance. But 
> then if I'd like to have a separate namespace for the common 
> components I 
> run out of options. Thus, I've concluded that maybe I just 
> have to have 
> common component schema in no namespace and use include to 
> have it available 
> (chameleon).
> If the idea of the schema architecture is to assure that the 
> same name will 
> not be used for different things the chameleon design would 
> support/force 
> it. What is it that I'd lose if I switch from import to include?
> 
> Rgrds,
> 
> Antti
> 
> >
> > > I have a schema that imports another one. I'm trying to keep
> > > the namespace
> > > prefixes hidden in the xml instance
> >
> >Sorry, I've no idea what you mean. What does a "hidden 
> prefix" look like?
> >
> >Michael Kay
> >http://www.saxonica.com/
> >
> >
> 
> 
> 
Received on Wednesday, 4 January 2006 14:31:46 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.