logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: Validation error on prefixed attribute: msg#00081

Subject: Re: Validation error on prefixed attribute
Vincent Figari wrote:

Hello Panos,

Sorry may be I did not provide enough info:
With my example, Xerces has schema validation enabled,
and Xerces parser is initialized with a .xsd defining an element named "elem" having an attribute named "attr"
in a namespace whose URI is "some-uri".

<pr:elem attr="value" xmlns:pr="some-uri" />
will be parsed succesfully by Xerces, but:

<pr:elem pr:attr="value" xmlns:pr="some-uri" />
will cause Xerces to throw:
Fatal: cvc-complex-type.3.2.2: Attribute "pr:attr" is not allowed to appear in element 
"pr:elem"

Although unusual, this still looks valid xml to me ?

But it probably isn't. A "local" attribute does not belong to any namespace. For both examples to be valid, the element would have to have an attribute named attr and there would have to be a global attribute in the namespace (defined at the top level) named attr.

Bob Foster
http://xmlbuddy.com/


<Prev in Thread] Current Thread [Next in Thread>