I have DB tables stored in XML format that have a FK based on two columns (Table2 has FK to Table1 based on ID and TYPE).
Table1.xml
<Table>
<Row>
<ID>1</ID>
<TYPE>A</TYPE>
<CONFIG>Y</CONFIG>
...
</Row>
<Row>
<ID>2</ID>
<TYPE>A</TYPE>
<CONFIG>Z</CONFIG>
...
</Row>
<Row>
<ID>1</ID>
<TYPE>B</TYPE>
<CONFIG>X</CONFIG>
...
</Row>
<Row>
<ID>3</ID>
<TYPE>A</TYPE>
<CONFIG>Z</CONFIG>
...
</Row>
</Table>
Table2.xml
<Table>
<Row>
<ID>1</ID>
<TYPE>A</TYPE>
...
</Row>
<Row>
<ID>2</ID>
<TYPE>A</TYPE>
...
</Row>
<Row>
<ID>1</ID>
<TYPE>B</TYPE>
...
</Row>
<Row>
<ID>3</ID>
<TYPE>A</TYPE>
...
</Row>
</Table>
I will have two XSLT files to delete rows in each XML file. Table2 will be processed first. I want to delete the row in Table2 where when joined with Table1 CONFIG=Z (ie, delete rows where (ID=2 and Type=A) and (ID=3 and Type=A), but I need to figure this out only knowing I want to delete records where CONFIG=Z). Table1 will then be processed to delete rows where CONFIG=Z, which I was able to figure out.
I think the XSLT that will be applied to Table2 needs to read in Table1 XML (xsl:variable name="table1Rows" select="document('Table1.xml')/Table/Row"/>). After that I'm lost on how to delete rows in Table2 where CONFIG=Z. I've tried several things based on examples I saw, but couldn't get anything to work.