You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Jesus M. Salvo Jr." <je...@migasia.com> on 2003/02/20 01:06:18 UTC

Schema validation question again

Using Xerces 2.2.1, why is it that this one validates correctly against 
the SOAP 1.1 schema
( Schema definition available at 
http://schemas.xmlsoap.org/soap/envelope/ ):

<?xml version="1.0"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
      <env:Header>
        <mm7:TransactionID 
xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2" 
env:mustUnderstand="1">
            vas00324-dlvr
        </mm7:TransactionID>
    </env:Header>
    <env:Body>
       <env:Fault>
            <faultcode>env:Client</faultcode>
            <faultstring>Client error</faultstring>
            <faultactor></faultactor>
            <detail><Sample/></detail>
        </env:Fault>
    </env:Body>
</env:Envelope>

What I mean is that ... shouldn't faultcore, faultstring, and faultactor 
have the "env" prefix to indicate that they belong to the SOAP namespace?

If I do add the env prefix to faultcore, faultstring, and faultactor ... 
Xerces then complains that:

Error: URI=null Line=10: cvc-complex-type.2.4.a: Invalid content 
starting with element 'env:faultcode'. The content must match 
'(("":faultcode),("":faultstring),("":faultactor){0-1},("":detail){0-1})'.

Is my understanding of namespaces again wrong?

Here is the definition for Fault from the SOAP schema:

  <xs:element name="Fault" type="tns:Fault" />
  <xs:complexType name="Fault" final="extension" >
    <xs:annotation>
      <xs:documentation>
        Fault reporting structure
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="faultcode" type="xs:QName" />
      <xs:element name="faultstring" type="xs:string" />
      <xs:element name="faultactor" type="xs:anyURI" minOccurs="0" />
      <xs:element name="detail" type="tns:detail" minOccurs="0" />     
    </xs:sequence>
  </xs:complexType>









---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Schema validation question again

Posted by "Jesus M. Salvo Jr." <je...@migasia.com>.
Jeff,

Thanks for the explanation.

John


Jeff Greif wrote:

>the schema does not mention the attribute elementFormDefault, so the
>elements are unqualified.  This means that the global elements (elements
>whose declarations are children of the schema element) are in the target
>namespace, while local elements (defined within complex types) are in no
>namespace.
>Jeff
>----- Original Message -----
>From: "Jesus M. Salvo Jr." <je...@migasia.com>
>To: "Xerces mailing list" <xe...@xml.apache.org>
>Sent: Wednesday, February 19, 2003 4:06 PM
>Subject: Schema validation question again
>...
>  
>
>>What I mean is that ... shouldn't faultcore, faultstring, and faultactor
>>have the "env" prefix to indicate that they belong to the SOAP namespace?
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Schema validation question again

Posted by Jeff Greif <jg...@alumni.princeton.edu>.
the schema does not mention the attribute elementFormDefault, so the
elements are unqualified.  This means that the global elements (elements
whose declarations are children of the schema element) are in the target
namespace, while local elements (defined within complex types) are in no
namespace.
Jeff
----- Original Message -----
From: "Jesus M. Salvo Jr." <je...@migasia.com>
To: "Xerces mailing list" <xe...@xml.apache.org>
Sent: Wednesday, February 19, 2003 4:06 PM
Subject: Schema validation question again
...
> What I mean is that ... shouldn't faultcore, faultstring, and faultactor
> have the "env" prefix to indicate that they belong to the SOAP namespace?


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org