Picked up a useful piece of information from Xyling Java blog about Java 6 becoming increasingly open source
Building on the success of the snapshot release process started during the development of J2SE 5.0, SUN will make early snapshots available for J2SE 6. This will afford developers the chance to make a greater contribution to the Java development lifecycle. Mb>Only fair considering developers generally have an idea or two about improvements they’d like to see in languages, libraries, API’s etc. Well done to SUN on this developer friendly initiative.
(thinking of coming up with a “developer-friendly” logo similiar to the dolphin friendly one you see on some cans of tuna! Put suggestions on the comments page )
Category: technology
Escaping entities using XSLT
While writing the last post I didn’t fancy the idea of hand escaping the HTML entities into the MSN XML output. So I cheated using a funky little piece of XSLT that I cooked up earlier tonight. It’s listed below…
<xsl:stylesheet version="1.0">
<xsl:output method="xml" indent="yes" omit-xml-declaration="no" doctype-
system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public=
"-//W3C//DTD XHTML 1.0 Transitional//EN"> </xsl:output>
<xsl:template match="/">
<xsl:call-template name="escapexml">
<xsl:with-param name="block" select="."> </xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="escapexml">
<xsl:param name="block"> </xsl:param>
<xsl:for-each select="$block/*|$block/text()">
<xsl:choose>
<xsl:when test="self::text()">
<xsl:value-of select="."> </xsl:value-of>
</xsl:when>
<xsl:otherwise>
<xsl:text> <</xsl:text>
<xsl:value-of select="name(.)"> </xsl:value-of>
<xsl:for-each select="@*">
<xsl:value-of select="concat(' ', name())">
</xsl:value-of>
<xsl:text> ="</xsl:text>
<xsl:value-of select="."> </xsl:value-of>
<xsl:text> "</xsl:text>
</xsl:for-each>
<xsl:text> > </xsl:text>
<xsl:choose>
<xsl:when test="*">
<xsl:call-template name="escapexml">
<xsl:with-param name="block" select=".">
; </xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."> </xsl:value-of>
</xsl:otherwise>
</xsl:choose>
<xsl:text> </</xsl:text>
<xsl:value-of select="name(.)"> </xsl:value-of>
<xsl:text> > </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
I’ll produce a tidier more beautifying version when I get the time but it’s OK for a first attempt and I know of at least one person who’s asked me to do something similiar in the past. And on that note.. it could be time to hit the hay 😉
More on MSH
Just reading the complete Udell article again.
Can’t help but feel that getting an XML representation of system processes over a certain size using a command like: <
MSH> get-process | pick-object name,vs | where { $_.vs -gt 150000000} | convert-xml
is extremely neat. Sample results are listed below. I’m less than convinced about the two-part name/type syntax for the XML representation (it’s a bit clunky) but this is a small quibble.
<MshObjects>
<MshObject ReferenceID="ReferenceId-0" Version="1.1">
<MemberSet>
<Note Name="name" IsHidden="false" IsInstance="true" IsSettable="true">
<string> firefox</string>
</Note>
<Note Name="vs" IsHidden="false" IsInstance="true" IsSettable="true">
<int> 220983296</int>
</Note>
</MemberSet>
</MshObject>
</MshObjects>
Microsoft Shell (MSH)
Read about Microsoft Shell a few months ago and it seems like it’s getting some serious attention. (maybe not as much as MS’s search engine pitch but I’ll hold fire for the moment).
MSH is a genuinely great idea from Microsoft. Not an unusual thing in itself but this is a bit different. To quote Udell
System administration has always been Windows’ Achilles’ heel. The graphical tools that simplify basic chores just get in the way when there’s heavy lifting to be done. And CMD.EXE, the hapless command shell, pales in comparison to the Unix shells that inspired it. Win32 Perl has been my ace in the hole, combining a powerful scripting language with extensions that can wield Windows’ directory, registry, event log, and COM services. But I’ve always thought there should be a better way.
Jeffrey Snover thought so, too. He’s the architect of Monad, aka MSH (Microsoft Shell), the radical new Windows command shell first shown at the Professional Developers Conference last fall.
MSH is quirky, complex, delightful, and utterly addictive. You can, for example, convert objects to and from XML so that programs that don’t natively speak .Net can have a crack at them. There’s SQL-like sorting and grouping. You write ad hoc extensions in a built-in scripting language that feels vaguely Perlish. (sd: reminds me a bit of bash scripting) For more permanent extensions, called cmdlets, you use .Net languages.
This will really appeal to hardcore MS administrators and Winadmins coming from a Unix background. Also this is potentially a reall cool tool to enable the policy based management of collections of windows boxes using .NET commandlets. Very tasty… Thank you Microsoft, just what the doc ordered..