Schematron Pretty

Schema for SOAP 1.1

xmlns:soap-env= "http://schemas.xmlsoap.org/soap/envelope/"

This schema has (most of) the MUST conditions required of a SOAP document. v.0.3 2000-10-21 Rick Jelliffe, Francis Norton

     Pattern           

For documentation, please refer to http://www.w3.org/TR/SOAP/

     Rule elementDefinition  
/*
     Assert topElement  
/soap-env:Envelope The Envelope is the top element of the XML document representing the message.
     Assert occurrence  
//soap-env:Envelope The element MUST be present in a SOAP message
     Report contents  
string-length(namespace::*) = 0 The <name path=""/> element MAY contain additional sub elements. If present these elements MUST be namespace-qualified.
     Rule elementDefinition  
soap-env:Header
     Assert occurrence  
parent::soap-env:Envelope and (count(preceding-sibling::*) = 0) The <name path=""/> element MAY be present in a SOAP message. If present, the element MUST be the first immediate child element of a SOAP Envelope element.
     Report contents  
string-length(namespace::*) = 0 All immediate child elements of the SOAP Header element MUST be namespace-qualified.
     Rule elementDefinition  
soap-env:Body
     Assert occurrence  
parent::soap-env:Envelope and (count(preceding-sibling::*) = 0 or (count(preceding-sibling::*) =1 and preceding-sibling::soap-env:Header)) The <name path=""/> element MUST be present in a SOAP message and MUST be an immediate child element of a SOAP Envelope element. It MUST directly follow the SOAP Header element if present. Otherwise it MUST be the first immediate child element of the SOAP Envelope element.
     Assert contents  
count(soap-env:Body) < 2 The SOAP Fault element MUST NOT appear more than once within a Body element.
     Rule elementDefinition  
soap-env:Fault
     Assert occurrence  
parent::soap-env:Body The SOAP Fault element MUST appear as a body entry.
     Assert contents  
parent::soap-env:faultcode The faultcode MUST be present in a SOAP Fault element
     Assert contents  
parent::soap-env:faultstring The faultstring MUST be present in a SOAP Fault element
     Report contents  
string-length(namespace::*) = 0 The <name path=""/> element MAY contain additional sub elements. If present these elements MUST be namespace-qualified.
     Assert contents  
(../../soap-env:Header/*[@actor]) and faultfactor Applications that do not act as the ultimate destination of the SOAP message MUST include the faultactor element in a SOAP Fault element. (Omitting the SOAP actor attribute indicates that the recipient is the ultimate destination of the SOAP message.)
     Rule elementDefinition  
faultcode
     Assert occurrence  
parent::soap-env:Fault The faultcode element is intended for use by software to provide an algorithmic mechanism for identifying the fault. The faultcode MUST be present in a SOAP Fault element
     Assert contents  
string-length(.) > 0 The faultcode value MUST be a qualified name.
     Rule elementDefinition  
faultstring
     Assert occurrence  
parent::soap-env:Fault The faultstring element is intended to provide a human readable explanation of the fault and is not intended for algorithmic processing. The faultstring MUST be present in a SOAP Fault element
     Assert contents  
string-length(.) > 0 The faultstring SHOULD provide some information explaining the nature of the fault.
     Rule elementDefinition  
faultfactor
     Assert occurrence  
parent::soap-env:Fault The faultactor element is intended to provide information about who caused the fault to happen within the message path. The faultfactor MAY be present in a SOAP Fault element
     Assert contents  
string-length(.) > 0 The value of the faultfactor attribute is a URI identifying the source.
     Rule elementDefinition  
detail
     Assert occurrence  
parent::soap-env:Fault The detail element is intended for carrying application specific error information related to the Body element. The detail MAY be present in a SOAP Fault element
     Report contents  
string-length(namespace::*) = 0 The <name path=""/> element MAY contain additional sub elements. If present these elements MUST be namespace-qualified.



     Pattern           

     Rule attributeDefinition  
*[@soap-env:mustUnderstand]
     Assert occurrence  
parent::soap-env:Header The recipient of a SOAP message MUST ignore all mustUnderstand attributes that are not applied to an immediate child element of the SOAP Header element.
     Assert contents  
( @soap-env:mustUnderstand = 1) or (@soap-env:mustUnderstand = 0) The value of the mustUnderstand attribute is either "1" or "0"



     Pattern           

     Rule attributeDefinition  
*[@soap-env:actor]
     Assert occurrence  
parent::soap-env:Header The recipient of a SOAP message MUST ignore all actor attributes that are not applied to an immediate child element of the SOAP Header element.




Schematron Pretty by Rick Jelliffe. The Schematron by Rick Jelliffe, Academia Sinica Computing Centre.