Mmm, this one is quite hard to explain (or maybe its just me) so I hope this means something to you.
Is it possible to implement a C++/Java class type structure in XML / XSD?
public class Pump
private decimal minFlowRate = 2, maxFlowRate = 9.3;
private int maxRuntime = 4800 ;
private string name ;
So I can create a distinct collection of pumps in such a way that I can use the pump's name either as an attribute's value, or an an attribute itself within an XML document, and use the other information like the min and max flowrates to apply constraints.
So for brevity let's assume I have 100 pumps and they're called P001 to P100. I would like a schema to be able to say :
<pump name="P024" flowRate="20.2" runTime="234" ... />
<pump name="P044" flowRate="7.89" runTime="1" ... />
is valid as is :
<flowRates P1024="34" P1044="22.2" ... />
<runTime P1024="234" P1044="77" ... />
I would also like to apply constraints on these pumps in a similar manner. For example I want to ensure that the pump hasn't been running for more the X hours. This X value being different for each pump.
So if this :
<pump name="P024" flowRate="20.2" runTime="234" .../>
<pump name="P033" flowRate="5.0" runTime="77" ... />
appears in the XML my application can check using the schema that P033 only has 3 more hours of continuous running time remaining, but P024 is good for another 66.
Or do I need to wake up?