Subject:XML to XML Transformation Author:Bob Whitty Date:29 Apr 2010 11:28 AM
Hi Folks -
I'm converting an inbound XML document into a resulting XML document I can use to import into SQL Server 2005. I'm attempting to output the Carrier element in the transformation under a different element name (OtherPartner) with a PartnerRole attribute = 'Carrier'. Thus far all my attempts have failed and the Carrier element seems to be ignored. I'm wondering if someone could tell me what it is I'm doing wrong.
Inbound document fragment:
(FromID & DocID are global variables)
Subject:XML to XML Transformation Author:Alberto Massari Date:30 Apr 2010 12:45 PM
you shouldn't use the "self" axis when testing for Carrier, as the context node is the one specified in the match expression of the template. You should use either child::Carrier or just "./Carrier" like you do in the next lines.