dbTalk Databases Forums  

DTS Package, XML task. Read XML file and store it in package variable.

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS Package, XML task. Read XML file and store it in package variable. in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Victoria
 
Posts: n/a

Default DTS Package, XML task. Read XML file and store it in package variable. - 07-24-2006 , 01:53 PM






I am creating a package using SQL Server 2005 Integration Services.
I have .XML file where is stored Path of MS Access file.
I want "XML task" to read this .XML file and store Path value in the
package level User::AccessPath variable. My construction does not work.
If anybody knows why, please, help!

XML Task Editor: properties that I have set up :

Input
OperationType: XPATH
SourceType: File connection
Source: ConnectionProfile.xml
Output:
SaveOperationResult: True
OperationResult:
Destination: User::AccessSource
DestinationType: Variable
OverwriteDestination: True
Second Operand:
SecondOperandType: Direct input
SecondOperand: /dsPDM/tblSourceConnection/Path
XPATH Options:
PutResultInOneNode: False
XPATHOperation: Values


******************* ConnectionProfile.xml **************************
<dsPDM xmlns="http://tempuri.org/dsPDM.xsd">
<tblSourceConnection>
<ConnectionName>Access</ConnectionName>
<Path>C:\Access\Local\db1.mdb</Path>
</tblSourceConnection>
</dsPDM>
***********************************************


Thank you ,
Victoria.


Reply With Quote
  #2  
Old   
brad
 
Posts: n/a

Default Re: DTS Package, XML task. Read XML file and store it in package variable. - 08-21-2006 , 08:36 AM






Victoria,

It didn't like your namespace declaration.

Change this:
<dsPDM xmlns="http://tempuri.org/dsPDM.xsd">

To this:
<dsPDM xmlns:myname="http://tempuri.org/dsPDM.xsd">

And it will work.

Also, you may want to revisit your schema declaration.

As far as I can tell, if you name the namespace, it's smart enough to
perform the XPATH on it without including the "myname:" prefix for each
element in the second operand.

Brad


Victoria wrote:
Quote:
I am creating a package using SQL Server 2005 Integration Services.
I have .XML file where is stored Path of MS Access file.
I want "XML task" to read this .XML file and store Path value in the
package level User::AccessPath variable. My construction does not work.
If anybody knows why, please, help!

XML Task Editor: properties that I have set up :

Input
OperationType: XPATH
SourceType: File connection
Source: ConnectionProfile.xml
Output:
SaveOperationResult: True
OperationResult:
Destination: User::AccessSource
DestinationType: Variable
OverwriteDestination: True
Second Operand:
SecondOperandType: Direct input
SecondOperand: /dsPDM/tblSourceConnection/Path
XPATH Options:
PutResultInOneNode: False
XPATHOperation: Values


******************* ConnectionProfile.xml **************************
dsPDM xmlns="http://tempuri.org/dsPDM.xsd"
tblSourceConnection
ConnectionName>Access</ConnectionName
Path>C:\Access\Local\db1.mdb</Path
/tblSourceConnection
/dsPDM
***********************************************


Thank you ,
Victoria.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.