Our company is going to start exchanging XML documents and I'm trying to understand how to correctly use XML data types in SQL Server 2005.
There is a published xsd which I think I'm supposed to store in a Schema Collection so that Sql Server can use it to validate typed XML variables and columns.
There also are some examples XML documents available for testing.
Because the xsd and the samples are relatively huge (1-2 megabytes each), I have distilled both down to the minimum necessary fields both for my own sanity while testing and for use in examples to forums such as this.
I believe I am down to my last problem which centers on understanding namespaces.
The actual XML documents do not and will not have any namespace parameters within them.
But I am only able to succesfully validate my testing samples when I include an xmlns parameter.
What am I doing wrong?
How can I get a sample without an xmlns parameter to successfully validate?
Here is what I have:
USE LSExport
GO
IF EXISTS (SELECT * FROM sys.xml_schema_collections WHERE [name] = 'MyPrivateSchemaCollection')
DROP XML SCHEMA COLLECTION dbo.MyPrivateSchemaCollection
GO
DECLARE @testSchema XML
SET @testSchema =
'<?xml version="1.0" encoding="UTF-8"?>
&
View Complete Post