khidir sanosi
khidir sanosi

Reputation: 183

XML Namespace & XML Task

I have an XML file, which has a namespace with an XSD defined as:

<RootElement xmlns:xsd="http://www.w3.org/xyz" xmlns:xsi="http://www.w3.org/xyz/XMLSchema-instance">

The XML is received from a vendor, and I have to perform a schema check, before proceeding with the processing. The schema check is done with XML Task component in SSIS. In the XML Task I define the location of the XML file, as well as the location of the XSD.

If the local version of XSD is different from the one that is referred to via xmlns:xsd="http://www.w3.org/xyz" in the XML namespace, would the SSIS XML Task fail the schema check due to this difference? In other words, which one has the priority to check against; the local XSD file, or the one contained in the namespace URI?

Upvotes: 1

Views: 110

Answers (1)

Yitzhak Khabinsky
Yitzhak Khabinsky

Reputation: 22167

SSIS XML Source Adapter is not doing any validation against an XSD.

  1. SSIS is using its own local XSD file to describe structure, data types, and their mapping to SSIS data types of the input XML.
  2. The XSD file referred inside the input XML file has a completely different role. SSIS XML Source Adapter is not using it.

SSIS XML Source Adapter is used for shredding of hierarchical XML into a rectangular/relational format. The adapter needs its own XSD file.

SSIS XML Task, operation Validation, will use an XSD file that is provided as a parameter to the task. It should be an XSD file on the file system. SSIS run-time servers not necessarily have access to the Internet via HTTP protocol. The actual namespace value is just for uniqueness. There is an additional optional schema location attribute that specifies XSD location: xsi:schemaLocation="whatever.xsd"

Upvotes: 2

Related Questions