Schema validation issues with XML task
Hi,
I am trying to validate a xml message with multiple schema files. the problem is when i try to select the XSD schemafile as second operand in the XML task, i can only select one file. even if i select that schema file that includes reference to other schema files..i get error that cannot validate the xml message.
However i am certain that the message infer the schema. Pls help..i am doing something wrong?
September 17th, 2008 1:32am
as a workaround, instead try using the script task and the system.xml namespace to validate the xml file.
hth
Free Windows Admin Tool Kit Click here and download it now
September 17th, 2008 2:21am
Thanks for a quick response.
I found a similar post that mentions solution to the problem.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1001433&SiteID=1
Will i have to create connection mgrs for each schema file..?
September 17th, 2008 2:39am
seeker_06 wrote:
Thanks for a quick response.
I found a similar post that mentions solution to the problem.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1001433&SiteID=1
Will i have to create connection mgrs for each schema file..?
no, it isn't necessary to create a separate connection manager for each schema file. the file connection manager's connection string can be configured to use an ssis expression. this expression would be evaluated at run-time to resolve the path and name of the schema file.
hth
Free Windows Admin Tool Kit Click here and download it now
September 17th, 2008 2:52am
Duane Douglas wrote:
seeker_06 wrote:
Thanks for a quick response.
I found a similar post that mentions solution to the problem.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1001433&SiteID=1
Will i have to create connection mgrs for each schema file..?
no, it isn't necessary to create a separate connection manager for each schema file. the file connection manager's connection string can be configured to use an ssis expression. this expression would be evaluated at run-time to resolve the path and name of the schema file.
hth
Sorry can you pls explain how to configure the connection string...
Thanks for your time
September 17th, 2008 3:03am
seeker_06 wrote:
Duane Douglas wrote:
seeker_06 wrote:
Thanks for a quick response.
I found a similar post that mentions solution to the problem.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1001433&SiteID=1
Will i have to create connection mgrs for each schema file..?
no, it isn't necessary to create a separate connection manager for each schema file. the file connection manager's connection string can be configured to use an ssis expression. this expression would be evaluated at run-time to resolve the path and name of the schema file.
hth
Sorry can you pls explain how to configure the connection string...
Thanks for your time
first, create an ssis variable of data type string. this variable will store the file name captured by the foreach loop. the expression for the connection string will also use this variable. make sure that the expression evaluates to a fully qualified path. the connection string property can't be blank at run-time, soleave it with a fully qualified file path.
hth
Free Windows Admin Tool Kit Click here and download it now
September 17th, 2008 3:37am
Here is an Script Task example that can validate against multiple XSD files.
http://microsoft-ssis.blogspot.nl/2012/08/validating-xml-file-against-xsd-with_6.html
Just copy row 22 of the C# script task or row 21 of the VB.Net Script task for multiple XSD files.
xmlrs.Schemas.Add(null, Dts.Connections["file1.xsd"].ConnectionString);
xmlrs.Schemas.Add(null, Dts.Connections["file2.xsd"].ConnectionString);
Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com |
Twitter
August 6th, 2012 8:14am