I am mocking some data access with xml files that I generate from T-sql like:
SELECT * FROM dbo.my_table FOR XML AUTO, XMLSCHEMA
This generates a working file because the xsd at schemaLocation
is hosted online:
<xsd:schema targetNamespace="mydata" xmlns:schema="mydata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sqltypes="http://schemas.microsoft.com/sqlserver/2004/sqltypes" elementFormDefault="qualified">
<xsd:import namespace="http://schemas.microsoft.com/sqlserver/2004/sqltypes" schemaLocation="http://schemas.microsoft.com/sqlserver/2004/sqltypes/sqltypes.xsd" />
<xsd:element name="dbo.my_table">
<xsd:complexType>
<xsd:attribute name="Id" type="sqltypes:int" use="required" />
<xsd:attribute name="Foo" type="sqltypes:int" use="required" />
...etc, etc.
I can't rely on an internet connection when my tests run so I want to store it locally. So I download the xsd and place it in the same folder as the xml with my data and reference it like:
schemaLocation="http://schemas.microsoft.com/sqlserver/2004/sqltypes sqltypes.xsd"
Cannot resolve the schemaLocation attribute
Of course I have tried every combination of ways to reference this except the one that works.
What is the correct syntax?