Title: XML Schema Validation Error

If I understand the meaing of ##any and ##other correctly:

technically  namespace="##any"   stands for any namespace at all

having namespace="##other" stands for any namespace other than the target namespace - unless used in a schema without a traget namespace in which case all namespaces are allowed and only attributes without a namespace is forbidden.

The schema you speak of that defines the Header element has a targetNamespace speicified

  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
             xmlns:tns="http://www.w3.org/2001/09/soap-envelope"
             targetNamespace="http://www.w3.org/2001/09/soap-envelope">

your actor attribute is not allowed to be in that namespace according to the schema.

hope this helps

Dave Flanagan

  ----- Original Message -----
Sent: Tuesday, August 26, 2003 3:12 PM
Subject: XML Schema Validation Error

Hi,
   I am using Xerces Schema Cache. http://xml.apache.org/xerces2-j/faq-grammars.html

I am using the attached SOAP envelope schema to validate my xml file which has  'actor' and 'mustUnderstand' attributes in the SOAP header.

Given below is the sample XML which i am trying to validate

<env:Envelope xmlns:env="http://www.w3.org/2001/09/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

        <env:Header env:actor="https://www.xmlswitch.net" env:mustUnderstand="1">
        </env:Header>
        <env:Body>
        </env:Body>
</env:Envelope>


I am getting the following error when i try to validate the above XML with the cached soap-envelope schema.

[Error] file1.xml:2:75: cvc-complex-type.3.2.2: Attribute 'env:actor' is not allowed to appear in element 'env:Header'.
[Error] file1.xml:2:75: cvc-complex-type.3.2.2: Attribute 'env:mustUnderstand' is not allowed to appear in element 'env:Header'.

The Header element in SOAP envelope is defined as following. So i should be able to use any attribute in my header. Then what am i doing wrong?


<xs:element name="Header" type="tns:Header"/>
        <xs:complexType name="Header">
                <xs:sequence>
                        <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:anyAttribute namespace="##other" processContents="lax"/>
        </xs:complexType>


regards,
Mukulika Kapas


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to