Validating userId with XML Schema

Tureorbisse

New Member
Is it possible to validate the userId inside job_position to match only the values provided in "person" elements using XML Schema?\[code\]<person id="1"><firstName>Jo</firstName><lastName>Smi</lastName></person><person id="2"><firstName>John</firstName><lastName>Smith</lastName></person> <job_position> <userId>1</userId> <!-- This is valid --> <position>Manager</position></job_position><job_position> <userId>2</userId> <!-- This is valid --> <position>Programmer</position></job_position><job_position> <userId>3</userId> <!-- This is Invalid --> <position>Systems Analyst</position></job_position>\[/code\]
 
Back
Top