Senior
What is an XSD schema? Provide an example of an XML message that satisfies this schema (schema: root element Limit with fields userId and currency of type string).
sobes.tech AI
Answer from AI
XSD (XML Schema Definition) is a language for describing the structure of XML documents, which allows defining what elements and attributes can appear in XML, their types, and order.
Example of an XSD schema for the root element Limit with fields userId and currency of type string:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Limit">
<xs:complexType>
<xs:sequence>
<xs:element name="userId" type="xs:string"/>
<xs:element name="currency" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Example of an XML message that conforms to this schema:
<Limit>
<userId>user123</userId>
<currency>USD</currency>
</Limit>