2007 Aug 6, 5:40
I was messing with the XSLT to XSL Converter
file that can be run with cscript.exe. I've changed it to be like a very basic version of xsltproc
that simply runs an XML file through an XSLT. I
also wanted to run this from the command prompt without writing "cscript ..." everytime. I decided to make like perl programmers I've seen and make a JS file that works as a batch file and a JS file
at the same time.
Here's a basic version of what I ended doing applied to a 'hello world' script named helloworld.cmd:
/* 2> NUL
Says 'Hello world.' when you run it.
var outText = 'Hello world.';
Running this on a command prompt gives the following:
However, after a little more experimentation I found this was slightly overkill for my purposes since if I rename the file to helloworld.js and just type its name like a command it is
run by cscript:
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
So this time I didn't need all that but if ever in the future I need to run a batch file then a JS file I can do it with one file...
2007 May 22, 3:22
I've created an update to the IE7 feed display
After working on my update to the XML source view
I tried running my resourcelist program on other IE DLLs including ieframe. I found that
one of the resources in ieframe is the XSLT used to turn an RSS feed into the IE7 feed display
My first thought for this was that I could embed enclosures into the feed display. For instance, have controls for youtube.com videos or podcast audio files directly in the feed display. However, I
found that I can't use object or embed tags that rely on ActiveX controls in the page or in frames in the feed display.
With that through I decided I could at least add support for some RSS extensions. Thanks to IE7's RSS platform
which provides a
normalized view of RSS feeds it was really easy to do this. I went to several popular RSS feeds and RSS feeds that I like and took a look at the source to see what extensions I might want to add
I added support for their RSS extension
which includes digg count, and submitter name and icon. I
added the digg count in a box on the right and tried to make it fit in stylistically. For the iTunes RSS extension
I add the feed icon, feed author, and descriptions. I was surprised by how much of the podcasts content was missing from the feed view. I also added support for a few other misc things: the slash RSS extension
's section and department, the feed description to the top of the feed display, and the atom author icon.
I wonder what other goodies lurk in IE's resources...
2007 May 18, 1:14
Documentation on adding custom functions to XSLTs run with MSXML3.DLL.
2007 May 17, 5:16
Previously I created some resource tools
and then I used them to overwrite msxml3's
XML source view
. In this update I've added support for the XPointer Framework.
This time around I've started to add support for the XPointer Framework
to my XML source view
I've added installation instructions
. The framework consists of a series of pointer segments each of which has a scheme name followed
by data in parenthesis. For example 'scheme1(data1)scheme2(data2)scheme3(data3)'. A pointer segment resolves to a portion of the XML document based on the data and the scheme name. The whole pointer
resolves to the first segment that successfully resolves. That is, from the example, if scheme1 resolves to nothing and scheme2 resolves to something then that's used and scheme3 is ignored. In
addition to the framework I've added support for the xmlns scheme
which binds namespace prefixes to a namespace URI and the element scheme
which is a simple way to resolve to particular elements in an XML. I also have limited support for the xpointer scheme
the content of which is resolved as an XPath
with some extra functions (which I don't support --
hence the limited). I've also thrown in schemes for the two SelectionLanguage
values supported by msxml3.
Next time I might try to support the xpointer functions that aren't in xpath using msxml script
. But I think I'm losing steam on
this project... we'll see.
2007 May 11, 8:55Last time, I had written some resource tools
to allow me to view and modify Windows module resources in my ultimate and noble quest to
implement the XML content-type fragment in IE7. Using the resource tools I found that MSXML3.DLL isn't signed and that I can replace the XSLT embedded resource with my own, which is great news and
means I could continue in my endevour. In the following I discuss how I came up with this replacement for IE7's XML source view
At first I thought I could just modify the existing XSLT but it turns out that it isn't exactly an XSLT
, rather its an IE5 XSL
. I tried using the XSL to XSLT converter
linked to on MSDN, however the resulting document still
requires manual modification. But I didn't want to muck about in their weird language and I figured I could write my own XSLT faster than I could figure out how theirs worked.
I began work on the new XSLT and found it relatively easy to produce. First I got indenting working with all the XML nodes represented appropriately and different CSS classes attached to them to make
Next was the XML mimetype fragment which uses XPointer
, a framework around various different schemes for naming parts of an XML document. I focused on the
which is an extended version of XPath
. So I named my first task as getting XPaths working.
. From this this I can execute XPaths, however there's no builtin way to map from the XML nodes selected by
position in the document. For instance 'a3-e2-e' is the name produced for the 3rd attribute of the second element of the root element of the XML document. When producing the HTML for an XML node, I
them to their corresponding positions in the HTML.
With the hard part out of the way I changed the onload to get the fragment of the URI of the current document, interpret it as an XPath and highlight and navigate to the selected nodes. I also added
an interactive floating bar from which you can enter your own XPaths and do the same. On a related note, I found that when accessing XML files via the file URI scheme the fragment is stripped off and
The next steps are of course to actually implement XPointer framework parsing as well as the limited number of schemes that the XPointer framework specifies.
2007 May 9, 10:07
My XML source viewer written as XSLT to replace the builtin IE XML source viewer.
2007 May 9, 4:15
I read about text/xml URI fragment resolution
a few months ago. I was interested to find another kind of fragment reference other than the text/html URI
fragment but of course I didn't find an implementation in IE, Firefox, or Opera. I decided to see how much work would be required to implement this in IE.
In IE and Firefox when you open an XML file that doesn't have an XML stylesheet the XML source is rendered with syntax highlighting. In IE I also noticed that the gold bar appears when you open an
XML file off of your local machine. To me this suggested that the XML source was being rendered as HTML which I assumed was produced by running an XSLT on the source XML file. If so, I figured I
could modify the XSLT to implement text/xml URI fragments. I ran FileMon
to see if iexplore.exe loaded an
XSLT file when opening an XML file. Only the XML file and MSXML3.DLL were opened and no XSLTs were loaded as files. My next hope for modifying the XSLT was if it existed as a resource in MSXML3.DLL.
I did a findstr on the DLL for SCRIPT and found an XSLT so I decided to check for resources in MSXML3.DLL. Unfortunately my previous resource viewer didn't work correctly so I decided to write my
I created resource tools
to view and modify resources in Windows modules. The viewer outputs HTML with links to the
individual resources of a module using the res URI scheme
that's built into IE. The modifier is a simple command line tool that
replaces or adds one resource at a time to a module.
Using these tools I found that the XSLT was stored as a resource in MSXML3.DLL. I'll talk more about the existing XSLT and the one I replaced it with next time.
2007 May 3, 12:52
A free tool to convert old style XSL documents into XSLT documents.
2007 May 2, 11:51
Overview of potential security issues when using XML, XSLT, XSD, etc.
2007 May 1, 6:04
A turing machine implemented as an XSLT. A great way to show that XSLT is turing complete.
2007 Jan 19, 9:15
I've moved my homepage to server-side scripting. Previously I've mentioned that I was using client side scripting
to interpret and sort my
livejournal and delicious entries together. Now I'm using PHP
to process and sort my livejournal,
delicious, flickr, and librarything entries. See my homepage
for the finished result.
is pretty cool despite being pretty niche. Its like flickr but for books. I display a random sampling of the covers of books I have listed in
librarything on my page. I've also hooked the display of the covers of my book up to the corner image. Now when you hover over the cover of a book a bigger picture of its cover appears in the corner
of the webpage. Also, flickr entries in the main section how have the same on hover behavior.
This may not be the best use of my time, but its still fun.
2006 Nov 29, 11:35
The Extensible Stylesheet Language Transformation specification.