OpenXML stylesheet corruption - openxml

I'm getting an error on this (formatted for readability) OpenXML stylesheet at column 153, which seems to be the '.' in the 0.0% format identifier. Can anyone see what is wrong here? If I remove the numFmts then the issue goes away.
<?xml version="1.0" encoding="utf-16"?>
<x:styleSheet xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<x:numFmts count="2">
<x:numFmt />
<x:numFmt numFmtId="164" formatCode="0.0%" />
</x:numFmts>
<x:fonts count="2">
<x:font>
<x:sz val="11" />
<x:color rgb="000000" />
<x:name val="Calibri" />
</x:font>
<x:font>
<x:b />
<x:sz val="11" />
<x:color rgb="000000" />
<x:name val="Calibri" />
</x:font>
</x:fonts>
<x:fills count="1">
<x:fill>
<x:patternFill patternType="none" />
</x:fill>
</x:fills>
<x:borders count="1">
<x:border>
<x:left />
<x:right />
<x:top />
<x:bottom />
<x:diagonal />
</x:border>
</x:borders>
<x:cellXfs count="3">
<x:xf />
<x:xf fontId="1" applyFont="1" />
<x:xf numFmtId="164" applyNumberFormat="1" />
</x:cellXfs>
</x:styleSheet>

It's the empty <x:numFmt> element in the line above that's the cause of the issue. The numFmtId and formatCode are required elements within that element.
The schema from ECMA is:
<xsd:complexType name="CT_NumFmt">
<xsd:attribute name="numFmtId" type="ST_NumFmtId" use="required"/>
<xsd:attribute name="formatCode" type="s:ST_Xstring" use="required"/>
</xsd:complexType>
It's worth trying the OpenXml Productivity Tool in situations like these. It will validate files as well as backwards engineer code from a valid file. In your case you'd get something like this:

Related

Unsure how to fix the error in the Azure Devops Migration Tool for very old TFS collections

We've been asked to migrate some very old legacy projects (i.e. from TFS 2010 days) onto Azure Devops Services. These very old projects have almost nothing in their Process Configuration and only have one error line in the logs from the migration tool for all project types (Scrum, Agile, Basic etc...).
[Info #15:27:48.998] === Found 1 error(s) when compared against process TFS 2019 Update 1 Scrum ===
[Error #15:27:48.998] Custom processConfiguration typeField count '0' is different than system '8'.
[Info #15:27:48.998] === End of error(s) when compared against process TFS 2019 Update 1 Scrum ===
When looking at their Process Configuation it is only a few lines:
<?xml version="1.0" encoding="utf-16"?>
<ProjectProcessConfiguration>
<RequirementBacklog workItemCountLimit="1000">
<AddPanel />
</RequirementBacklog>
<TaskBacklog workItemCountLimit="1000">
<AddPanel />
</TaskBacklog>
<Properties>
<Property name="BugsBehavior" value="Off" />
</Properties>
</ProjectProcessConfiguration>
The only project that has no errors was a project added much later on TFS 2015:
<?xml version="1.0" encoding="utf-16"?>
<ProjectProcessConfiguration>
<BugWorkItems category="Microsoft.BugCategory" pluralName="Bugs" singularName="Bug">
<States>
<State type="Proposed" value="New" />
<State type="InProgress" value="Active" />
<State type="Complete" value="Closed" />
<State type="Resolved" value="Resolved" />
</States>
</BugWorkItems>
<FeedbackRequestWorkItems category="Microsoft.FeedbackRequestCategory" pluralName="Feedback Requests" singularName="Feedback Request">
<States>
<State type="InProgress" value="Active" />
<State type="Complete" value="Closed" />
</States>
</FeedbackRequestWorkItems>
<FeedbackResponseWorkItems category="Microsoft.FeedbackResponseCategory" pluralName="Feedback Responses" singularName="Feedback Response">
<States>
<State type="InProgress" value="Active" />
<State type="Complete" value="Closed" />
</States>
</FeedbackResponseWorkItems>
<PortfolioBacklogs>
<PortfolioBacklog category="Microsoft.EpicCategory" pluralName="Epics" singularName="Epic" workItemCountLimit="1000">
<AddPanel>
<Fields>
<Field refname="System.Title" />
</Fields>
</AddPanel>
<Columns>
<Column width="100" refname="System.WorkItemType" />
<Column width="400" refname="System.Title" />
<Column width="100" refname="System.State" />
<Column width="50" refname="Microsoft.VSTS.Scheduling.Effort" />
<Column width="50" refname="Microsoft.VSTS.Common.BusinessValue" />
<Column width="100" refname="Microsoft.VSTS.Common.ValueArea" />
<Column width="200" refname="System.Tags" />
</Columns>
<States>
<State type="Proposed" value="New" />
<State type="InProgress" value="Active" />
<State type="InProgress" value="Resolved" />
<State type="Complete" value="Closed" />
</States>
</PortfolioBacklog>
<PortfolioBacklog category="Microsoft.FeatureCategory" parent="Microsoft.EpicCategory" pluralName="Features" singularName="Feature" workItemCountLimit="1000">
<AddPanel>
<Fields>
<Field refname="System.Title" />
</Fields>
</AddPanel>
<Columns>
<Column width="100" refname="System.WorkItemType" />
<Column width="400" refname="System.Title" />
<Column width="100" refname="System.State" />
<Column width="50" refname="Microsoft.VSTS.Scheduling.Effort" />
<Column width="50" refname="Microsoft.VSTS.Common.BusinessValue" />
<Column width="100" refname="Microsoft.VSTS.Common.ValueArea" />
<Column width="200" refname="System.Tags" />
</Columns>
<States>
<State type="Proposed" value="New" />
<State type="InProgress" value="Active" />
<State type="InProgress" value="Resolved" />
<State type="Complete" value="Closed" />
</States>
</PortfolioBacklog>
</PortfolioBacklogs>
<RequirementBacklog category="Microsoft.RequirementCategory" parent="Microsoft.FeatureCategory" pluralName="Stories" singularName="User Story" workItemCountLimit="1000">
<AddPanel>
<Fields>
<Field refname="System.Title" />
</Fields>
</AddPanel>
<Columns>
<Column width="100" refname="System.WorkItemType" />
<Column width="400" refname="System.Title" />
<Column width="100" refname="System.State" />
<Column width="50" refname="Microsoft.VSTS.Scheduling.StoryPoints" />
<Column width="100" refname="Microsoft.VSTS.Common.ValueArea" />
<Column width="200" refname="System.IterationPath" />
<Column width="200" refname="System.Tags" />
</Columns>
<States>
<State type="Proposed" value="New" />
<State type="InProgress" value="Active" />
<State type="InProgress" value="Resolved" />
<State type="Complete" value="Closed" />
</States>
</RequirementBacklog>
<TaskBacklog category="Microsoft.TaskCategory" parent="Microsoft.RequirementCategory" pluralName="Tasks" singularName="Task" workItemCountLimit="1000">
<AddPanel>
<Fields>
<Field refname="System.Title" />
</Fields>
</AddPanel>
<Columns>
<Column width="400" refname="System.Title" />
<Column width="100" refname="System.State" />
<Column width="100" refname="System.AssignedTo" />
<Column width="50" refname="Microsoft.VSTS.Scheduling.RemainingWork" />
</Columns>
<States>
<State type="Proposed" value="New" />
<State type="InProgress" value="Active" />
<State type="Complete" value="Closed" />
</States>
</TaskBacklog>
<TypeFields>
<TypeField refname="Microsoft.VSTS.Common.Activity" type="Activity" />
<TypeField refname="Microsoft.VSTS.Common.StackRank" type="Order" />
<TypeField refname="Microsoft.VSTS.Feedback.ApplicationLaunchInstructions" type="ApplicationLaunchInstructions" />
<TypeField refname="Microsoft.VSTS.Feedback.ApplicationStartInformation" type="ApplicationStartInformation" />
<TypeField refname="Microsoft.VSTS.Feedback.ApplicationType" type="ApplicationType">
<TypeFieldValues>
<TypeFieldValue type="ClientApp" value="Client application" />
<TypeFieldValue type="RemoteMachine" value="Remote machine" />
<TypeFieldValue type="WebApp" value="Web application" />
</TypeFieldValues>
</TypeField>
<TypeField format="{0} h" refname="Microsoft.VSTS.Scheduling.RemainingWork" type="RemainingWork" />
<TypeField refname="Microsoft.VSTS.Scheduling.StoryPoints" type="Effort" />
<TypeField refname="System.AreaPath" type="Team" />
</TypeFields>
<Weekends>
<DayOfWeek>Sunday</DayOfWeek>
<DayOfWeek>Saturday</DayOfWeek>
</Weekends>
<Properties>
<Property name="HiddenBacklogs" value="Microsoft.EpicCategory" />
<Property name="BugsBehavior" value="AsTasks" />
</Properties>
<WorkItemColors>
<WorkItemColor primary="FFCC293D" secondary="FFFAEAE5" name="Bug" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Code Review Request" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Code Review Response" />
<WorkItemColor primary="FFFF7B00" secondary="FFFFD7B5" name="Epic" />
<WorkItemColor primary="FF773B93" secondary="FFEEE2F2" name="Feature" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Feedback Request" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Feedback Response" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Issue" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Shared Parameter" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Shared Steps" />
<WorkItemColor primary="FFF2CB1D" secondary="FFF6F5D2" name="Task" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Test Case" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Test Plan" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Test Suite" />
<WorkItemColor primary="FF009CCC" secondary="FFD6ECF2" name="User Story" />
</WorkItemColors>
</ProjectProcessConfiguration>
Anyone know of a easy way to fix the older projects? We want to import the code with changeset histories into Azure Devop Services and none of them have actually have work items (was managed externally on JIRA), build and release configs etc... We just want to get them onto the cloud to retire the legacy onpremise TFS servers (which are now running Azure Devops Server 2020.1.1 as per the migration suggestions).
Thanks for any help.
Edit: we're using TFS Team Project Manager from Jelle Druyts to help do some of the analysis, and am wondering if we can use the Transform function under Process Configuration to import the working projects config into the other projects.
Mark.
Sorry for the late reply on this. Since we didn't need to preserve templates and work items/ task history, we ended up abandoning full migrations. Ended up using the git-tfs (https://git-tfs.com/) tool to convert the TFS projects to a local git repository, then attaching that to a new Azure git project. Preserved all our history which was great.

xslt Date related functions

I want to display the total amount spilttup for each day. I tried with below code .functx:next-day function is used for setting the date filed.
Input
StartDate="04-12-2017"
NoDays = 6
Price=15540
But i want to show the result as shown below. Is there any other function is requird to set the date field value.
Current output:
<Night>
<Price Amount="2590" NightDate="2017-12-05" />
<Price Amount="2590" NightDate="2017-12-06" />
<Price Amount="2590" NightDate="2017-12-07" />
<Price Amount="2590" NightDate="2017-12-08" />
<Price Amount="2590" NightDate="2017-12-09" />
<Price Amount="2590" NightDate="2017-12-10" />
</Night>
Expected Output:
<Night>
<Price Amount="2590" NightDate="2017-12-04" />
<Price Amount="2590" NightDate="2017-12-05" />
<Price Amount="2590" NightDate="2017-12-06" />
<Price Amount="2590" NightDate="2017-12-07" />
<Price Amount="2590" NightDate="2017-12-08" />
<Price Amount="2590" NightDate="2017-12-09" />
</Night>
Currently used Logic:
<Night>
<xsl:for-each select="1 to $NoDays">
<Price>
<xsl:attribute name="Amount">
<xsl:value-of select="$Price div $NoDays"/>
</xsl:attribute>
<xsl:attribute name="NightDate">
<xsl:value-of select="functx:next-
day(xs:date($StartDate),position())"/>
</xsl:attribute>
</Price>
</xsl:for-each>
I think you simply want
<xsl:variable name="NoDays" select="6"/>
<xsl:variable name="Price" select="15540"/>
<xsl:variable name="StartDate">04-12-2017</xsl:variable>
<xsl:variable name="date" as="xs:date"
select="xs:date(replace($StartDate,
'([0-9]{2})-([0-9]{2})-([0-9]{4})',
'$3-$2-$1'))"/>
<xsl:for-each select="0 to $NoDays - 1">
<Price Amount="{$Price div $NoDays}"
NightDate="{$date + xs:dayTimeDuration('P1D') * .}"/>
</xsl:for-each>
which exploits that you can multiply a duration with an integer and add it to a date.
Online sample at http://xsltransform.net/bEzjRKT

DGML - Add weight to link

How do I add weight or value to the Edges or Link in a DGML file?
<?xml version='1.0' encoding='utf-8'?>
<DirectedGraph xmlns="http://schemas.microsoft.com/vs/2009/dgml">
<Nodes>
<Node Id="a" Label="a" Size="10" />
<Node Id="b" Background="#FF008080" Label="b" />
<Node Id="c" Label="c" Start="2010-06-10" />
</Nodes>
<Links>
<Link Source="a" Target="b" />
<Link Source="a" Target="c" />
</Links>
<Properties>
<Property Id="Background" Label="Background" DataType="Brush" />
<Property Id="Label" Label="Label" DataType="String" />
<Property Id="Size" DataType="String" />
<Property Id="Start" DataType="DateTime" />
</Properties>
</DirectedGraph>
I would like to be able to assign a weight or value to the lines between each node to designate the strength between the nodes.
You can add weights to each link by adding a label field with a value to each of the Link Sources. The numbers will appear beside the arrows on your graph.
<Link Source="a" Target="b" Label="5" />
<Link Source="a" Target="c" Label="6" />
Additionally, the background color of each node can be changed by creating Category groups and assigning that group to each node.
<Category Id="Orange" Background="Orange" />
<Category Id="Yellow" Background="Yellow" />
<Node Id="a" Category="Orange" />
<Node Id="b" Category="Yellow" />
Here's an example that uses a link Weight Style to do it:
<DirectedGraph xmlns="http://schemas.microsoft.com/vs/2009/dgml">
<Nodes>
<Node Id="Banana" UseManualLocation="True" />
<Node Id="Test" UseManualLocation="True" />
</Nodes>
<Links>
<Link Source="Test" Target="Banana" Priority="10"/>
<Link Source="Test" Target="Green" />
</Links>
<Properties>
<Property Id="Bounds" DataType="System.Windows.Rect" />
<Property Id="UseManualLocation" DataType="System.Boolean" />
</Properties>
<Styles>
<Style TargetType="Link">
<Setter Property="Weight" Expression="Priority" />
</Style>
</Styles>
</DirectedGraph>

Cannot filter by string from remote url

Created a WCF Data Service to pull data from Oracle database and when debugging in VS I can use the ?$filter syntax to filter returned sets.
However, using the remote url I cannot.
Point to note: I can filter by integers and dates, however I cannot filter by strings.
Also, I cannot filter by any string field in code. The filter is ignored.
Sample item below:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base="http://localhost:61905/CampaignerSVC.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">Contacts</title>
<id>http://localhost:61905/CampaignerSVC.svc/Contacts</id>
<updated>2015-04-29T15:06:48Z</updated>
<link rel="self" title="Contacts" href="Contacts" />
<entry>
<id>http://localhost:61905/CampaignerSVC.svc/Contacts(23517014)</id>
<title type="text"></title>
<updated>2015-04-29T15:06:48Z</updated>
<author>
<name />
</author>
<link rel="edit" title="ContactList" href="Contacts(23517014)" />
<category term="Campaigner_DAL_WCF.ContactList" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:LicenseNumber m:type="Edm.Int32">23517014</d:LicenseNumber>
<d:ClientCode>2000</d:ClientCode>
<d:ClientName>Doodler</d:ClientName>
<d:ClientMnemonic>DD</d:ClientMnemonic>
<d:LastName>Kerr</d:LastName>
<d:FirstName>Rover</d:FirstName>
<d:MiddleName>Frank</d:MiddleName>
<d:Title>Mr.</d:Title>
<d:PreferredFirstName>Rover</d:PreferredFirstName>
<d:PreferredMiddleName>Frank</d:PreferredMiddleName>
<d:CompanyName m:null="true" />
<d:JobTitle m:null="true" />
<d:Gender>M</d:Gender>
<d:DateOfBirth m:type="Edm.DateTime">1947-04-27T00:00:00</d:DateOfBirth>
<d:PrimaryChapterCode m:type="Edm.Int16">400</d:PrimaryChapterCode>
<d:AlternateChapterCode m:type="Edm.Int16" m:null="true" />
<d:MainAddrStreetNo>121</d:MainAddrStreetNo>
<d:MainAddrLine1>So Crescent</d:MainAddrLine1>
<d:MainAddrLine2 m:null="true" />
<d:MainAddrLine3 m:null="true" />
<d:MainAddrCity>MAICK</d:MainAddrCity>
<d:MainAddrProvCode>ON</d:MainAddrProvCode>
<d:MainAddrProv>Ontario</d:MainAddrProv>
<d:MainAddrPostalCode>KB7</d:MainAddrPostalCode>
<d:MainAddrCountryCode>CA</d:MainAddrCountryCode>
<d:MainAddrCountry>Canada</d:MainAddrCountry>
<d:MainPhoneNum>610-000-0703</d:MainPhoneNum>
<d:MainPhoneExt m:null="true" />
<d:MainFaxNum m:null="true" />
<d:MainEmailAddr>someone#rogers.com</d:MainEmailAddr>
<d:CellPhoneNum m:null="true" />
<d:ChangeType>D</d:ChangeType>
<d:EventTimeStamp m:type="Edm.DateTime">2015-04-29T02:40:02</d:EventTimeStamp>
<d:PrivacyIndicator>N</d:PrivacyIndicator>
</m:properties>
</content>
</entry>
</feed>
You can filter by string also by using the string in quotes like below-
'string'
Ok, so the issue was that I had created a class to store the results from the entity model.
Although I had a DataKey value specified, the problem was that the field I specified was not unique, therefore the filters were being ignore (or only the first matching record was filtered).
What I had to do was decorate the class with a composite DataKey.

Do I have to use XML parsing or any other way of saving the server response

I am getting the following response from server:
<?xml version="1.0" encoding="UTF-8"?>
<tracks type="array">
<track>
<id type="integer">13082503</id>
<created-at type="datetime">2011-04-05T05:48:05Z</created-at>
<user-id type="integer">2796383</user-id>
<duration type="integer">6715</duration>
<commentable type="boolean">true</commentable>
<state>finished</state>
<sharing>public</sharing>
<tag-list />
<permalink>myfirstsong-tutorial1-6</permalink>
<description nil="true" />
<streamable type="boolean">true</streamable>
<downloadable type="boolean">false</downloadable>
<genre nil="true" />
<release nil="true" />
<purchase-url nil="true" />
<label-id nil="true" />
<label-name nil="true" />
<isrc nil="true" />
<video-url nil="true" />
<track-type nil="true" />
<key-signature nil="true" />
<bpm nil="true" />
<title>MyFirstSong-Tutorial1</title>
<release-year nil="true" />
<release-month nil="true" />
<release-day nil="true" />
<original-format>m4a</original-format>
<license>all-rights-reserved</license>
<uri>http://api.soundcloud.com/tracks/13082503</uri>
<permalink-url>http://soundcloud.com/sleuth007/myfirstsong-tutorial1-6</permalink-url>
<artwork-url nil="true" />
<waveform-url>http://w1.sndcdn.com/8MqNbtkeyhNZ_m.png</waveform-url>
<user>
<id type="integer">2796383</id>
<permalink>sleuth007</permalink>
<username>sleuth007</username>
<uri>http://api.soundcloud.com/users/2796383</uri>
<permalink-url>http://soundcloud.com/sleuth007</permalink-url>
<avatar-url>http://a1.sndcdn.com/images/default_avatar_large.png?5fb6c47</avatar-url>
</user>
<stream-url>http://api.soundcloud.com/tracks/13082503/stream</stream-url>
<downloads-remaining type="integer">100</downloads-remaining>
<secret-token>s-5vz60</secret-token>
<secret-uri>http://api.soundcloud.com/tracks/13082503?secret_token=s-5vz60</secret-uri>
<user-playback-count type="integer">1</user-playback-count>
<user-favorite type="boolean">false</user-favorite>
<playback-count type="integer">0</playback-count>
<download-count type="integer">0</download-count>
<favoritings-count type="integer">0</favoritings-count>
<comment-count type="integer">0</comment-count>
<created-with>
<id type="integer">61</id>
<name>Cocoa API Wrapper Test</name>
<uri>http://api.soundcloud.com/apps/61</uri>
<permalink-url>http://soundcloud.com/apps/cocoa-api-wrapper-test</permalink-url>
</created-with>
<attachments-uri>http://api.soundcloud.com/tracks/13082503/attachments</attachments-uri>
</track>
</tracks>
Do I have to do XML parsing for this or is there any other way to save this as array
You will have to use NSXMLParser for parsing the xml file. "type=array" is XML attribute and not an array.