Reputation: 357
I have this XML I receive from a REST call to a SharePoint site:
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xml:base="https://XYZ.net/_api/">
<id>95d0968b-bc93-400d-9bd4-14f8a04f7933</id>
<title />
<updated>2014-05-08T12:30:49Z</updated>
<entry m:etag=""1"">
<id>df1dbe72-22e1-45af-9290-1c6571696169</id>
<category term="SP.Data.XYZABCBudgetLinesListItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<link rel="edit" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(2)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FirstUniqueAncestorSecurableObject" type="application/atom+xml;type=entry" title="FirstUniqueAncestorSecurableObject" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(2)/FirstUniqueAncestorSecurableObject" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/RoleAssignments" type="application/atom+xml;type=feed" title="RoleAssignments" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(2)/RoleAssignments" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/AttachmentFiles" type="application/atom+xml;type=feed" title="AttachmentFiles" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(2)/AttachmentFiles" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ContentType" type="application/atom+xml;type=entry" title="ContentType" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(2)/ContentType" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesAsHtml" type="application/atom+xml;type=entry" title="FieldValuesAsHtml" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(2)/FieldValuesAsHtml" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesAsText" type="application/atom+xml;type=entry" title="FieldValuesAsText" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(2)/FieldValuesAsText" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesForEdit" type="application/atom+xml;type=entry" title="FieldValuesForEdit" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(2)/FieldValuesForEdit" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/File" type="application/atom+xml;type=entry" title="File" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(2)/File" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Folder" type="application/atom+xml;type=entry" title="Folder" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(2)/Folder" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ParentList" type="application/atom+xml;type=entry" title="ParentList" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(2)/ParentList" />
<title />
<updated>2014-05-08T12:30:49Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:FileSystemObjectType m:type="Edm.Int32">0</d:FileSystemObjectType>
<d:Id m:type="Edm.Int32">2</d:Id>
<d:ContentTypeId>0x009BF34D7FE1615746BB818211276E2E75</d:ContentTypeId>
<d:XYZBudgetLinesIDInXYZABCBudgetLines m:type="Edm.Int32">13154</d:XYZBudgetLinesIDInXYZABCBudgetLines>
<d:XYZIDInXYZABCBudgetLinesId m:type="Edm.Int32">4041</d:XYZIDInXYZABCBudgetLinesId>
<d:XYZABCIDInXYZABCBudgetLinesId m:type="Edm.Int32">3</d:XYZABCIDInXYZABCBudgetLinesId>
<d:ABCIsFromActivatedPAL m:type="Edm.Boolean">false</d:ABCIsFromActivatedPAL>
<d:ABCBudgetCode>16;9030172;10703</d:ABCBudgetCode>
<d:ABCBudgetDonorReportCodeLineNumber m:type="Edm.Double">1</d:ABCBudgetDonorReportCodeLineNumber>
<d:ABCBudgetLineDescription>Thematic - Partner Costs</d:ABCBudgetLineDescription>
<d:ABCTotalEstimatedAmount m:null="true" />
<d:ABCTotalEstimatedAmountToFundingOffice m:type="Edm.Double">0</d:ABCTotalEstimatedAmountToFundingOffice>
<d:ABCTotalEstimatedAmountToAllImplementingOffices m:null="true" />
<d:ABCTotalCommittedAmount m:null="true" />
<d:ABCTotalCommittedAmountToFundingOffice m:type="Edm.Double">0</d:ABCTotalCommittedAmountToFundingOffice>
<d:ABCTotalCommittedAmountToAllImplementingOffices m:null="true" />
<d:ID m:type="Edm.Int32">2</d:ID>
<d:Modified m:type="Edm.DateTime">2014-02-17T12:59:08Z</d:Modified>
<d:Created m:type="Edm.DateTime">2014-02-17T12:59:08Z</d:Created>
<d:AuthorId m:type="Edm.Int32">1028</d:AuthorId>
<d:EditorId m:type="Edm.Int32">1028</d:EditorId>
<d:OData__UIVersionString>1.0</d:OData__UIVersionString>
<d:Attachments m:type="Edm.Boolean">false</d:Attachments>
<d:GUID m:type="Edm.Guid">e5794096-6fc2-48f1-8c8f-0d2fd5244b14</d:GUID>
</m:properties>
</content>
</entry>
<entry m:etag=""1"">
<id>ad8cb0b2-6a8b-4dff-8da4-623527d1034a</id>
<category term="SP.Data.XYZABCBudgetLinesListItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<link rel="edit" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(3)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FirstUniqueAncestorSecurableObject" type="application/atom+xml;type=entry" title="FirstUniqueAncestorSecurableObject" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(3)/FirstUniqueAncestorSecurableObject" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/RoleAssignments" type="application/atom+xml;type=feed" title="RoleAssignments" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(3)/RoleAssignments" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/AttachmentFiles" type="application/atom+xml;type=feed" title="AttachmentFiles" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(3)/AttachmentFiles" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ContentType" type="application/atom+xml;type=entry" title="ContentType" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(3)/ContentType" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesAsHtml" type="application/atom+xml;type=entry" title="FieldValuesAsHtml" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(3)/FieldValuesAsHtml" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesAsText" type="application/atom+xml;type=entry" title="FieldValuesAsText" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(3)/FieldValuesAsText" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesForEdit" type="application/atom+xml;type=entry" title="FieldValuesForEdit" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(3)/FieldValuesForEdit" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/File" type="application/atom+xml;type=entry" title="File" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(3)/File" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Folder" type="application/atom+xml;type=entry" title="Folder" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(3)/Folder" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ParentList" type="application/atom+xml;type=entry" title="ParentList" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(3)/ParentList" />
<title />
<updated>2014-05-08T12:30:49Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:FileSystemObjectType m:type="Edm.Int32">0</d:FileSystemObjectType>
<d:Id m:type="Edm.Int32">3</d:Id>
<d:ContentTypeId>0x009BF34D7FE1615746BB818211276E2E75</d:ContentTypeId>
<d:XYZBudgetLinesIDInXYZABCBudgetLines m:type="Edm.Int32">13155</d:XYZBudgetLinesIDInXYZABCBudgetLines>
<d:XYZIDInXYZABCBudgetLinesId m:type="Edm.Int32">4041</d:XYZIDInXYZABCBudgetLinesId>
<d:XYZABCIDInXYZABCBudgetLinesId m:type="Edm.Int32">3</d:XYZABCIDInXYZABCBudgetLinesId>
<d:ABCIsFromActivatedPAL m:type="Edm.Boolean">false</d:ABCIsFromActivatedPAL>
<d:ABCBudgetCode>16;9030172;10704</d:ABCBudgetCode>
<d:ABCBudgetDonorReportCodeLineNumber m:type="Edm.Double">2</d:ABCBudgetDonorReportCodeLineNumber>
<d:ABCBudgetLineDescription>Thematic - Direct Implementation</d:ABCBudgetLineDescription>
<d:ABCTotalEstimatedAmount m:null="true" />
<d:ABCTotalEstimatedAmountToFundingOffice m:type="Edm.Double">0</d:ABCTotalEstimatedAmountToFundingOffice>
<d:ABCTotalEstimatedAmountToAllImplementingOffices m:null="true" />
<d:ABCTotalCommittedAmount m:null="true" />
<d:ABCTotalCommittedAmountToFundingOffice m:type="Edm.Double">0</d:ABCTotalCommittedAmountToFundingOffice>
<d:ABCTotalCommittedAmountToAllImplementingOffices m:null="true" />
<d:ID m:type="Edm.Int32">3</d:ID>
<d:Modified m:type="Edm.DateTime">2014-02-17T12:59:08Z</d:Modified>
<d:Created m:type="Edm.DateTime">2014-02-17T12:59:08Z</d:Created>
<d:AuthorId m:type="Edm.Int32">1028</d:AuthorId>
<d:EditorId m:type="Edm.Int32">1028</d:EditorId>
<d:OData__UIVersionString>1.0</d:OData__UIVersionString>
<d:Attachments m:type="Edm.Boolean">false</d:Attachments>
<d:GUID m:type="Edm.Guid">ca568284-a65b-4081-85e5-5c783a51d4f5</d:GUID>
</m:properties>
</content>
</entry>
<entry m:etag=""1"">
<id>f00d3036-ed85-49fd-8838-a20b0eaf7026</id>
<category term="SP.Data.XYZABCBudgetLinesListItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<link rel="edit" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(4)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FirstUniqueAncestorSecurableObject" type="application/atom+xml;type=entry" title="FirstUniqueAncestorSecurableObject" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(4)/FirstUniqueAncestorSecurableObject" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/RoleAssignments" type="application/atom+xml;type=feed" title="RoleAssignments" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(4)/RoleAssignments" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/AttachmentFiles" type="application/atom+xml;type=feed" title="AttachmentFiles" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(4)/AttachmentFiles" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ContentType" type="application/atom+xml;type=entry" title="ContentType" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(4)/ContentType" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesAsHtml" type="application/atom+xml;type=entry" title="FieldValuesAsHtml" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(4)/FieldValuesAsHtml" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesAsText" type="application/atom+xml;type=entry" title="FieldValuesAsText" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(4)/FieldValuesAsText" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesForEdit" type="application/atom+xml;type=entry" title="FieldValuesForEdit" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(4)/FieldValuesForEdit" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/File" type="application/atom+xml;type=entry" title="File" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(4)/File" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Folder" type="application/atom+xml;type=entry" title="Folder" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(4)/Folder" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ParentList" type="application/atom+xml;type=entry" title="ParentList" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(4)/ParentList" />
<title />
<updated>2014-05-08T12:30:49Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:FileSystemObjectType m:type="Edm.Int32">0</d:FileSystemObjectType>
<d:Id m:type="Edm.Int32">4</d:Id>
<d:ContentTypeId>0x009BF34D7FE1615746BB818211276E2E75</d:ContentTypeId>
<d:XYZBudgetLinesIDInXYZABCBudgetLines m:type="Edm.Int32">13156</d:XYZBudgetLinesIDInXYZABCBudgetLines>
<d:XYZIDInXYZABCBudgetLinesId m:type="Edm.Int32">4041</d:XYZIDInXYZABCBudgetLinesId>
<d:XYZABCIDInXYZABCBudgetLinesId m:type="Edm.Int32">3</d:XYZABCIDInXYZABCBudgetLinesId>
<d:ABCIsFromActivatedPAL m:type="Edm.Boolean">false</d:ABCIsFromActivatedPAL>
<d:ABCBudgetCode>16;9030172;10705</d:ABCBudgetCode>
<d:ABCBudgetDonorReportCodeLineNumber m:type="Edm.Double">3</d:ABCBudgetDonorReportCodeLineNumber>
<d:ABCBudgetLineDescription>Thematic - Partner Capacity Building</d:ABCBudgetLineDescription>
<d:ABCTotalEstimatedAmount m:null="true" />
<d:ABCTotalEstimatedAmountToFundingOffice m:type="Edm.Double">0</d:ABCTotalEstimatedAmountToFundingOffice>
<d:ABCTotalEstimatedAmountToAllImplementingOffices m:null="true" />
<d:ABCTotalCommittedAmount m:null="true" />
<d:ABCTotalCommittedAmountToFundingOffice m:type="Edm.Double">0</d:ABCTotalCommittedAmountToFundingOffice>
<d:ABCTotalCommittedAmountToAllImplementingOffices m:null="true" />
<d:ID m:type="Edm.Int32">4</d:ID>
<d:Modified m:type="Edm.DateTime">2014-02-17T12:59:08Z</d:Modified>
<d:Created m:type="Edm.DateTime">2014-02-17T12:59:08Z</d:Created>
<d:AuthorId m:type="Edm.Int32">1028</d:AuthorId>
<d:EditorId m:type="Edm.Int32">1028</d:EditorId>
<d:OData__UIVersionString>1.0</d:OData__UIVersionString>
<d:Attachments m:type="Edm.Boolean">false</d:Attachments>
<d:GUID m:type="Edm.Guid">afc2ed93-d36c-49d8-912e-8af3bac351af</d:GUID>
</m:properties>
</content>
</entry>
<entry m:etag=""1"">
<id>365f7548-ba26-4363-b6a2-de7ee4bba2d4</id>
<category term="SP.Data.XYZABCBudgetLinesListItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<link rel="edit" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(5)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FirstUniqueAncestorSecurableObject" type="application/atom+xml;type=entry" title="FirstUniqueAncestorSecurableObject" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(5)/FirstUniqueAncestorSecurableObject" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/RoleAssignments" type="application/atom+xml;type=feed" title="RoleAssignments" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(5)/RoleAssignments" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/AttachmentFiles" type="application/atom+xml;type=feed" title="AttachmentFiles" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(5)/AttachmentFiles" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ContentType" type="application/atom+xml;type=entry" title="ContentType" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(5)/ContentType" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesAsHtml" type="application/atom+xml;type=entry" title="FieldValuesAsHtml" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(5)/FieldValuesAsHtml" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesAsText" type="application/atom+xml;type=entry" title="FieldValuesAsText" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(5)/FieldValuesAsText" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesForEdit" type="application/atom+xml;type=entry" title="FieldValuesForEdit" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(5)/FieldValuesForEdit" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/File" type="application/atom+xml;type=entry" title="File" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(5)/File" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Folder" type="application/atom+xml;type=entry" title="Folder" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(5)/Folder" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ParentList" type="application/atom+xml;type=entry" title="ParentList" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(5)/ParentList" />
<title />
<updated>2014-05-08T12:30:49Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:FileSystemObjectType m:type="Edm.Int32">0</d:FileSystemObjectType>
<d:Id m:type="Edm.Int32">5</d:Id>
<d:ContentTypeId>0x009BF34D7FE1615746BB818211276E2E75</d:ContentTypeId>
<d:XYZBudgetLinesIDInXYZABCBudgetLines m:type="Edm.Int32">13157</d:XYZBudgetLinesIDInXYZABCBudgetLines>
<d:XYZIDInXYZABCBudgetLinesId m:type="Edm.Int32">4041</d:XYZIDInXYZABCBudgetLinesId>
<d:XYZABCIDInXYZABCBudgetLinesId m:type="Edm.Int32">3</d:XYZABCIDInXYZABCBudgetLinesId>
<d:ABCIsFromActivatedPAL m:type="Edm.Boolean">false</d:ABCIsFromActivatedPAL>
<d:ABCBudgetCode>17;9030173;10703</d:ABCBudgetCode>
<d:ABCBudgetDonorReportCodeLineNumber m:type="Edm.Double">4</d:ABCBudgetDonorReportCodeLineNumber>
<d:ABCBudgetLineDescription>Thematic - Partner Costs</d:ABCBudgetLineDescription>
<d:ABCTotalEstimatedAmount m:null="true" />
<d:ABCTotalEstimatedAmountToFundingOffice m:type="Edm.Double">0</d:ABCTotalEstimatedAmountToFundingOffice>
<d:ABCTotalEstimatedAmountToAllImplementingOffices m:null="true" />
<d:ABCTotalCommittedAmount m:null="true" />
<d:ABCTotalCommittedAmountToFundingOffice m:type="Edm.Double">0</d:ABCTotalCommittedAmountToFundingOffice>
<d:ABCTotalCommittedAmountToAllImplementingOffices m:null="true" />
<d:ID m:type="Edm.Int32">5</d:ID>
<d:Modified m:type="Edm.DateTime">2014-02-17T12:59:08Z</d:Modified>
<d:Created m:type="Edm.DateTime">2014-02-17T12:59:08Z</d:Created>
<d:AuthorId m:type="Edm.Int32">1028</d:AuthorId>
<d:EditorId m:type="Edm.Int32">1028</d:EditorId>
<d:OData__UIVersionString>1.0</d:OData__UIVersionString>
<d:Attachments m:type="Edm.Boolean">false</d:Attachments>
<d:GUID m:type="Edm.Guid">19206a69-1850-4e97-8103-f3f00c21911a</d:GUID>
</m:properties>
</content>
</entry>
<entry m:etag=""1"">
<id>8ed0cc40-8623-4856-bb47-a2d97fdaa3c2</id>
<category term="SP.Data.XYZABCBudgetLinesListItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<link rel="edit" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(6)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FirstUniqueAncestorSecurableObject" type="application/atom+xml;type=entry" title="FirstUniqueAncestorSecurableObject" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(6)/FirstUniqueAncestorSecurableObject" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/RoleAssignments" type="application/atom+xml;type=feed" title="RoleAssignments" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(6)/RoleAssignments" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/AttachmentFiles" type="application/atom+xml;type=feed" title="AttachmentFiles" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(6)/AttachmentFiles" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ContentType" type="application/atom+xml;type=entry" title="ContentType" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(6)/ContentType" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesAsHtml" type="application/atom+xml;type=entry" title="FieldValuesAsHtml" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(6)/FieldValuesAsHtml" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesAsText" type="application/atom+xml;type=entry" title="FieldValuesAsText" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(6)/FieldValuesAsText" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesForEdit" type="application/atom+xml;type=entry" title="FieldValuesForEdit" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(6)/FieldValuesForEdit" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/File" type="application/atom+xml;type=entry" title="File" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(6)/File" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Folder" type="application/atom+xml;type=entry" title="Folder" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(6)/Folder" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ParentList" type="application/atom+xml;type=entry" title="ParentList" href="Web/Lists(guid'7f4df39b-61e1-4657-bb81-8211276e2e75')/Items(6)/ParentList" />
<title />
<updated>2014-05-08T12:30:49Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:FileSystemObjectType m:type="Edm.Int32">0</d:FileSystemObjectType>
<d:Id m:type="Edm.Int32">6</d:Id>
<d:ContentTypeId>0x009BF34D7FE1615746BB818211276E2E75</d:ContentTypeId>
<d:XYZBudgetLinesIDInXYZABCBudgetLines m:type="Edm.Int32">13158</d:XYZBudgetLinesIDInXYZABCBudgetLines>
<d:XYZIDInXYZABCBudgetLinesId m:type="Edm.Int32">4041</d:XYZIDInXYZABCBudgetLinesId>
<d:XYZABCIDInXYZABCBudgetLinesId m:type="Edm.Int32">3</d:XYZABCIDInXYZABCBudgetLinesId>
<d:ABCIsFromActivatedPAL m:type="Edm.Boolean">false</d:ABCIsFromActivatedPAL>
<d:ABCBudgetCode>17;9030173;10704</d:ABCBudgetCode>
<d:ABCBudgetDonorReportCodeLineNumber m:type="Edm.Double">5</d:ABCBudgetDonorReportCodeLineNumber>
<d:ABCBudgetLineDescription>Thematic - Direct Implementation</d:ABCBudgetLineDescription>
<d:ABCTotalEstimatedAmount m:null="true" />
<d:ABCTotalEstimatedAmountToFundingOffice m:type="Edm.Double">0</d:ABCTotalEstimatedAmountToFundingOffice>
<d:ABCTotalEstimatedAmountToAllImplementingOffices m:null="true" />
<d:ABCTotalCommittedAmount m:null="true" />
<d:ABCTotalCommittedAmountToFundingOffice m:type="Edm.Double">0</d:ABCTotalCommittedAmountToFundingOffice>
<d:ABCTotalCommittedAmountToAllImplementingOffices m:null="true" />
<d:ID m:type="Edm.Int32">6</d:ID>
<d:Modified m:type="Edm.DateTime">2014-02-17T12:59:08Z</d:Modified>
<d:Created m:type="Edm.DateTime">2014-02-17T12:59:08Z</d:Created>
<d:AuthorId m:type="Edm.Int32">1028</d:AuthorId>
<d:EditorId m:type="Edm.Int32">1028</d:EditorId>
<d:OData__UIVersionString>1.0</d:OData__UIVersionString>
<d:Attachments m:type="Edm.Boolean">false</d:Attachments>
<d:GUID m:type="Edm.Guid">f3eb8e7c-e6fd-4dde-9bbd-f9b36dd6da4f</d:GUID>
</m:properties>
</content>
</entry>
<link rel="next" href="https://XYZ.net/_api/web/lists/getByTitle('XYZ%20ABC%20budget%20lines')/items?%24skiptoken=Paged%3dTRUE%26p_ID%3d6&%24top=5" />
</feed>
Can someone help me with an XSLT to receive an output like this.
<XYZABCBudgetLines>
<XYZABCBudgetLinesItem>
<ContentTypeID>0x009BF34D7FE1615746BB818211276E2E75</ContentTypeID>
<OriginalID>13154</OriginalID>
<XYZIDId>4041</XYZIDId>
<ABCId>3</ABCId>
<IsFromActivatedPAL>false</IsFromActivatedPAL>
<Code>16;9030172;10703</Code>
<DonorReportCodeLineNumber>1</DonorReportCodeLineNumber>
<Description>Thematic - Partner Costs</Description>
<EstimatedAmount />
<ToBeSpentByFundingOffice>0</ToBeSpentByFundingOffice>
<AmountToImplementingOfficeS />
<CommittedAmount />
<ToBeSpentByFundingOffice0>0</ToBeSpentByFundingOffice0>
<AmountToImplementingOfficeS0 />
<Id>2</Id>
<ContentType>XYZ ABC budget lines</ContentType>
<Modified>2014-02-17T12:59:08</Modified>
<Created>2014-02-17T12:59:08</Created>
<CreatedById>1028</CreatedById>
<ModifiedById>1028</ModifiedById>
<Owshiddenversion>1</Owshiddenversion>
<Version>1.0</Version>
<Path>/Lists/XYZABCBudgetLines</Path>
</XYZABCBudgetLinesItem>
<XYZABCBudgetLinesItem>
<ContentTypeID>0x009BF34D7FE1615746BB818211276E2E75</ContentTypeID>
<OriginalID>13155</OriginalID>
<XYZIDId>4041</XYZIDId>
<ABCId>3</ABCId>
<IsFromActivatedPAL>false</IsFromActivatedPAL>
<Code>16;9030172;10704</Code>
<DonorReportCodeLineNumber>2</DonorReportCodeLineNumber>
<Description>Thematic - Direct Implementation</Description>
<EstimatedAmount />
<ToBeSpentByFundingOffice>0</ToBeSpentByFundingOffice>
<AmountToImplementingOfficeS />
<CommittedAmount />
<ToBeSpentByFundingOffice0>0</ToBeSpentByFundingOffice0>
<AmountToImplementingOfficeS0 />
<Id>3</Id>
<ContentType>XYZ ABC budget lines</ContentType>
<Modified>2014-02-17T12:59:08</Modified>
<Created>2014-02-17T12:59:08</Created>
<CreatedById>1028</CreatedById>
<ModifiedById>1028</ModifiedById>
<Owshiddenversion>1</Owshiddenversion>
<Version>1.0</Version>
<Path>/Lists/XYZABCBudgetLines</Path>
</XYZABCBudgetLinesItem>
</XYZABCBudgetLines>
This is the XSLT i am trying to use but doesnt transform
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
<xsl:output method="xml" version="1.0" encoding="UTF-8" />
<xsl:template match="feed">
<xsl:if test="link[@rel='self']/@title">
<xsl:element name="{link[@rel='self']/@title}">
<xsl:apply-templates select="entry"/>
</xsl:element>
</xsl:if>
</xsl:template>
<xsl:template match="entry">
<xsl:if test="link[@rel='edit']/@title">
<xsl:element name="{link[@rel='edit']/@title}">
<xsl:for-each select="content/m:properties/*">
<xsl:element name="{local-name()}">
<xsl:value-of select="."/>
</xsl:element>
</xsl:for-each>
<xsl:apply-templates select="link[@rel!='edit']"/>
</xsl:element>
</xsl:if>
</xsl:template>
<xsl:template match="link[@rel!='edit']">
<xsl:apply-templates select="m:inline/entry" />
</xsl:template>
jdshfgsjdhfskdjfkjdfhlkajdflaksjdflaksdgaljhscbl
Upvotes: 3
Views: 2908
Reputation: 338248
A good approach for this task is to add small, single-purpose templates. For example
<OriginalID>13154</OriginalID>
would be created by
<xsl:template match="d:XYZBudgetLinesIDInXYZABCBudgetLines">
<OriginalID><xsl:value-of select="." /></OriginalID>
</xsl:template>
Add one of these templates for every output element you need.
Now all you need to do is create one template that handles the individual atom
elements in the input
<xsl:template match="atom:entry">
<XYZABCBudgetLinesItem>
<xsl:apply-templates select="atom:content/m:properties/*" />
</XYZABCBudgetLinesItem>
</xsl:template>
Note: You need to declare the atom namespace prefix in your XSLT (xmlns:atom="http://www.w3.org/2005/Atom"
) or the template won't match anything. In exchange you can drop that default namespace (xmlns="http://www.w3.org/2005/Atom"
), as you're not really interested in creating atom
elements for your output.
The <xsl:apply-templates select="atom:content/m:properties/*" />
will handle the metadata properties of the <entry>
, appropriately executing all those small single-purpose templates you created.
Finally there should be one template that acts as a starting point:
<xsl:template match="/atom:feed">
<XYZABCBudgetLines>
<xsl:apply-templates select="atom:entry" />
</XYZABCBudgetLines>
</xsl:template>
Last but not least you should add a generic empty template to catch all elements that don't have any specific template assigned:
<xsl:template match="*" />
This way you can suppress nodes you don't want to see in the output.
The following will get you started, you can complete it yourself by adding more templates:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:georss="http://www.georss.org/georss"
xmlns:gml="http://www.opengis.net/gml"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xml:base="https://XYZ.net/_api/"
exclude-result-prefixes="atom m d gml georss"
>
<xsl:template match="/atom:feed">
<XYZABCBudgetLines>
<xsl:apply-templates select="atom:entry" />
</XYZABCBudgetLines>
</xsl:template>
<xsl:template match="atom:entry">
<XYZABCBudgetLinesItem>
<xsl:apply-templates select="atom:content/m:properties/*" />
</XYZABCBudgetLinesItem>
</xsl:template>
<xsl:template match="d:XYZBudgetLinesIDInXYZABCBudgetLines">
<OriginalID><xsl:value-of select="." /></OriginalID>
</xsl:template>
<xsl:template match="*" />
</xsl:stylesheet>
Which will output
<XYZABCBudgetLines>
<XYZABCBudgetLinesItem>
<OriginalID>13154</OriginalID>
</XYZABCBudgetLinesItem>
<XYZABCBudgetLinesItem>
<OriginalID>13155</OriginalID>
</XYZABCBudgetLinesItem>
<XYZABCBudgetLinesItem>
<OriginalID>13156</OriginalID>
</XYZABCBudgetLinesItem>
<XYZABCBudgetLinesItem>
<OriginalID>13157</OriginalID>
</XYZABCBudgetLinesItem>
<XYZABCBudgetLinesItem>
<OriginalID>13158</OriginalID>
</XYZABCBudgetLinesItem>
</XYZABCBudgetLines>
Upvotes: 6
Reputation: 1
I am not sure, but you could try something like this:
<xsl:for-each select="entry/content/m:properties">
<xsl:value-of select="d:ContentTypeId"/>
<xsl:value-of select="d:XYZBudgetLinesIDInXYZABCBudgetLines "/>
...
</xsl:for-each>
Upvotes: 0