All posts by historical

BizTalk EDI Problems

I have had a few problems with Biztalk this morning. I’ve been trying to validate an EDI instance file against one of the standard EDI schemas supplied with Biztalk. It was bahaving strangely. Initially, the error I was presented with was :

Could not find file “C:\DOCUME~1\USER1\LOCALS~1\Temp\validins.xml”.

Confused, I tried to use the “Generate Instance” function to try to see what was going wrong. This time, I got another error :

XSD2EDI failed to convert XSD: Compiling repository failed

A quick Google on this turned up this page in Microsoft’s knowledge base. In short, if you are logged on to the BT server with a domain account, and the EDI service is running with a machine-local account, you need to ensure that your domain account is in the “EDI Subsystem Users” group on the BT server.

As it happens, my schema instance failed to validate, but that’s life, I suppose.

Technorati Tags: , , ,

XSL for iTunes XML Export

I have just spent a few hours putting together an XSL stylesheet for the default output from iTunes when you export the library as XML. The real upset about the whole thing is Apples method of storing the tags as

<key>Name</key><string>value</string>

It forces a fairly hacky use of following-sibling processors in the XSL.

The code for the XSL sheet is as follows

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:fo="http://www.w3.org/1999/XSL/Format"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:fn="http://www.w3.org/2005/xpath-functions"
      xmlns:xdt="http://www.w3.org/2005/xpath-datatypes">
<xsl:template match="/" >
<html>
<head>
<link rel="stylesheet" type="text/css"  xhref="style.css" mce_href="style.css" />
<title><xsl:value-of select="key[1]" /></title>
</head>
<body>
<h1>music</h1>
<xsl:for-each select="plist/dict/dict/dict[not(key='Podcast')]">
<div class="track">
<span class="title"><xsl:value-of select="key/following-sibling::node()[1]" /></span>
<span class="album"><span class="artist"><xsl:value-of select="key/following-sibling::node()[1]" /></span> :: <xsl:value-of select="key/following-sibling::node()[1]" />
<xsl:if test="key">
(<xsl:value-of select="key/following-sibling::node()[1]" />)
</xsl:if>
</span>
<xsl:if test="key">
<span class="tracks"><xsl:value-of select="key/following-sibling::node()[1]" /> of <xsl:value-of select="key/following-sibling::node()[1]" /></span>
</xsl:if>
<xsl:variable name="tracklength" select="key/following-sibling::node()[1] div(1000)" />
    <span class="time"><xsl:value-of select="round($tracklength div 60)" />:
    <xsl:value-of select="round($tracklength mod 60)" /></span>
<a><xsl:attribute name="href"><xsl:value-of select="key/following-sibling::node()[1]" /></xsl:attribute>Play</a>
</div>
</xsl:for-each>
<h1>podcasts</h1>
<xsl:for-each select="plist/dict/dict/dict/key/..">
<div class="podcast">
<span class="title"><xsl:value-of select="key/following-sibling::node()[1]" /></span>
<span class="album"><span class="artist"><xsl:value-of select="key/following-sibling::node()[1]" /></span> :: <xsl:value-of select="key/following-sibling::node()[1]" />
<xsl:if test="key">
(<xsl:value-of select="key/following-sibling::node()[1]" />)
</xsl:if>
</span>
<xsl:if test="key">
<span class="tracks"><xsl:value-of select="key/following-sibling::node()[1]" /> of <xsl:value-of select="key/following-sibling::node()[1]" /></span>
</xsl:if>
<xsl:variable name="tracklength" select="key/following-sibling::node()[1] div(1000)" />
<span class="time"><xsl:value-of select="round($tracklength div 60)" />:<xsl:value-of select="round($tracklength mod 60)" /></span>
</div>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

As far as styling the output is concerned, you’ll have to worry about that yourself.

Technorati Tags: , , ,

Sending an HTTP POST request to a web server

ASCIIEncoding encoding = new ASCIIEncoding();
string post_url = "http://172.16.24.44/postdata.php";
string poststring = "monkeys=blue\&trousers=black";
byte[] data = encoding.GetBytes(poststring);

HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(post_url);
httpRequest.Method = "POST";
httpRequest.ContentType="application/x-www-form-urlencoded";
httpRequest.ContentLength = data.Length;
Stream newStream=httpRequest.GetRequestStream();
newStream.Write(data,0,data.Length);
newStream.Close();

HttpWebResponse response = (HttpWebResponse)httpRequest.GetResponse ();
Stream receiveStream = response.GetResponseStream ();
StreamReader readStream = new StreamReader (receiveStream);
textBox1.Text = "Response stream received.";
textBox1.Text = readStream.ReadToEnd().Replace("\\n","\\r\\n");
response.Close ();
readStream.Close ();

Google’s “Personlised Home”

Google have just released their “Personalised Home” for those of us with a Google account. (Gmail, for example)

It allows you to subscribe to feeds right there on the search engine home page, as well as numerous other bits of RSS goodness. I like it.

(You may be able to see it at Google.com, if you have an account…)

Spam just gets better and better!

This just arrived in my work inbox. It is great on so many levels…

Dear Home Owner,
After satisfying the analysis we are jubilant to provide for you this endorsement,

Your current mortgage qualifies you for more than a 3.4 lesser rate!

——————————————————————
!! ATTAINING THE LOWEST RATES IN THE US HAS NEVER BEEN EASIER !!
——————————————————————

Hundreds of thousands of residential owners have re-financed this month alone!

So why not you?

Go HERE to make that change.

If you prefer to be left out of this superfluous offer go here.

I am overjoyed to be the cause of this company’s jubliation, but I’m afraid that – even though this offer is indeed superfluous – I will probably not be clicking on that link.

Thin Sliced Bread

A good friend of mine asked me an interesting question last weekend. “What happened to thin sliced bread?” It got me wondering, so today I got off my backside and went to do a (very small) bit of research. I fired off an email to Warburtons’ customer services.

Can you tell me what has happened to the “thin sliced” loaf that was readily available in my youth, but is mysteriously lacking in modern life? It isn’t exactly keeping me awake at nights, but I miss that option.

Incredibly, they replied.

Thank you for your email.

We did produce a thin sliced loaf until about six or seven years ago. Around this time demand for the thin loaf fell and we delisted it. The thinnest sliced loaf we produce now is the Milk Roll.

I hope this answers your query.

Kind regards

Barbara Kelly
Customer Care Officer

Well, it does answer the question, and it doesn’t. Surely the word “medium” in “medium sliced loaf” implies there is something thinner? Perhaps they should re-align their product set accordingly?