make xsd schema validate this xml

admin

Administrator
Staff member
In the following XML I want to require the USER and SEARCH_KEY nodes, but not the TRANSACTION_DATA or SEARCH_RESULT nodes. I am having trouble building an XSD schema that will do this without any side effects:



<XYZ_TRANSACTION>

<USER>
<USER_ID>testuser</USER_ID>
<PASSWORD>testpassword</PASSWORD>
</USER>

<TRANSACTION_DATA>
<TRANSACTION_ID>999</TRANSACTION_ID>
<TRANSACTION_DATE>02/23/2004</TRANSACTION_DATE>
</TRANSACTION_DATA>

<SEARCH_KEY>
<ID_NUMBER>123456789</ID_NUMBER>
</SEARCH_KEY>

<SEARCH_RESULT>
<STREETA>123 MAIN STREET</STREETA>
<CITY>NEW YORK</CITY>
<ZIP_CODE>10030</ZIP_CODE>
</SEARCH_RESULT>

</XYZ_TRANSACTION>
 
Back
Top