SQL Server 8 and XML
Some months ago Mark wrote about the Micropayment system called BarclayCcoin. Micropayments are a method whereby a web site can offer products or services at ammountsamounts less than the minimum credit card transaction value. TheseSuch a systems would allow a pay per view capability on a web site, and for obvious reasons, many conventional publishers are looking at theseis. Any payment system on the internetInternet is approached with justifiable caution by most users, and so to have a mMicropayment system that was backed by a major international bank such as Barclays was an exciting development. However we now have some sad news. Barclays have discontinued the BarclayCoin system. They have emailed all those who took part in the trial and say in this email that whilst innovative at the time of its launch, there have been a number of technological advances during the the last two years and we would like to expliot these in our final solution for micro payment services. It will be interesting to see what Barclays come up with. We do hope that they dont ignore this important area of e-commerce, which is crying out for a viable solution, lead by a respected financial institution, so that users will trust it and have the necessary guarantees about the security of their money.
Whilst we are on the subject of previous topics. We have written before on the coming of iInteractive Ddigital shopping on the Sky system. Well after a long wait of over a year and lots of promises it is now here, and what a disappointment it is. First thing that you will notice is its speed or lack of it, with little or no user feedback that anything is happening. As you start to use it you find other examples of frustration ,frustration, you want to buy something from one of the shops, and you have to type in your credit card details even though sSky have these details on file. If you buy from one shop and then move to another shop your shopping basket does not follow you, so you need to type your details again, not only that but if you go back to a previous on-line shop you find that it has lost your order. All very frustrating. The email set-up is poor as well, after going through several stages to enter your details, it will then inform you that the email address you have chosen is taken, and you need to repeat the steps. Why cant it tell you as soon as you have entered your choice of email name? No reason at all we think, just a badly thought out user interface again. All this keying was done using the standard remote control, tedious to say the least, as the infrared keyboards were still not available at the end of November. Next we tried the on-line banking offered by HSBC, now we already had an account with HSBC so there should be no problem. Not so, you have to request an application form from them after entering all your bank details. 6 weeks later the form has just arrived! If this is what we have to look forward to as far as e-commerce via digital TV then all we can say is, what a disappointment. Here we could have one of the greatest changes to peoples lifestyles since the television itself and it is being ruined by badly thought out software and apathy from suppliers.
Mark went on a week long course on Active Directory in Windows 2000 put on by Global Knowledge ( www.globalknowledge.co.uk ) . This was an excellent in-depth course on this new fundamental area of Windows 2000. It is going to be very important for anyone involved with Microsoft products to try to understand this technology as it will become core to many applications. The excelentexcellent trainer, Paul Slater, managed to keep us on our toes all week and there was no chance of nodding off, such was the intensity of the material. During a lull in the learning Mark was browsing the Microsoft web site (hes sad like that!) and came across an announcement about the next version of SQL Server, which will be version 8, currently known as "Shiloh". Now what is interesting about this version is that it will be fully XML-enabled. Great we hear you say, what does that mean? Well you could for example send it a query like http://IISServer/northwind?sql=SELECT+*+FROM+Customers+FOR+XML+AUTO
The raw xml data returned from a simple query
And a formatted recordset would be returned to your browser. The plus signs are there to replace spaces as you cant have these in an URL. The query would normally read as "Select * from customers" the extra bits "" FOR XML AUTO "" on the end mean, return the results as XML and auto formatted. Its as simple as that. This means that querying databases via a web browser is going to be easier that ever before and is an indication of how important XML is going to be in future Microsoft applications. If you need a bit more control then you just generate a .xml file with say notepad containing:
<?xsl-serverstylesheet xslfile="customer.xsl" ?>
<root xmlns:sql="urn:schemas-microsoft-com:xml-sql">
<sql:query >
select customerid, companyname, contacttitle, contactname, address, city, postalcode, country, phone, fax from customers
for xml auto
</sql:query>
</root>
Where customer.xsl is a style sheet and looks a little more like
HTML that we are familiar with :
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match = "*">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="/">
<HTML>
<BODY>
<DIV STYLE="font-family:Tahoma, Arial, sans-serif;font-size: 24pt; color:green; text-align:center; letter-spacing:8px;font-weight:bold">
Our customers
</DIV>
<HR />
<TABLE WIDTH="100%" CELLPADDING="5">
<xsl:apply-templates select="root"/>
</TABLE>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="customers">
<TR><TD colspan="5" bgcolor="#C0C0C0"><xsl:value-of select = "@companyname" /></TD>
</TR><TR><TD width="5%"></TD>
<TD><b><xsl:value-of select = "@contacttitle" />: </b><xsl:value-of select = "@contactname" /></TD>
<TD><a> <xsl:attribute name = "href">orders.xml?value=<xsl:value-of select= "@customerid"/></xsl:attribute>Show Orders</a></TD>
</TR><TR><TD width="5%"></TD>
<TD><xsl:value-of select = "@address" />, <xsl:value-of select = "@city" />, <xsl:value-of select= "@postalcode"/></TD>
</TR><TR><TD width="5%"></TD>
<TD><xsl:value-of select = "@country"/></TD>
</TR><TR><TD width="5%"></TD>
<TD>Phone: <xsl:value-of select = "@phone"/></TD>
</TR><TR><TD width="5%"></TD>
<TD>Fax: <xsl:value-of select = "@fax"/></TD>
</TR>
</xsl:template>
</xsl:stylesheet>
As you can see this gives you full control over the look of the resultant returned data. To use this you just need to point your browser to http://servername/folder/filename.xml , the query will be done and the results returned formatted, all very simple, not a sign any script code anywhere.
[graphic:formated.bmp caption:Using stylesheets you have full control over the look of the output]
This technology is not just limited to select statements. You can use insert, update and delete queries. Just bare this in mind before you open up your databases in this way!
Version 8 should be available mid-2000 but if you want to have a play in the mean time there is a technology preview available to run on SQL server 7 available on http://msdn.microsoft.com/workshop/xml/articles/xmlsql, obviously dont install this on any important machines as it is only an early look at the technology and is not supported by Microsoft although there is a very active newsgroup at microsoft.public.sqlserver.xml which is worth taking a look at. As further evidence of the growing importance of XML to Microsoft, Visual basic 7 is reported to be using XML extensively for its forms engine, the Microsoft web sites are full of references on how to use XML for solutions. Anyone who is currently developing software needs to read up and learn this enhanced version of HTML as it is going to be a key technology not only for Microsoft but many other vendors.