goal : import a CRM dynamics odata xml file into SSIS XML transformation block.
SSIS contraints :
- only one namespace
- no nested nodes
- remove "un necessary" link node
simplified xml source
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base="https://XXXXXXXXXX/XRMServices/2011/OrganizationData.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
<title type="text">allianceSet</title>
<entry>
<link rel="edit" title="be_alliance" href="be_allianceSet(guid'429352cb-deca-e311-80c0-00155d5682af')" />
<link rel="XXXX" type="application/atom+xml;type=entry" title="lk_be_alliance_createdby" href="be_allianceSet/lk_be_alliance_createdby" />
<link rel="XXXX" type="application/atom+xml;type=entry" title="lk_be_alliance_createdonbehalfby" href="be_allianceSet(/lk_be_alliance_createdonbehalfby" />
<content type="application/xml">
<m:properties>
<d:ModifiedOn m:type="Edm.DateTime">2015-10-30T13:06:31Z</d:ModifiedOn>
<d:CreatedBy m:type="Microsoft.Crm.Sdk.Data.Services.EntityReference" m:null="true">
<d:Id m:type="Edm.Guid">40f20074-ede3-48cc-aafc-750a1275b99b</d:Id>
<d:LogicalName>systemuser</d:LogicalName>
</d:CreatedBy>
<d:statecode m:type="Microsoft.Crm.Sdk.Data.Services.OptionSetValue">
<d:Value m:type="Edm.Int32">0</d:Value>
</d:statecode>
</m:properties>
</content>
</entry>
</feed>
XSL input 1.0
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" method="xml" encoding="utf-8" omit-xml-declaration="yes"/>
<xsl:template match="*[name() != 'link']">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@* | node()"/>
</xsl:element>
</xsl:template>
<!-- template to copy attributes -->
<xsl:template match="@*">
<xsl:attribute name="{local-name()}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>
above xsl perfectly remove namespaces. however I'm trying to transform/flatten each node of type="Microsoft.Crm.Sdk.Data.Services.EntityReference" with only one guid value
...
<CreatedBy type="Microsoft.Crm.Sdk.Data.Services.EntityReference" null="true">
<Id type="Edm.Guid">40f20074-ede3-48cc-aafc-750a1275b99b</Id>
<LogicalName>systemuser</LogicalName>
</CreatedBy>
...
into
...
<CreatedBy>40f20074-ede3-48cc-aafc-750a1275b99b</CreatedBy>
...
so far without any luck ... any help appreciated