[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Problems using XML Schema validated input document with X
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@b...] Sent: Friday, November 08, 2002 11:42 AM To: list@a...; xml-dev@l... Subject: Re: 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|