XSD restriction based on xml content

Boncho

New Member
I'm new to XSD / XMl and was trying create a template for an xml file used in a project that I work with. The schema will be used by a couple of co-workers within visual studio and my main goal is to have the error checking and auto-complete features.There is, however, one feature of my xml template that I would like to have on the XSD, but I don't know if that is possible. I think it isn't, but I just want to make sure.Basically, the xml would look like this: \[code\]<root> <parameters> <parameter name="@param1"/> <parameter name="@param2"/> <parameter name="@param3"/> </parameters> <test> <parameter_value parameter_name="@param1" value="http://stackoverflow.com/questions/11364485/whatever"/> <parameter_value parameter_name="@param2" value="http://stackoverflow.com/questions/11364485/whatever"/> </text></root>\[/code\]The idea is that first the user "defines" the parameters, and then he assigns them values within a specific test. My question is weather or not I can define a restriction on the "parameter_name" attribute so that only declared parameters in this specific xml can be entered. Is this possible?Best regards Carlos Jourdan
 
Back
Top