← Prev in month ← Prev in thread
Next in thread → Next in month →

XSD keyref help

From
Eric Dalquist <>
To
Date
2005-03-25T21:59:15Z
ID
<>
Thread
XSD keyref help
I'm working on an XSD and may have run into something that isn't 
possible with my current data format.

In the attached tables.xml I have something along the following lines:

    <table>
        <name>UP_TABLE_A</name>
        <columns>
            <column>
                <name>AID</name><type>INTEGER</type>
                <desc>generated id</desc>
            </column>
        </columns>
        <primary-key>AID</primary-key>
    </table>
   
    <table>
        <name>UP_TABLE_B</name>
        <desc>Holds portlet definitions</desc>
        <columns>
            <column>
                <name>BID</name><type>INTEGER</type>
                <desc>generated</desc>
            </column>
            <column>
                <name>AID_FK</name><type>INTEGER</type>
                <desc>foreign key from TABLE_A</desc>
            </column>
            <column>
                <name>MISC</name><type>VARCHAR</type><param>255</param>
            </column>
        </columns>
        <primary-key>ID</primary-key>
        
<foreign-key><column>AID_FK</column><ref-table>UP_TABLE_A</ref-table><ref-column>AID</ref-column></foreign-key>
    </table>


I have constraints in the XSD to ensure that references to other 
elements, such as the primary-key are valid. The one I haven't figured 
out how to do yet is to ensure the ref-column is correct. The constraint 
is that the value ref-column must be a column name in the table 
specified by ref-table.

I've attached my current XML and XSD if they'll help.

Let me know if there is a way to do this or if I just can't do it.

Thank you,
    Eric Dalquist
← Prev in month ← Prev in thread
Next in thread → Next in month →