CS0-003 · Question #530
The SOC receives a number of complaints regarding a recent uptick in desktop error messages that are associated with workstation access to an internal web application. An analyst, identifying a…
The correct answer is B. <xs:element name="firstIntro"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:pattern value="[a-zA-Z 0-9]*"/> </xs:restriction> </xs:simpleType> </xs:element>. Option B is correct because it defines an XML schema restriction on the 'firstIntro' element using a pattern that allows alphanumeric characters and spaces ([a-zA-Z 0-9]*), which is the most permissive and broadly applicable validation pattern for a typical web application…
Question
The SOC receives a number of complaints regarding a recent uptick in desktop error messages that are associated with workstation access to an internal web application. An analyst, identifying a recently modified XML file on the web server, retrieves a copy of this file for review, which contains the following code:
Which of the following XML schema constraints would stop these desktop error messages from appearing? A. B. C. D.
Exhibits
Options
- A<xs:element name="firstIntro"> xs:simpleType <xs:restriction base="xs:token"> <xs:pattern value="[0-9]{3}-[0-9]{2}-[0-9]{4}"/> </xs:restriction> </xs:simpleType> </xs:element>
- B<xs:element name="firstIntro"> xs:simpleType <xs:restriction base="xs:string"> <xs:pattern value="[a-zA-Z 0-9]*"/> </xs:restriction> </xs:simpleType> </xs:element>
- C<xs:element name="firstIntro"> xs:simpleType <xs:restriction base="xs:string"> <xs:pattern value="[0-9]*"/> </xs:restriction> </xs:simpleType> </xs:element>
- D<xs:element name="firstIntro"> xs:simpleType <xs:restriction base="xs:positiveInteger"/> <xs:pattern value="[0-9]"/> </xs:restriction> </xs:simpleType> </xs:element>
How the community answered
(29 responses)- A10% (3)
- B62% (18)
- C21% (6)
- D7% (2)
Explanation
Option B is correct because it defines an XML schema restriction on the 'firstIntro' element using a pattern that allows alphanumeric characters and spaces ([a-zA-Z 0-9]*), which is the most permissive and broadly applicable validation pattern for a typical web application input field like a name or introduction field. This constraint ensures that only safe, expected characters are accepted, preventing malformed or malicious input that could cause desktop error messages when the XML is parsed. By enforcing input validation at the schema level, the application receives well-formed data that it can process without generating errors.
Topics
Community Discussion
No community discussion yet for this question.




