I asked elsewhere about getting at the schema at run-time. Greg answered:
quote:
You cannot directly access the live schema. You can however load the schema for reference purposes. You will be working with a local copy of the schema and so any changes you make will not be affecting your form... but this is a good thing as changing your schema live would likely have disasterous results.
Here's the code to get access to you schema file. One you have it loaded you can access it just as you would any other DOM.
oMySchema = new ActiveXObject("msxml2.DOMDocument.3.0");
oMySchema.async = false;
oMySchema.load("mySchema.xsd");
I am now revisiting this. I am fine with the principle of the answer. But I have two questions:
1. My db does datetimes in UTC. I want IP to convert to/from localtime on output/input. I plan to do this by converting all datetimes when queried and back when submitted. (I don't really want to discuss this bit --- I think I know what I need to do.) I think this seems doable in principle? So I need to identify all datetimes at runtime. I do not think this can be done from the info in the DOM?
2. So I need to *read* the schema; then I can figure it. But, I don't understand all the XSDs involved. For example, loading my "mySchema.xsd" (as per suggestion) does not seem enough: it has stuff in it like:
<xsd:import schemaLocation="schema3.xsd" namespace="http://www.tempuri.org/DataSetIC.xsd"/>
Loading "mySchema.xsd" does not seem to "do" the "import"? If I load "schema3.xsd" I seem to get what I want. But how do I know which file this will be (I keep developing)? I want the schema for "DataSetIC"; what's a robust way to identify the file or get that schema (e.g. can I force the "import" to happen from "mySchema.xsd")?
I know this is tricky, but I don't see any alternative...