OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Problems using XML Schema validated input document with X

[ Lists Home | Date Index | Thread Index ]

I do not believe that is correct.  Attributes, unless specifically
qualified, belong to no namespace, even the default.
An attribute can appear in a different namespace than the element that
contains it. For example, <movie:title xml:lang="fr"> has an attribute that
is not from the movie namespace. If an attribute name has a prefix, its name
is in the namespace indicated by the prefix. However, if an attribute name
has no prefix, it has no namespace. This is true even when the default
namespace has been assigned. The W3C Namespaces in XML Recommendation makes
that point with this example:
[PARA]<x xmlns="http://www.w3.org"; xmlns:n1="http://www.w3.org";>[PARA]
<good a="1" n1:a="2" />[PARA]</x>
From http://www-106.ibm.com/developerworks/library/x-nmspace.html 


-----Original Message-----
From: Chiusano Joseph [mailto:chiusano_joseph@bah.com]
Sent: Friday, November 08, 2002 11:42 AM
To: list@adamvandenhoven.com; xml-dev@lists.xml.org
Subject: Re: [xml-dev] Problems using XML Schema validated input document
with Xerces

Adam,

Without seeing the pertinent portion of your schema it's difficult to
definitively say what the problem may be...however, I'd be happy to
offer a tip. 

Unless attributes are namespace-qualified, they belong to the same
namespace as the element with which they are associated.  That is, an
attribute will never be included in a default namespace, even if its
associated element belongs to the default namespace of the schema.  The
fact that you noted that "the namespace seems to be wrong" indicates
that you might want to verify that your expectation of what the
namespace should be is correct.

Hope that helps,
Joe Chiusano
Booz | Allen | Hamilton




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS