Forum Discussion
ASM XSD validation and `choice` element
Hi,
we have an issue with XSD validation.
choice
element doesn't work like expected by the W3C specification (https://www.w3schools.com/xml/el_choice.asp😞
Ex:
1. Success
[...]
0
[...]
2. Success !! Why?
[...]
0
0
[...]
We tried many other options (Changing/removing minOccurs
, maxOccurs
and type
attributes), the ASM xml choice
element's validation behavior appears to be the same as below:
Ex:
1. Success Choice?
[...]
0
0
[...]
2. Blocked Choice?
[...]
0
0
0
[...]
Can someone confirm the point?
Is it possible to find the version of the XSD schema standard that the ASM validate (BigIP 12.1.2)?
thanks,
JSC- Daniel_Varela
Employee
what are your blocking settings? Do you see any alarms in your event viewer? Remember to link the xml content profile to the URL/paramenter.
- JSC
Nimbostratus
Hi Daniel,
ASM is successfully blocking requests regarding the XSD except for the above
element.choice
Alarms are available under "Event logs" however for the choice condition, status is always "Legal Request" while we would expect "XML data does not comply with schema or WSDL document"...
Note: I add few more samples above
- Daniel_Varela
Employee
Maybe the min and max ocurrences are per element? try to set a minoccurs to 1 and verify that in your firt example [...] 0[...] the request is blocked.
- JSC
Nimbostratus
Well, i tried it with no more success. - Ex 1 (Note: results same if no attribute
is specified) :minOccurs
-
Blocked
[...]
[...]
-
Success
[...]
0
[...]
-
Success
[...]
0
0
[...]
-
Blocked
[...]
0
0
[...]
- Ex 2:
-
Blocked
[...]
[...]
-
Success
[...]
0
[...]
-
Success
[...]
0
0
[...]
-
Success
[...]
0
0
0
[...]
-
Blocked
[...]
0
0
0
0
[...]
-
- JSC
Nimbostratus
You are right about minOccurs and maxOccurs:
*maxOccurs: Optional. Specifies the maximum number of times the choice element can occur in the parent element. The value can be any number >= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1
minOccurs: Optional. Specifies the minimum number of times the choice element can occur in the parent the element. The value can be any number >= 0. Default value is 1*
However, the choice element doesn't work better if no attributes are specified:
==> same result as with attributeminOccurs="1"
- Daniel_Varela
Employee
JSC, then is it working as expected? As I understand it, in your last example
The ASM must accept a total of one each element and block anything different as min and max are 1.
- JSC
Nimbostratus
Regarding the w3c standard, we expect below behavior: XML Schema choice element allows only one of the elements contained in the
declaration to be present within the containing element.choice
Which is not what we got. SoapUI report the non compliancy, BigIP ASM doesn't...
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com